Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local face = 1
- function chop()
- save()
- restock()
- turtle.up()
- for i=1, 34/2 do
- go()
- tree()
- go()
- end
- left()
- go()
- go()
- go()
- left()
- for i=1, 34/2 do
- go()
- tree()
- go()
- end
- turtle.down()
- dropAll()
- left()
- go()
- go()
- go()
- left()
- end
- function left()
- file =fs.open("/cords/face.txt", "w")
- turtle.turnLeft()
- face = (face-1) % 4
- file.writeLine(face)
- file.close()
- end
- function right()
- file =fs.open("/cords/face.txt", "w")
- turtle.turnRight()
- face = (face+1) % 4
- file.writeLine(face)
- file.close()
- end
- function go()
- turtle.dig()
- turtle.digUp()
- turtle.forward()
- end
- function tree()
- turtle.select(13)
- if not turtle.compareDown() then
- turtle.digDown()
- turtle.placeDown()
- end
- turtle.select(1)
- if turtle.detectUp() then
- local n = 0
- for i=1, 5 do
- if not turtle.detectUp() then
- break
- end
- n = n + 1
- turtle.digUp()
- turtle.up()
- end
- for i=1, n do
- turtle.down()
- end
- end
- end
- function restock()
- right()
- right()
- turtle.select(13)
- turtle.suck( 64 - turtle.getItemCount(13) )
- right()
- turtle.forward()
- left()
- if turtle.getFuelLevel() < 500 then
- while turtle.getFuelLevel() < 2000 do
- turtle.select(9)
- turtle.suck(1)
- turtle.refuel()
- end end
- left()
- turtle.forward()
- left()
- end
- function dropAll()
- for slot=1, 16 do
- if slot ~= 13 then
- turtle.select(slot)
- turtle.drop()
- end
- end
- end
- function save()
- x, y, z = gps.locate()
- file = fs.open("/cords/chopStart.txt", "w")
- file.writeLine(x)
- file.writeLine(y)
- file.writeLine(z)
- file.close()
- end
- return chop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement