Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----Quarry Bot Redux----
- --Variables--
- t = turtle
- --Functions--
- function f()
- if t.detect() then
- t.dig()
- t.forward()
- else
- t.forward()
- end
- end
- function d()
- if t.detectDown() then
- t.digDown()
- t.down()
- else
- t.down()
- end
- end
- function refuel()
- if t.getFuelLevel() == 0 then
- pleaseRefuel()
- end
- end
- function store()
- if t.getItemCount(16) > 0 then
- pleaseStore()
- end
- end
- function pleaseRefuel()
- t.select(1)
- t.digUp()
- t.placeUp()
- t.suckUp()
- t.refuel()
- t.digUp()
- end
- function pleaseStore()
- t.select(2)
- t.digUp()
- t.placeUp()
- num = 3
- while num < 17 do
- t.select(num)
- t.dropUp()
- num = num + 1
- end
- t.select(2)
- t.digUp()
- end
- function checkers()
- refuel()
- store()
- end
- function layer()
- x = 16
- z = 16
- dot = true
- while x > 1 do
- while z > 1 do
- checkers()
- f()
- z = z - 1
- end
- if dot then
- t.turnRight()
- if not (x == 2) then
- f()
- end
- t.turnRight()
- dot = not dot
- else
- t.turnLeft()
- if not (x == 2) then
- f()
- end
- t.turnLeft()
- dot = not dot
- end
- z = 16
- x = x - 1
- end
- d()
- end
- function quarry()
- y = io.read()
- y = tonumber(y)
- while y > 0 do
- layer()
- y = y - 1
- end
- end
- quarry()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement