Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Script to work with grinder interface and xp collector
- -- written by craftersanonmoose
- -- version history
- -- version 0.1
- -- should display amount of xp in collector as well as turn on the grinder
- -- may add in bottling ability later
- -- version 0.2
- -- added in button to turn on a wall lamp connected to a redstone integrator
- --------------------------------------------------
- os.loadAPI("button")
- mon = peripheral.wrap("right")
- mon.clear()
- -- change name of these as needed
- c9 = peripheral.wrap("xp_collector_9")
- grinder = peripheral.wrap("grinder_0")
- ri = peripheral.wrap("redstoneIntegrator_1")
- function fillTable()
- -- Reactor Section
- button.setTable("Light On", lightOn, 2,8,7,9)
- button.setTable("Light Off", lightOff, 10,16,7,9)
- button.screen()
- end
- function getClick()
- event,side,x,y = os.pullEvent("monitor_touch")
- button.checkxy(x,y)
- end
- function showLevel()
- mon.setCursorPos(1,3)
- mon.write("Collector:")
- mon.setCursorPos(11,3)
- mon.write(c9.getCurrentXP())
- end
- function murder()
- local success, err = pcall(function()
- grinder.attack()
- sleep(3)
- end)
- if not success then
- print("Error occured:", err)
- end
- end
- function lightOn()
- ri.setAnalogOutput("front", 15)
- button.flash("Light")
- end
- function lightOff()
- ri.setAnalogOutput("front", 0)
- button.flash("Light")
- fillTable()
- button.heading("Mob Grinder")
- while true do
- showLevel()
- murder()
- getClick()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement