Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function findStartingPosition()
- print("Running findStartingPosition...")
- repeat
- if turtle.detectDown() == false then
- turtle.down()
- end
- until turtle.detectDown() == true
- repeat
- if turtle.detectDown() == true then
- turtle.forward()
- end
- isBlockFront, whatBlockFront = turtle.inspect()
- until whatBlockFront.name == "minecraft:chest"
- end
- function goToLava()
- print("Running Go To Lava...")
- repeat
- turtle.down()
- isBlockDown, whatBlockDown = turtle.inspectDown()
- until whatBlockDown.name == "minecraft:log"
- repeat
- turtle.forward()
- isBlockFront, whatBlockFront = turtle.inspect()
- until whatBlockFront.name == "minecraft:chest"
- end
- function goToSurface()
- print("Running goToSurface...")
- repeat
- turtle.back()
- isBlockDown, whatBlockDown = turtle.inspectDown()
- until whatBlockDown.name == "minecraft:log"
- repeat
- turtle.up()
- isBlockFront, whatBlockFront = turtle.inspect()
- until whatBlockFront.name == "minecraft:chest"
- end
- function pickupLavaBuckets()
- print("Running pickupLavaBuckets...")
- repeat
- os.sleep(2)
- full = 1
- for i = 1,16 do
- turtle.select(i)
- turtle.suck()
- if turtle.getItemCount() < 1 then
- full = 0
- end
- end
- until full == 1
- end
- function dropLavaBuckets()
- print("Running dropLavaBuckets...")
- repeat
- isBlockFront, whatBlockFront = turtle.inspect()
- print("No Chest Found")
- os.sleep(1)
- until whatBlockFront.name == "minecraft:chest"
- repeat
- empty = 1
- print("Empty = 1")
- for i = 1,16 do
- turtle.select(i)
- if turtle.getItemCount() > 0 then
- slotInfo = turtle.getItemDetail()
- if (slotInfo.name == "minecraft:lava_bucket") or (slotInfo.name == "minecraft:bucket") then
- turtle.drop()
- empty = 0
- print("empty = 0")
- end
- end
- end
- until empty == 1
- end
- while 0==0 do
- findStartingPosition()
- pickupLavaBuckets()
- goToSurface()
- dropLavaBuckets()
- goToLava()
- end
Advertisement
Add Comment
Please, Sign In to add comment