Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local bool = true
- local i = 0
- m = peripheral.wrap("left")
- function redback(y)
- for i=1, y do
- redstone.setOutput("back",true)
- sleep(1)
- redstone.setOutput("back",false)
- sleep(1)
- end
- end
- function redtop(y)
- for i=1, y do
- redstone.setOutput("top",true)
- sleep(1)
- redstone.setOutput("top",false)
- sleep(1)
- end
- end
- function showMonitorON(x, y)
- m.clear()
- m.setCursorPos(x, y)
- m.setTextColor( colors.green )
- m.setTextScale(1.5)
- m.write("ON")
- end
- function showMonitorOFF(x, y)
- m.clear()
- m.setCursorPos(x, y)
- m.setTextColor( colors.red )
- m.setTextScale(1.5)
- m.write("OFF")
- end
- while true do
- event, param1, param2 = os.pullEvent("monitor_touch")
- if (event == "monitor_touch") and bool then
- redback(5)
- bool = false
- showMonitorON(1, 2)
- else if (event == "monitor_touch") and not(bool) then
- redtop(5)
- bool = true
- showMonitorOFF(3, 2)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement