Advertisement
EliteGaming

mob

Aug 8th, 2014
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. os.loadAPI("button")
  2. local m = peripheral.wrap("monitor_0")
  3.  
  4.  
  5. Bottom = Grinder
  6. Top = Lights
  7. Left = MobSpawner
  8.  
  9.  
  10.  
  11. local function default()
  12. rs.setOutput("left", true)
  13.  
  14. rs.setOutput("bottom", false)
  15. button.toggleButton("Grinder")
  16.  
  17. rs.setOutput("top", false)
  18. end
  19.  
  20.  function menu()
  21. m.clear()
  22.  button.setTable("Lights", lights, 4,26 ,2,6)
  23.  button.setTable("Grinder", grinder, 4,26 ,8,12)
  24.  button.setTable("Spawner", spawner, 4,26 ,14,17)
  25.  button.setTable("Reboot", reboot, 2,28, 19,20)
  26. button.screen()
  27. default()
  28. end
  29.  
  30. function reboot()
  31. os.reboot()
  32. end
  33.  
  34. function grinder()
  35. if  rs.getOutput("bottom")
  36.  then grinderOn() else grinderOff()
  37. end
  38. end
  39.  
  40. function spawner()
  41. if  rs.getOutput("left")
  42.  then spawnerOn() else spawnerOff()
  43. end
  44. end
  45.  
  46. function lights()
  47. if rs.getOutput("top") then
  48.  lightsOn() else lightsOff()
  49. end
  50. end
  51.  
  52.  
  53. function lightsOn()
  54. rs.setOutput("top", false)
  55. button.toggleButton("Lights")
  56. end
  57.  
  58. function lightsOff()
  59. rs.setOutput("top", true)
  60. button.toggleButton("Lights")
  61. end
  62.  
  63.  
  64. function grinderOn()
  65. rs.setOutput("bottom", false)
  66. button.toggleButton("Grinder")
  67. end
  68.  
  69. function grinderOff()
  70. rs.setOutput("bottom", true)
  71. button.toggleButton("Grinder")
  72. end
  73.  
  74.  
  75. function spawnerOn()
  76. rs.setOutput("left", false)
  77. button.toggleButton("Spawner")
  78. activatorOn()
  79. end
  80.  
  81. function spawnerOff()
  82. rs.setOutput("left", true)
  83. button.toggleButton("Spawner")
  84. activatorOff()
  85. end
  86.  
  87.  
  88. function getClick()
  89.    local event,side,x,y = os.pullEvent()
  90.    if event=="monitor_touch" then
  91.      button.checkxy(x,y)
  92.    end
  93. end
  94.  
  95.  
  96. menu()
  97.  
  98. while true do
  99.    getClick()
  100. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement