Guest User

control

a guest
Dec 23rd, 2014
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.60 KB | None | 0 0
  1. os.loadAPI("Button")
  2. m = peripheral.wrap("right")
  3. m.clear()
  4.  
  5. function fillTable()
  6.     button.setTable("LightsOn", LightsOn, 20,40,3,10)
  7.     button.setTable("LightsOff", LightsOff, 60,80,3,10)
  8.     button.screen()
  9. end
  10.  
  11. function getClick()
  12.     event,side,x,y = os.pullEvent("monitor_touch")
  13.     button.checkxy(x,y)
  14. end
  15.  
  16. function test1()
  17.     button.toggleButton("LightsOn")
  18.     print("LightsOn")
  19. end
  20.  
  21. function test2()
  22.     button.toggleButton("LightsOn")
  23.     print("LightsOn")
  24. end
  25.  
  26. fillTable()
  27. button.heading("SpaceShipControl")
  28. button.label(30,10,"Lights")
  29.  
  30. while true do
  31.     getClick()
  32. end
Advertisement
Add Comment
Please, Sign In to add comment