Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool inPit = false
- int loops = 1
- local function forward(count)
- if count == nil then count = 1 end
- for i = 0, count do
- turtle.forward()
- end
- end
- local function up(count)
- if count == nil then count = 1 end
- for i = 0, count do
- turtle.up()
- end
- end
- local function down(count)
- if count == nil then count = 1 end
- for i = 0, count do
- turtle.down()
- end
- end
- local function turnLeft(count)
- if count == nil then count = 1 end
- for i = 0, count do
- turtle.turnLeft()
- end
- end
- local function turnRight(count)
- if count == nil then count = 1 end
- for i = 0, count do
- turtle.turnRight()
- end
- end
- local function enterPit()
- turtle.forward(3)
- down()
- inPit = true
- return true
- end
- local function exitPit()
- turnLeft(2)
- up()
- forward(3)
- turnLeft(2)
- inPit = false
- return true
- end
- local function deposit()
- turnLeft()
- turtle.up()
- forward(2)
- for i = 3,16 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
- turnRight(2)
- forward(2)
- turtle.down()
- turnLeft()
- return true
- end
- local function refuel()
- if inPit then
- exitPit()
- end
- deposit()
- turnRight()
- turtle.select(2)
- turtle.place()
- turtle.select(1)
- turnLeft
- forward(2)
- down()
- turtle.digDown()
- os.sleep(3)
- turtle.placeDown()
- turtle.refuel()
- exitPit()
- forward()
- turnRight()
- turtle.dig()
- turtle.select(3)
- turtle.transferTo(2)
- return true
- end
- local function digLoopOnce()
- function turnCorner()
- forward()
- turnRight()
- forward()
- end
- turtle.digDown()
- turnLeft()
- turnCorner()
- turtle.digDown()
- turnCorner()
- turtle.digDown()
- turnCorner()
- turtle.digDown()
- turnCorner()
- turnRight()
- end
- local function start()
- enterPit()
- for i = 0,loops do
- if turtle.getFuelLevel() < 1000 then
- exitPit()
- refuel()
- enterPit()
- end
- digLoopOnce()
- if getItemCount(16) > 0 then
- deposit()
- end
- end
- exitPit()
- end
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement