For future reference all questions should be directed to the Ask a Pro section.
local oldPullEvent = os.pullEvent
os.pullEvent = os.pullEventRaw
local password = "0182"
local specialPassowrd = "2810" -- other password
term.clear()
term.setCursorPos(1,1)
print("Welcome. Please enter password.")
print("")
term.write("Enter Password: ")
local input = read("*")
if input == password then
print("Access Granted")
rs.setOutput("left",true)
sleep(4)
rs.setOutput("left",false)
os.reboot()
elseif input == specialPassowrd then -- if input not same as passowrd then if input same as special password
print("Disableing Ctrl + T protect")
os.pullEvent = oldPullEvent -- restore os.pullEvent
else -- if input not same as password ans special password then do this
print("Access Denied")
sleep(3)
os.shutdown()
end
uh oh, there appears to be another problem.
local oldPullEvent = os.pullEvent
os.pullEvent = os.pullEventRaw
local password = "0182"
local engineer = "2810"
term.clear()
term.setCursorPos(1,1)
print("Welcome. Please enter password.")
print("")
term.write("Enter Password: ")
local input = read("*")
if input == password then
print("")
print("Access Granted")
rs.setOutput("left",true)
sleep(4)
rs.setOutput("left",false)
os.shutdown()
elseif input == engineer then
print("")
print("Engineer Status Confirmed")
term.write("Unlocking")
textutils.slowPrint("...")
sleep(2)
term.clear
term.setCursorPos(1,1)
os.pullEvent = oldPullEvent
else
print("")
print("Access Denied")
sleep(3)
os.shutdown()
end
in case it wasnt obvious, i change a few names and added a few extra lines to make it look more neat. this is the error i get when i try to run it: bios:338: [string "startup"]:27: '=' expected
ive tried everything i can think of to fix it. i am assuming that 27 is a line number, so i removed the line and got the same error. line 27 is " term.setCursorPos(1,1)"
and while im getting your attention, you wouldnt happen to know how to exactly copy and paste a program from say, notepad into the computer, would you? whenever i try ctrl v it adds part of the first line i was trying to paste and saves it
thanks in advance