Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[Author: Sandbag
- Simple script that digs UPWARDS, the size you specify.
- TO DO:
- -better fuel management
- -chest dumps
- pastebin get Kz0HAwU3 digup
- ]]
- 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 High? : ")
- z = tonumber(io.read())
- print (x..", "..y..", "..z)
- function refueling()
- print("Refueling from slot 1")
- turtle.select(1)
- turtle.refuel()
- end
- function bore() --[dig up]
- local height = z-1
- while height > 0 do
- turtle.digUp()
- turtle.up(1)
- height = height-1
- end
- for i = 1 , z-1 do
- turtle.down()
- end
- end
- function ydig() --[dig out]
- local ydig = y
- while ydig > 0 do
- bore()
- if ydig > 1
- then
- if turtle.detect()
- then
- turtle.dig()
- end
- end
- turtle.forward(1)
- ydig = ydig-1
- end
- for i = 1,y-1
- 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()
- if xdig > 1
- then
- turn()
- end
- xdig = xdig-1
- end
- end
- xcavate()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement