Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wait(condition, compare, cb)
- compare = compare == nill and true or compare
- while (condition ~= compare) do
- if (cb) then
- cb()
- end
- os.sleep(0.1)
- end
- return true
- end
- function fuel() {
- local old = turtle.getSelectedSlot()
- while (turtle.getFuelLevel() < 10) do
- turtle.select(16)
- turtle.refuel()
- end
- turtle.select(old)
- }
- function forward(steps) {
- fuel()
- wait(turtle.forward)
- return true
- }
- function up(steps) {
- fuel()
- wait(turtle.up)
- return true
- }
- turtle.select(1)
- wait(turtle.compare)
- turtle.dig()
- forward()
- function a()
- turtle.digUp()
- up()
- end
- wait(turtle.detectUp, false, a)
- wait(turtle.down, false)
- turtle.turnRight()
- turtle.turnRight()
- forward()
- turtle.turnRight()
- turtle.turnRight()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement