Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Ein Codeschloss fuer einen Computer aus Computercraft
- -- Abgewandelt von der Codeschloss Tuer des Tekkit Lite Wiki
- local password = "PASSWORT HIER"
- local time = 230
- local tries = 5
- local run = 1
- local function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- os.pullEvent = os.pullEventRaw
- while run == 1 do
- clear()
- print("TurtleLock v.1.3")
- write("Password: ")
- local input = read()
- if input == password then
- clear()
- print("TurtleLock v.1.3")
- print("Passwort korrekt")
- rs.setOutput("left", true)
- sleep(5)
- rs.setOutput("left", false)
- tries = 5
- elseif input == "'access" then
- clear()
- print("TurtleLock v.1.3")
- print("Passwort korrekt")
- rs.setOutput("left", true)
- os.sleep(5)
- rs.setOutput("left", false)
- tries = 5
- elseif input == "'reboot" then
- os.reboot()
- elseif input == "'newpass" then
- clear()
- term.write("Neues Password: ")
- password = read()
- elseif input == "'settries" then
- clear()
- term.write("Versuche: ")
- tries = tonumber(read())
- elseif input == "'settime" then
- clear()
- term.write("Wartezeit: ")
- time = tonumber(read())
- elseif input == "'terminate" then
- clear()
- print("Programm wird beendet")
- sleep(2)
- else
- print ("Password falsch!")
- tries = tries - 1
- if tries == 0 then
- print ("Keine weiteren Versuche")
- sleep(time)
- else
- if tries > 0 then
- print(tries.." uebrige Versuche")
- else
- print("")
- print("FEHLER : Versuche duerfen nicht unter")
- print("0 betragen!")
- print("")
- print("Fehler betragen: "..tries)
- sleep(5)
- end
- end
- sleep(2)
- end
- end
- print("Herunterfahren...")
- sleep(2)
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment