Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[Author: Sandbag
- Simple script that digs a hole, the size you specify.
- TO DO:
- -better fuel management
- -chest dumps
- ]]
- function checkfuel()
- local fuel=tonumber(turtle.getFuelLevel())
- if fuel < 70
- then
- print("************")
- print("*")
- print("*")
- print("* Need Fuel!!")
- print("*")
- print("*")
- print("* Place Coal in slot 1")
- print("************")
- end
- end
- checkfuel()
- io.write("Blocks in front of turtle? : ")
- y = tonumber(io.read())
- io.write("Blocks to the right? : ")
- x = tonumber(io.read())
- io.write("How Deep? : ")
- z = tonumber(io.read())
- --[ print (x..","..y..","..z) ]
- function refueling()
- print("Refueling from slot 1")
- turtle.select(1)
- turtle.refuel()
- end
- function bore() --[dig down]
- local depth = z
- while depth > 0 do
- turtle.digDown(1)
- turtle.down(1)
- depth = depth-1
- end
- for i = 1 , z do
- turtle.up()
- end
- end
- function ydig() --[dig out]
- local ydig = y
- while ydig > 0 do
- bore()
- if turtle.detect()
- then
- turtle.dig()
- end
- turtle.forward(1)
- ydig = ydig-1
- end
- for i = 1,y do
- turtle.back()
- end
- end
- function turn()
- turtle.turnRight()
- if turtle.detect()
- then
- turtle.dig()
- end
- turtle.forward()
- turtle.turnLeft()
- end
- function xcavate() --[dig across]
- local xdig = tonumber(x)
- while xdig > 0 do
- if tonumber(turtle.getFuelLevel()) < 70
- then
- refueling()
- end
- ydig()
- turn()
- xdig = xdig-1
- end
- end
- xcavate()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement