Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap("back")
- while true do
- event, side, xPos, yPos = os.pullEvent("monitor_touch")
- if xPos ~= 0 and yPos ~= 0 then
- m.setBackgroundColor(colors.green)
- m.clear()
- rs.setOutput("left", true)
- sleep(3)
- m.setBackgroundColor(colors.red)
- m.clear()
- rs.setOutput("left", false)
- else
- m.setBackgroundColor(colors.red)
- m.clear()
- rs.setOutput("left", false)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement