Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Version 2.4
- Written by: Tom Nordloh (Notze)
- This script will dig a box with the
- length you wish!
- Place the following things into the
- Turtles inventory:
- Slot 1: cole
- ]]
- -- make your adjustments here
- local int x = 5 -- from Turtle's direction right
- local int y = 5 -- height, like Minecraft (F3) y
- local int z = 5 -- in Turtle's looking direction
- -- end of adjustments
- function main()
- local futherDown = false
- for i=1, y, 1 do
- refuel( 1 + ((x*z)/96) + ((x+y)/96) )
- down(1)
- local boolean nextEndUp = true
- forward(z-1)
- for j=2, x, 1 do
- if nextEndUp then
- turnRight()
- forward(1)
- turnRight()
- forward(z-1, futherDown)
- nextEndUp = false
- else
- turnLeft()
- forward(1)
- turnLeft()
- forward(z-1, futherDown)
- nextEndUp = true
- end
- end
- if nextEndUp then
- turnAround()
- else
- turnRight()
- forward(x-1, futherDown)
- turnRight()
- end
- futherDown = true
- end
- up(y)
- end
- function refuel(amount)
- if turtle.getFuelLevel() < 96*amount then
- turtle.select(1)
- turtle.refuel(amount)
- end
- end
- function forward(length, fast)
- for i=1, length, 1 do
- if fast then
- turtle.dig()
- turtle.forward()
- else
- while turtle.detect() do
- turtle.dig()
- --sleep(0.5)
- end
- turtle.forward()
- end
- end
- end
- function back(length)
- for i=1, length, 1 do
- turtle.back()
- end
- end
- function turnRight()
- turtle.turnRight()
- end
- function turnLeft()
- turtle.turnLeft()
- end
- function turnAround()
- turnRight()
- turnRight()
- end
- function up(length)
- for i=1, length, 1 do
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.5)
- end
- turtle.up()
- end
- end
- function down(length)
- for i=1, length, 1 do
- turtle.digDown()
- turtle.down()
- end
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment