Guest User

touch

a guest
Aug 1st, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. os.loadAPI("button")
  2. m = peripheral.wrap("left")
  3. m.clear()
  4.  
  5. function button1() button.toggleButton("on")
  6. print("Salut")
  7. rs.setOutput("left",true)
  8. sleep(1)
  9. button.toggleButton("on")
  10. end
  11.  
  12. function button2() button.toggleButton("off")
  13. print("bonjour")
  14. rs.setOutput("left",false)
  15. sleep(1)
  16. button.toggleButton("off")
  17. end
  18.  
  19. function ecran()
  20. button.setTable("on",button1,1,2,3,4)
  21. button.setTable("off",button2,5,6,7,8)
  22. button.screen()
  23. end
  24.  
  25. function getClick()
  26. event,side,x,y = os.pullEvent("monitor_touch")
  27. button.checkxy(x,y)
  28. end
  29.  
  30. ecran()
  31.  
  32. while true do getClick() end
Advertisement
Add Comment
Please, Sign In to add comment