Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lvl = 40
- --count = tArgs[1]
- function fuel()
- print( "checkfuel" )
- if noFuel() then
- local f = 1
- turtle.select(f)
- while not turtle.refuel() do
- f = f + 1
- turtle.select(f)
- end
- end
- print("leaving checkfuel")
- end
- function noFuel()
- print( turtle.getFuelLevel())
- if turtle.getFuelLevel() < 5 then
- return true
- else
- return false
- end
- end
- function moveDown(count)
- for v = 1, count, 1 do
- fuel()
- turtle.digDown()
- turtle.down()
- end
- end
- function moveUp(count)
- for vi = 1, count, 1 do
- fuel()
- turtle.digUp()
- turtle.up()
- end
- end
- function moveBack(count)
- for vii = 1, count, 1 do
- fuel()
- if not turtle.back() then
- turtle.turnRight()
- turtle.turnRight()
- moveForward(1)
- turtle.turnRight()
- turtle.turnRight()
- end
- end
- end
- function getCobble()
- cob = 1
- turtle.select(cob)
- if turtle.getItemCount(cob) <2 then
- cob = cob + 1
- end
- turtle.select(cob)
- end
- function moveForward(count)
- for iv = 1, count, 1 do
- print( "about to moveforward" )
- fuel()
- turtle.dig()
- turtle.forward()
- end
- end
- function sCaseDown(count)
- for iii = 1, count, 1 do
- fuel()
- moveDown(1)
- turtle.digDown()
- getCobble()
- turtle.placeDown()
- turtle.turnLeft()
- for ii = 1, 2, 1 do
- fuel()
- moveForward(1)
- turtle.digDown()
- getCobble()
- turtle.placeDown()
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- end
- if math.fmod(iii, 5) == 0 then
- turtle.select(16)
- turtle.place()
- end
- turtle.turnRight()
- moveForward(1)
- for i = 1, 3, 1 do
- fuel()
- turtle.turnLeft()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- if i < 3 then
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- else
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.turnRight()
- turtle.turnRight()
- end
- end
- end
- end
- function sCaseUp(count)
- fuel()
- for ix = 1, count, 1 do
- for viii = 1, 5, 1 do
- fuel()
- moveForward(1)
- turtle.turnLeft()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.turnLeft()
- end
- turtle.turnLeft()
- getCobble()
- turtle.place()
- turtle.turnRight()
- turtle.turnRight()
- turtle.place()
- turtle.turnLeft()
- moveBack(1)
- getCobble()
- turtle.place()
- moveBack(3)
- moveUp(1)
- turtle.turnLeft()
- turtle.dig()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.turnLeft()
- end
- end
- sCaseDown(lvl)
Add Comment
Please, Sign In to add comment