Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Program made by Warfar
- --http://pastebin.com/u/warfar
- term.clear()
- term.setCursorPos(1 , 1)
- local status
- if redstone.getInput("back") == true then
- status = "ON"
- else status = "OFF"
- end
- local i = 0
- local function printstatus()
- term.clear()
- term.setCursorPos(1 , 1)
- print("==========")
- print(" STATUS ")
- print(" ON ")
- print("==========")
- print(" >ON< ")
- print(" OFF ")
- print("==========")
- term.setCursorPos(5 , 4)
- end
- local function printstatusoff()
- term.clear()
- term.setCursorPos(1 , 1)
- print("==========")
- print(" STATUS ")
- print(" OFF ")
- print("==========")
- print(" ON ")
- print(" >OFF< ")
- print("==========")
- term.setCursorPos(5 , 4)
- end
- printstatus()
- while true do
- local key = os.pullEvent("key")
- if key == 208 and i == 0 then
- printstatusoff()
- i = 1
- end
- if key == 28 and i == 0 then
- status = "ON"
- elseif param1 == 28 and i == 1 then
- status = "OFF"
- printstatus()
- end
- if key == 200 and i == 1 then
- printstatus()
- i = 0
- end
- if status == "ON" then
- redstone.setOutput("back", true)
- end
- if status == "OFF" then
- redstone.setOutput("back", false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment