Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- X = 0
- Y = 0
- Z = 0
- function fuel()
- for i = 1,16 do
- itemInfo = turtle.getItemDetail(i)
- if itemInfo == nil then
- else
- if itemInfo["name"] == "minecraft:coal" then
- turtle.select(i)
- turtle.refuel(itemInfo["count"])
- end
- end
- end
- end
- function depositItems()
- fuel()
- for d = 1,16 do
- turtle.select(d)
- turtle.drop()
- end
- end
- function updateloc(x,y,z)
- X = X+x
- Y = Y+y
- Z = Z+z
- end
- function forward()
- turtle.dig()
- turtle.forward()
- updateloc(1,0,0)
- end
- function up()
- turtle.digUp()
- turtle.up()
- updateloc(0,1,0)
- end
- function down(amount)
- for p = 1,amount do
- turtle.digDown()
- turtle.down()
- updateloc(0,0,-1)
- end
- end
- function back(blockamount)
- turtle.turnRight()
- turtle.turnRight()
- for i = 1, blockamount do
- turtle.dig()
- forward()
- updateloc(-1,0,0)
- end
- turtle.turnRight()
- turtle.turnRight()
- end
- function dig()
- fuel()
- turtle.dig()
- up()
- turtle.dig()
- up()
- turtle.dig()
- down(2)
- fuel()
- end
- function digRight()
- turtle.turnRight()
- dig()
- turtle.turnLeft()
- end
- function digLeft()
- turtle.turnLeft()
- dig()
- turtle.turnRight()
- end
- function mineRows(amount)
- for p = 1,amount do
- digLeft()
- digRight()
- dig()
- forward()
- end
- gohome = amount
- goHome()
- end
- function goHome()
- back(gohome)
- gohome = 0
- for i = 1,16 do
- turtle.select(i)
- turtle.drop()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement