Advertisement
Guest User

elevator

a guest
Jan 29th, 2015
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. os.loadAPI("button")
  2. m = peripheral.wrap("top")
  3. m.clear()
  4.  
  5. function fillTable()
  6.   button.setTable("Call", Call, 10,20,2,4)
  7.   button.setTable("Down", Down, 10,20,8,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 Call()
  17.   button.flash("Call")
  18.   print("Call")
  19. end
  20.  
  21. function Down()
  22.   button.flash("Down")
  23.   print("Down")
  24. end
  25.  
  26. fillTable()
  27. while true do
  28.   getClick()
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement