Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chest = peripheral.wrap("left")
- local Data = {}
- local Size = chest.getInventorySize()
- local sensor = peripheral.wrap("right")
- function FillData()
- for i=1,Size do
- Data[i] = {}
- if chest.getStackInSlot(i) ~= nil then
- for k,v in pairs(chest.getStackInSlot(i)) do
- Data[i][k] = v
- end
- end
- end
- end
- function Kill()
- for i = 1,#sensor.getMobIds() do
- for k,v in pairs(sensor.getMobData(sensor.getMobIds()[i])) do
- if k == "type" and v == "Water Guardian" then
- for 1,10 do
- turtle.attack()
- end
- Kill()
- else
- turtle.suck()
- turtle.turnLeft()
- for i = 1,14 do
- turtle.select(i)
- turtle.drop()
- end
- end
- end
- end
- end
- while rs.getInput("back") == true do
- turtle.select(16)
- if turtle.getItemCount(16) == 32 then
- for i = 1,#Data do
- if Data[i]["name"] == "bucket" then
- chest.pushItemIntoSlot(2,i,32,16)
- end
- end
- end
- turtle.dropDown()
- turtle.select(1)
- turtle.dropUp()
- turtle.select(15)
- if turtle.getItemCount(15) == 32 then
- for i = 1,#Data do
- if Data[i]["name"] == "boat" then
- chest.pushItemIntoSlot(2,i,32,15)
- end
- end
- end
- turtle.dropUp()
- sleep(5)
- Kill()
- end
Advertisement
Add Comment
Please, Sign In to add comment