Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local yes = ""
- local no == ""
- local yo == ""
- local la == ""
- while true do -- start infinite loop
- shell.run("clear")
- print (" Panic Room Door control 0.2v")
- print (" ----------------------------")
- print (" [1] Open Door ")
- print (" [2] Close Door ")
- print (" [3] Exit ")
- print (" [4] Shutdown Computer ")
- a, b = os.pullEvent()
- while a ~= "key" do a,b = os.pullEvent()
- if b == 1 then
- yes = 1
- elseif b == 2 then
- no = 1
- elseif b == 3 then
- yo = 1
- elseif b == 4 then
- la = 1
- end
- end
- if yes == 1 then
- redstone.setOutput ("back", false)
- redstone.setOutput ("down", false)
- shell.run("startup") break -- break loop before continuing
- end
- if no == 1 then redstone.setOutput ("back", true)
- redstone.setOutput ("down", true)
- shell.run("startup")
- break -- break the loop before proceeding
- end
- if yo == 1 then sleep(0) -- to avoid an error
- if la == 1 then sleep(1)
- os.shutdown()
- end
- end -- end the loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement