Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- globals
- chunkLoaderInterval = 16
- pX = 1
- pY = 1
- pZ = 1
- -- function definitions
- function checkLavaAndFuel()
- local slot = turtle.getSelectedSlot()
- local fuelLimit = turtle.getFuelLimit()
- if turtle.getFuelLevel() < fuelLimit - 1000 then
- turtle.select(15)
- if turtle.place() then
- if not turtle.refuel() then
- -- we picked up something other than lava (water, etc.)
- turtle.place()
- end
- end
- end
- turtle.select(slot)
- end
- function autoRefuel()
- local slot = turtle.getSelectedSlot()
- checkLavaAndFuel()
- while turtle.getFuelLevel() < 80 do
- turtle.select(16)
- if turtle.refuel(0) then
- -- we can refuel using fuel in slot 16
- turtle.refuel(1)
- end
- end
- turtle.select(slot)
- end
- function isInventoryFull()
- if turtle.getItemCount(12) > 0 then
- return true
- else
- return false
- end
- end
- function dumpInventory()
- local slot = turtle.getSelectedSlot()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.select(14)
- turtle.place()
- for i=1, 12 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.select(14)
- turtle.dig()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.select(slot)
- end
- function checkToPlaceChunkLoader()
- if pX % chunkLoaderInterval == 0 then
- local slot = turtle.getSelectedSlot()
- turtle.select(13)
- turtle.placeUp()
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1, chunkLoaderInterval do
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.digUp()
- for i=1, chunkLoaderInterval do
- turtle.forward()
- end
- turtle.select(slot)
- end
- end
- for x=1, 1000 do
- turtle.forward()
- pX = pX + 1
- checkToPlaceChunkLoader()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement