Advertisement
fantadada

ecran acenseur n1

Aug 25th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. os.loadAPI("button")
  2. rednet.open("top")
  3. m = peripheral.wrap("back")
  4. m.clear()
  5.  
  6.  
  7.  
  8. function button1() button.toggleButton("-1")
  9. rednet.broadcast("-1")
  10. button.toggleButton("-1")
  11.  end
  12. end
  13.  
  14. function button2() button.toggleButton("-2")
  15. rednet.broadcast("-2")
  16. button.toggleButton("-2")
  17.  end
  18. end
  19.  
  20. function button3() button.toggleButton("-3")
  21. rednet.broadcast("-3")
  22. button.toggleButton("-3")
  23.  end
  24. end
  25.  
  26.  
  27. function ecran()
  28. button.setTable("-1",button1,8,25,3,3)
  29. button.setTable("-2",button2,8,25,6,6)
  30. button.setTable("-3",button2,8,25,9,9)
  31. button.screen()
  32. end
  33.  
  34. function getClick()
  35. event,side,x,y = os.pullEvent("monitor_touch")
  36. button.checkxy(x,y)
  37. end
  38.  
  39. ecran()
  40.  
  41. while true do getClick() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement