Posted 24 May 2014 - 02:47 AM
The following code asks the user a question, then does an action based on the answer. However, the code always defaults to the first choice. Why might that be happening?
EDIT: Found out it does work, it's just the OR command not doing what it should.
os.pullEvent = os.pullEventRaw
print "FactoryOS is loading!"
sleep(3)
print "Worker or boss?"
e = read()
if e == "worker" or "Worker" then
print "Welcome Worker!"
shell.run("chat join Factory Worker"..os.getComputerID())
sleep(3)
os.reboot()
elseif e == "Boss" or e == "boss" then
print "What is the password?"
pass = read("*")
if pass == "password" then
print "Welcome Boss!"
shell.run("chat join Factory Boss"..os.getComputerID())
sleep(3)
os.reboot()
else
print "Rebooting"
sleep(3)
os.reboot()
end
end
EDIT: Found out it does work, it's just the OR command not doing what it should.
Edited on 24 May 2014 - 12:58 AM