Advertisement
fantadada

8

Dec 21st, 2015
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. os.loadAPI("button")
  2. rednet.open("top")
  3. m = peripheral.wrap("back")
  4. m.clear()
  5.  
  6. m.write("Menu des lancement:")
  7.  
  8. function button1() button.toggleButton("Luncher 1")
  9. rednet.broadcast("up")
  10. button.toggleButton("Luncher 1")
  11.  end
  12.  
  13.  
  14. function button2() button.toggleButton("Luncher 2")
  15. rednet.broadcast("up2")
  16. button.toggleButton("Luncher 2")
  17.  end
  18. end
  19.  
  20. function button3() button.toggleButton("Luncher 3")
  21. rednet.broadcast("up3")
  22. button.toggleButton("Luncher 3")
  23.  end
  24.  
  25.  
  26. function button4() button.toggleButton("Luncher 4")
  27. rednet.broadcast("up4")
  28. button.toggleButton("Luncher 4")
  29.  end
  30.  
  31.  
  32. function ecran()
  33. button.setTable("Luncher 1",button1,8,25,3,3)
  34. button.setTable("Luncher 2",button2,8,25,6,6)
  35. button.setTable("Luncher 3",button3,8,25,6,6)
  36. button.setTable("Luncher 4",button4,8,25,6,6)
  37. button.screen()
  38. end
  39.  
  40. function getClick()
  41. event,side,x,y = os.pullEvent("monitor_touch")
  42. button.checkxy(x,y)
  43. end
  44.  
  45. ecran()
  46.  
  47. while true do getClick() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement