Knux14

ButtonSample

Jul 6th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.39 KB | None | 0 0
  1. os.loadAPI("button")
  2. m = peripheral.wrap("back")
  3. m.clear()
  4.  
  5. function fillTable()
  6.    button.setTable("Button", test1, _MINx, _MAXx, _MINy, _MAXy)
  7.    button.screen()
  8. end
  9.  
  10. function getClick()
  11.    event,side,x,y = os.pullEvent("monitor_touch")
  12.    button.checkxy(x,y)
  13. end
  14.  
  15. function test1()
  16.    button.flash("Button")
  17.    --DoStuff
  18. end
  19.  
  20. fillTable()
  21.  
  22. while true do
  23.    getClick()
  24. end
Advertisement
Add Comment
Please, Sign In to add comment