Advertisement
Guest User

test

a guest
Dec 22nd, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. os.loadAPI("button")
  2. M = peripheral.wrap("monitor_1")
  3. M.clear()
  4. C = peripheral.wrap("container_chest_3")
  5. E = peripheral.wrap("ender_chest_0")
  6.  
  7. function fillTable()
  8.   button.setTable("Grinder", grinder, 10, 20, 3, 5)
  9.   button.screen()
  10. end
  11.  
  12. function getClick()
  13.   event,side,x,y = os.pullEvent("monitor_touch")
  14.   button.checkxy(x,y)
  15. end
  16.  
  17. function grinder()
  18.   button.toggleButton("Grinder")
  19.   toggleRedstoneColor(colors.black)
  20. end
  21.  
  22. function toggleRedstoneColor(myColor)
  23.   value = redstone.getBundledOutput("bottom")
  24.   if redstone.testBundledInput("bottom",myColor) then
  25.     redstone.setBundledOutput("bottom",value-myColor)
  26.   else
  27.     redstone.setBundledOutput("bottom",value+myColor)
  28.   end
  29. end
  30.  
  31. function resetMachines()
  32.   redstone.setBundledOutput("bottom",colors.black+colors.yellow)
  33.   C.pullItem("up",1)
  34.   E.pullItem("up",1)
  35. end
  36.  
  37.  
  38.  
  39. resetMachines()
  40. fillTable()
  41. button.heading("MOB KILLER 9000")
  42. while true do
  43.   getClick()
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement