Advertisement
fantadada

Base silot

Dec 21st, 2015
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.92 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("Silot 1")
  9. rednet.broadcast("s1")
  10. button.toggleButton("Silot 1")
  11.  end
  12. end
  13.  
  14. function button2() button.toggleButton("Silot 2")
  15. rednet.broadcast("s2")
  16. button.toggleButton("Silot 2")
  17.  end
  18. end
  19.  
  20. function button3() button.toggleButton("Silot 3")
  21. rednet.broadcast("s3")
  22. button.toggleButton("Silot 3")
  23.  end
  24. end
  25.  
  26. function button4() button.toggleButton("Silot 4")
  27. rednet.broadcast("s4")
  28. button.toggleButton("Silot 4")
  29.  end
  30. end
  31.  
  32. function ecran()
  33. button.setTable("Silot 1",button1,8,25,3,3)
  34. button.setTable("Silot 2",button2,8,25,6,6)
  35. button.setTable("Silot 4",button3,8,25,9,9)
  36. button.setTable("Silot 4",button4,8,25,12,12)
  37.  
  38. button.screen()
  39. end
  40.  
  41. function getClick()
  42. event,side,x,y = os.pullEvent("monitor_touch")
  43. button.checkxy(x,y)
  44. end
  45.  
  46. ecran()
  47.  
  48. while true do getClick() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement