Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- modem = peripheral.wrap("bottom")
- for i = 1,10 do
- modem.open(i)
- end
- self = "turtle_226"
- tank = "industrialforegoing:black_hole_tank_tile_6"
- spawner = peripheral.wrap("industrialforegoing:mob_duplicator_tile_35")
- sensor = peripheral.wrap("right")
- tool = peripheral.wrap("industrialforegoing:black_hole_unit_tile_224")
- dump = peripheral.wrap("railcraft:chest_void_2")
- function spawn(wave)
- spawner.pullFluid(tank,8000,"essence")
- turtle.select(wave)
- redstone.setOutput("front",true)
- spawner.pullItems(self,11)
- sleep(0.2)
- turtle.place()
- spawner.pushItems(self,7)
- redstone.setOutput("front",false)
- end
- function clearWither()
- tool.pushItems(self,1,16,1)
- turtle.select(16)
- turtle.place()
- dump.pullItems(self,16)
- turtle.select(1)
- end
- function dumpStars()
- if turtle.getItemCount(12) > 0 then
- dump.pullItems(self,12)
- end
- end
- function getMsg()
- while true do
- msg = {os.pullEvent("modem_message")}
- wave = msg[3]
- prog = msg[4]
- end
- end
- function manageBar()
- while true do
- if (wave and prog) then
- spawn(wave)
- currentWave = wave
- while sensor.getMetaByName("WitherBoss") do
- if wave ~= currentWave then
- clearWither()
- else
- if ((sensor.getMetaByName("WitherBoss").health/3) > prog) then
- turtle.attack()
- end
- end
- end
- dumpStars()
- elseif sensor.getMetaByName("WitherBoss") then
- clearWither()
- else
- sleep()
- end
- end
- end
- parallel.waitForAll(getMsg,manageBar)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement