Posted 11 April 2018 - 11:51 PM
Im building a underground base with a light system. When you go inside the base to turn on the lights(and all the other computers) u have to write in the password. I keep getting the error <eof> expected. Please help! i can also show u the lightson script.
Heres the startup:
Heres the startup:
local password = "elliot9999" -- Change this to what you want your password to be.
local oldPull = os.pullEventRaw
os.pullEvent = os.pullEventRaw
term.clear()
term.setCursorPos(1,1)
term.setTextColor(colors.lightBlue)
print("Please enter password to activate base.")
term.setTextColor(colors.yellow)
write("> ")
term.setTextColor(colors.gray)
local input = read("*")
if input == password then
term.clear()
term.setCursorPos(1,1)
term.setTextColor(colors.lime)
print("Welcome back, TheBeast99100")
sleep(2)
term.clear()
term.setCursorPos(1,1)
shell.run("/lightson")
rs.setOutput("back", true)
end
else
term.setTextColor(colors.red)
term.clear()
term.setCursorPos(1,1)
print("Access Denied.")
sleep(1)
term.clear()
term.setCursorPos(1,1)
end
os.pullEvent = oldPull
and the lightson script
term.clear()
term.setCursorPos(1,1)
term.setTextColor(colors.purple)
print("Press enter to shutdown base")
input = io.read()
if input == "" then
rs.setOutput("back", false)
os.reboot()
end
else
rs.setOutput("back", false)
os.reboot()
end