LordIkol, on 15 May 2013 - 06:31 AM, said:
Hi Elgriton,
The txtfile has to be altered to look like this, so remove the "passs =" stuff
{"XTF93hlQV+sf9x4aB0GOtA==","56u2g+nWTUjFsB4AFM7Lg=="}
local function loadTable(str) -- create a function where str is path and filename for the password file
local h = fs.open(tostring(str), "r") -- opens the file in read mode
local nstr = h.readAll() -- reads the content to a string
local newtable = textutils.unserialize(nstr) -- converts the string to a table
return newtable -- returns the table
end
passs = loadTable("pass.txt") -- use the new function to assign the table to a variable
for i =1,#passtable do -- this is just a loop to show the passwords
print(passs[i]) -- you can access the password by index
end
Greets Loki
This confuses me a bit, I dont get any errors when i run it, and when i print the passwords it works fine, but i cant use them in an iff statement, meaning
if pass == "whatever" then
print("works?")
else
print("no works:(")
end
replacing "whatever" with whatever you want to compare in the table