I've been into programming recently and I have problems setting up a security system. Since FTB modpack Infinity Evolved has no opensensors I'm forced to use Openperipherals its sensor.
I have looked up on similair threads and recreate them for hours but can't seem to let them work. This is as close as I can get:
x = peripheral.wrap("left")
playername = x.getPlayers()
print(playername)
Entering this code in Lua gives me an UUID and a name. However, using this code outside Lua gives me a table which constantly changes. I am programming with "edit test4", I have removed all my functions and began with a clean slate to get a better understanding on how this works :
sensor = peripheral.wrap("left")
playername = sensor.getPlayers()
print(playername)
How can I retrieve only the name so I can make an authorisation list? Do I have to convert table to string? Is that even effective, since it constantly changes when applying a loop command(while true do) or keep running test4?
Thank you in advance!