Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CutTree()
- h = 1
- turtle.dig()
- turtle.forward()
- latitude, longitude, height = gps.locate(2)
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up()
- h = h + 1
- end
- while not turtle.forward() do
- turtle.dig()
- end
- for i=1,h,1 do
- latitude, longitude, height = gps.locate(2)
- if height > 6 then
- turtle.digDown()
- turtle.down()
- end
- end
- turtle.turnRight()
- while not turtle.forward() do
- turtle.dig()
- end
- for i=1,h,1 do
- turtle.digUp()
- turtle.up()
- end
- turtle.turnRight()
- while not turtle.forward() do
- turtle.dig()
- end
- for i=1,h,1 do
- latitude, longitude, height = gps.locate(2)
- if height > 6 then
- turtle.digDown()
- turtle.down()
- end
- end
- turtle.turnRight()
- while not turtle.forward() do
- turtle.dig()
- end
- turtle.turnRight()
- turtle.back()
- h = 1
- end --CutTree
- function DumpInventory()
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- for i=1,16,1 do
- turtle.select(i)
- turtle.drop()
- end
- turtle.back()
- turtle.back()
- turtle.turnLeft()
- turtle.select(1)
- end --DumpInventory
- function Main()
- while true do
- latitude, longitude, height = gps.locate(2)
- n = turtle.getFuelLevel()
- if n > 320 then
- turtle.up()
- if turtle.detect() then
- turtle.down()
- CutTree()
- DumpInventory()
- end
- if not turtle.detect() then
- turtle.down()
- end
- if not height == 6 then
- if height > 6 then
- turtle.down()
- end
- if height < 6 then
- turtle.up()
- end
- end
- end
- sleep(15)
- n = turtle.getFuelLevel()
- print(n)
- end
- end --Main
- Main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement