This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Laser's profile picture

Username Problem

Started by Laser, 07 May 2013 - 02:21 PM
Laser #1
Posted 07 May 2013 - 04:21 PM

os.pullEvent = os.pullEventRaw
function newLine()
local _,cY = term.getCursorPos()
term.setCursorPos(1,cY+1)
end

while true do
term.clear()
term.setCursorPos(1, 1)
print("Username: ")
if input == "Laser_Face" or "Bodog999" or "grimmjowx" or "DonViper" or "nyan3r" or "AngeredLotus" or "Zakira" then
shell.run("pass")
end
end 
else

newLine()
print("Username not found in database!")
sleep(10)
os.reboot()
end
end
end
Error is:

bios:338: [string "startup"]:15: '<eof>'  expected
Please Help!
Thanks
Lyqyd #2
Posted 07 May 2013 - 05:17 PM
Split into new topic.

There are a number of problems here. Chief among them are `end` placement (should be if / else / end, not if / end / else / end) and your use of `or`. You need to evaluate it against the value each time: `if username == "bob" or username == "george" then` since what you have now always evaluates to true.