--[[ Load API ]]--
os.loadAPI("redos")
--[[ Local Variables ]]--
local username
local password
local eUsername
local ePassword
local line
local file
local running = true
--[[ Main ]]--
while running do
redos.clear()
redos.header()
file = fs.open("systemdata/first.txt", "r")
line = file.readLine()
file.close()
if line == "true" then
write("Register username: ")
username = read()
redos.clear()
redos.header()
write("Register password: ")
password = read("*")
if not fs.exists("userdata/"..username) then
fs.makeDir("userdata/"..username)
file = fs.open("userdata/"..username.."/password.txt", "w")
file.writeLine(password)
file.close()
end
file = fs.open("systemdata/first.txt", "w")
file.writeLine("false")
file.close()
running = false
redos.clear()
redos.header()
end
write("Enter username: ")
eUsername = read()
redos.clear()
redos.header()
write("Enter password: ")
ePassword = read("*")
redos.clear()
redos.header()
if fs.exists("userdata/"..eUsername) then
file = fs.open("userdata/"..eUsername.."/password.txt")
line = fs.readLine()
file.close()
if line == ePassword then
print("Welcome,"..eUsername.."!")
os.sleep(1)
running = false
end
end
end
The code works fine until I enter the password for the system, and it gives me:
pass: 65: bad argument: string expected, got nil
I've run through all debugging methods I know of, and got zilch. Here's my system hierarchy:
systemdata > first.txt
userdata > MemoryLeak21 > password.txt
And my API just has header() and clear(), which do visual and unimportant things.
Anyone recognize the problem?












