Advertisement
matope3

ouverture

Sep 2nd, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.37 KB | None | 0 0
  1. m = peripheral.wrap("back")
  2.  
  3. while true do
  4.  
  5. event, side, xPos, yPos = os.pullEvent("monitor_touch")
  6.  
  7. if xPos ~= 0 and yPos ~= 0 then
  8. m.setBackgroundColor(colors.green)
  9. m.clear()
  10. rs.setOutput("left", true)
  11. sleep(3)
  12. m.setBackgroundColor(colors.red)
  13. m.clear()
  14. rs.setOutput("left", false)
  15. else
  16. m.setBackgroundColor(colors.red)
  17. m.clear()
  18. rs.setOutput("left", false)
  19. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement