Posted 11 June 2012 - 06:34 PM
hi i got help from mystic to this code but now is says this error and i wrote this exact thing
error msg: bios:206: [string "startup"]:51 'end' expected (to close 'while at line 21) FIXED THX
Edited
when ever i type sicet7 as a username it pop's up with an error
error msg: startup:29 attempt to index ? (a nil value)
-- Prevent Termination
local oldPullEvent = os.pullEvent
os.pullEvent = os.pullEventRaw
-- Setup usernames and passwords
local tUsers = {
["sicet7"] = "joymax",
["sacho101"] = "Password2",
["Knirksen"] = "Password3",
["muldyr1995"] = "Password4"
}
local function clear()
term.clear()
term.setCursorPos(1, 1)
end
-- Infinite loop
while true do
clear()
-- Ask for username
write("User: ")
local usr = read()
-- Check username
if tUsers[usr] ~= nil then
-- Ask for password
write("Password: ")
local pass = read("*")
-- Check password
if pass == tUsers[usr] then
print("Opening the door...")
-- open door here
else
print("Wrong password")
sleep(2)
end
else
print("No such user ", usr)
sleep(2)
end
os.pullEvent = oldPullEvent
error msg: bios:206: [string "startup"]:51 'end' expected (to close 'while at line 21) FIXED THX
Edited
when ever i type sicet7 as a username it pop's up with an error
error msg: startup:29 attempt to index ? (a nil value)