Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Benutzer Variablen
- openTime = tonumber("6") -- Wann soll die Tür geöffnet werden
- closeTime = tonumber("19") -- Wann soll die Tür geschloßen werden
- RedOutput = "bottom" -- Wo soll das Redstone Signal ausgegeben werden
- -- System Variablen
- -- Nichts verändern ohne Lua Kenntnisse
- tag = "Nein"
- shell.run("clear")
- function wecker()
- local event = os.pullEvent("alarm")
- update()
- end
- function update()
- if (os.time() > openTime and os.time() < closeTime) then
- redstone.setOutput(RedOutput, true)
- tag = "Ja"
- else
- redstone.setOutput(RedOutput, false)
- tag = "Nein"
- end
- end
- function eingabe()
- antwort = read("*")
- if antwort == "Tekkit" then
- redstone.setOutput(RedOutput,true)
- sleep(5)
- redstone.setOutput(RedOutput, false)
- else
- print("Access denied")
- end
- os.reboot()
- end
- function dashboard()
- shell.run("clear")
- print("Haupteingang")
- print("Tag: " .. tag)
- if tag == "Nein" then
- write("Passwort: ")
- end
- end
- -- Einmalig
- update()
- while true do -- Schleife
- os.setAlarm(openTime)
- os.setAlarm(closeTime)
- dashboard()
- if tag == "Ja" then
- wecker()
- else
- parallel.waitForAny(eingabe, wecker)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement