Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. API = require("buttonAPI")
  2. local event = require("event")
  3. local computer = require("computer")
  4. local term = require("term")
  5. local component = require("component")
  6. local gpu = component.gpu
  7.  
  8. local rs = component.redstone
  9. local colors = require("colors")
  10. local side = require("sides")
  11.  
  12. function API.fillTable()
  13. API.setTable("Enderman", Enderman, 10,20,3,5)
  14. API.setTable("Skeleton", Skeleton, 22,32,3,5)
  15. API.setTable("Wither Skeleton", WitherSkeleton, 10,20,8,10)
  16. API.setTable("Slime", Slime, 22,32,8,10)
  17. API.screen()
  18. end
  19.  
  20. function getClick()
  21. local _, _, x, y = event.pull(1,touch)
  22. if x == nil or y == nil then
  23. local h, w = gpu.getResolution()
  24. gpu.set(h, w, ".")
  25. gpu.set(h, w, " ")
  26. else
  27. API.checkxy(x,y)
  28. end
  29. end
  30.  
  31. function enderman()
  32. API.toggleButton("Toggle")
  33. if buttonStatus == true then
  34. -- # If the button is on (green) do something.
  35. else
  36. -- # If the button is off (red) do this instead.
  37. end
  38. end
  39.  
  40. function Skeleton()
  41. API.toggleButton("Toggle")
  42. if buttonStatus == true then
  43. -- # If the button is on (green) do something.
  44. else
  45. -- # If the button is off (red) do this instead.
  46. end
  47. end
  48.  
  49. function WitherSkeleton()
  50. API.toggleButton("Toggle")
  51. if buttonStatus == true then
  52. -- # If the button is on (green) do something.
  53. else
  54. -- # If the button is off (red) do this instead.
  55. end
  56. end
  57.  
  58. function Slime()
  59. API.toggleButton("Toggle")
  60. if buttonStatus == true then
  61. -- # If the button is on (green) do something.
  62. else
  63. -- # If the button is off (red) do this instead.
  64. end
  65. end
  66.  
  67. term.setCursorBlink(false)
  68. gpu.setResolution(80, 25)
  69. API.clear()
  70. API.fillTable()
  71.  
  72. while true do
  73. getClick()
  74. end
  75.  
  76.  
  77.  
  78. --eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement