SHARE
TWEET

Control

a guest Apr 22nd, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top