Advertisement
Guest User

Control

a guest
Apr 22nd, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.35 KB | None | 0 0
  1. os.loadAPI("touch")
  2. mon = peripheral.wrap("right")
  3.  
  4. local t1 = touch.new("right")
  5. local t = t1
  6.  
  7. function writeButtons()
  8. t1:add("fuel",nil,2,2,8,4, colors.red, colors.blue)
  9. t=t1
  10. t:draw()
  11. end
  12.  
  13. writeButtons()
  14.  
  15. while true do
  16. local event, p1 = t:handleEvents(os.pullEvent())
  17. if event == "button_click" then
  18. t:toggleButton(p1)
  19. print(p1)
  20. end
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement