Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x, y, xsize, ysize
- local msg = "open"
- local mon = peripheral.wrap("top")
- mon.setBackgroundColor(colors.green)
- mon.clear()
- while true do
- event, side, xpos, ypos = os.pullEvent("monitor_touch")
- if msg == "close" then
- msg = "open"
- mon.setBackgroundColor(colors.green)
- mon.clear()
- rs.setOutput("right", false)
- elseif msg == "open" then
- msg = "close"
- mon.setBackgroundColor(colors.red)
- mon.clear()
- rs.setOutput("right", true)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement