Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local T
- local function checkFuelNeeded(quantity)
- local fuelNeeded = quantity - turtle.getFuelLevel() -- eg 600
- if fuelNeeded > 0 then
- T:checkInventoryForItem({"minecraft:lava_bucket", "coal", "planks"}, {1, math.ceil(fuelNeeded / 60), math.ceil(fuelNeeded / 15)}) -- 0 if not present
- T:refuel(quantity, true)
- end
- end
- local function getSupplies()
- T:clear()
- T:checkInventoryForItem({"minecraft:chest"}, {4}, true)
- T:checkInventoryForItem({"stairs"}, {16}, true)
- T:checkInventoryForItem({"minecraft:lava_bucket"}, {1}, true)
- T:checkInventoryForItem({"minecraft:water_bucket"}, {1}, true)
- end
- local function createGenerator()
- local function placeStairs(path, direction)
- T:go(path)
- T:place("minecraft:cobblestone_stairs", 0, direction)
- end
- checkFuelNeeded(250)
- getSupplies()
- T:up(2)
- T:place("minecraft:chest", 0, "forward")
- placeStairs("U1", "forward") -- first stairs, facing inwards, to hold water
- placeStairs("U1B1","down") -- stairs on opposite side, centre of back edge
- placeStairs("R1F1L1","down") -- stairs on back left corner
- placeStairs("F1L1","down") -- centre left
- placeStairs("R1F1L1","down") -- front left corner
- placeStairs("F2L2","down") -- front centre
- placeStairs("R1F1L1","down") -- front right corner
- placeStairs("R1F1L1","down") -- right side centre
- placeStairs("B1","forward") -- right back corner, top layer
- for i = 1, 3 do -- back, left and front top layer
- placeStairs("R1F1L1F2L1","forward")
- placeStairs("R1F1L1","forward")
- end
- placeStairs("R1F1L1F2L1","forward") -- right centre top layer
- T:go("U1F2L1F1R2x2") -- move above water source step and dig out covering stair
- T:place("minecraft:water_bucket", 0, "down")
- placeStairs("D1B1","forward") -- replace stairs removed to allow water access
- T:go("U1F2L2D2") -- move to 1 above final position
- T:place("minecraft:lava_bucket", 0, "up")
- T:down(1) -- move to final position
- for i = 1, 3 do -- place remaining 3 chests
- T:turnRight(1)
- T:place("minecraft:chest", 0, "forward")
- end
- end
- function main()
- T = require("lib.clsTurtle"):new(true) -- true enables logfile to log.txt
- createGenerator()
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement