Posted 10 May 2012 - 09:00 PM
Id like to know how i can return to a previous segment of the code. For example this is a simple door lock i made. (I'm LUAtarded)
pass = "diggydiggyhole"
os.pullEvent = os.pullEventRaw
term.clear()
print ("At this time please enter your level 5 security code.")
print (" ")
write "Security Code: "
input = read("*")
if input == pass then
term.clear()
term.setCursorPos(1,1)
print ("Access Granted")
redstone.setOutput("left", true )
sleep(5)
os.reboot()
else
term.setCursorPos(1,1)
term.clear()
print ("Security Code Invalid")
print (" ")
print ("Terminal Will Now Reboot")
sleep(2)
os.reboot()
end
in this part here, how can i make it return to the first line, or any other line, without re-typing the code? Instead of rebooting, id just like it to return to the top line, clear the screen, and go from there like the code says. is this possible?
else
term.setCursorPos(1,1)
term.clear()
print ("Security Code Invalid")
print (" ")
print ("Terminal Will Now Reboot")
sleep(2)
os.reboot()
end
pass = "diggydiggyhole"
os.pullEvent = os.pullEventRaw
term.clear()
print ("At this time please enter your level 5 security code.")
print (" ")
write "Security Code: "
input = read("*")
if input == pass then
term.clear()
term.setCursorPos(1,1)
print ("Access Granted")
redstone.setOutput("left", true )
sleep(5)
os.reboot()
else
term.setCursorPos(1,1)
term.clear()
print ("Security Code Invalid")
print (" ")
print ("Terminal Will Now Reboot")
sleep(2)
os.reboot()
end
in this part here, how can i make it return to the first line, or any other line, without re-typing the code? Instead of rebooting, id just like it to return to the top line, clear the screen, and go from there like the code says. is this possible?
else
term.setCursorPos(1,1)
term.clear()
print ("Security Code Invalid")
print (" ")
print ("Terminal Will Now Reboot")
sleep(2)
os.reboot()
end