Advertisement
fantadada

ecran rez

Oct 7th, 2015
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 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("Ouvrire")
  9. rednet.broadcast("open")
  10. button.toggleButton("Ouvrir")
  11.  end
  12. end
  13.  
  14. function button2() button.toggleButton("Ferme")
  15. rednet.broadcast("close")
  16. button.toggleButton("Ferme")
  17.  end
  18. end
  19.  
  20.  
  21.  
  22. function ecran()
  23. button.setTable("Ouvrire",button1,8,25,3,3)
  24. button.setTable("Ferme",button2,8,25,6,6)
  25. button.screen()
  26. end
  27.  
  28. function getClick()
  29. event,side,x,y = os.pullEvent("monitor_touch")
  30. button.checkxy(x,y)
  31. end
  32.  
  33. ecran()
  34.  
  35. while true do getClick() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement