Advertisement
feedmecookies

iphone

Jul 16th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. --defines----
  2. term.setBackgroundColor(colors.black)
  3. term.setTextColor(colors.red)
  4.  
  5. -------------
  6.  
  7.  
  8.  
  9. --functions--
  10.  
  11. function test()
  12. sleep(0)
  13. end
  14.  
  15. function clear()
  16. term.setBackgroundColor(colors.black)
  17. term.clear()
  18. term.setCursorPos(1,1)
  19. end
  20.  
  21. function addButton(xmin,ymin,xmax,ymax,func,text)
  22. term.setBackgroundColor(colors.green)
  23. term.setCursorPos(xmin,ymin)
  24. term.write(text)
  25. event, button, x, y = os.pullEvent("mouse_click")
  26. if x >= xmin and x <= xmax and y >= ymin and y <= ymax then
  27. func()
  28. end
  29. end
  30. -------------
  31.  
  32. while true do
  33.  
  34. addButton(1,1,4,2,test,"hi")
  35. addButton(1,3,4,4,test,"fgt")
  36.  
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement