Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local line = 0
- local active = false
- local function Info(str, cls)
- if (cls) then
- term.clear()
- term.setCursorPos(1, 1)
- end
- print(str)
- end
- local function Refuel()
- if (turtle.getFuelLevel() == 0) then
- local sl = 1
- turtle.select(16)
- Info("Exepted refueling...", true)
- while (not turtle.refuel(1)) do sleep(1) end
- Info("Refueling is complete!", false)
- turtle.select(sl)
- end
- end
- local function Init()
- Info("Need wood block!", true)
- while (turtle.getItemCount(1) == 0) do sleep(1) end
- Refuel()
- turtle.dig()
- turtle.suck()
- turtle.forward()
- active = true
- end
- Init()
- while active do
- Refuel()
- if (turtle.compare()) then
- turtle.dig()
- turtle.suck()
- if (line % 2 == 0) then
- turtle.digUp()
- turtle.suckUp()
- turtle.up()
- else
- turtle.digDown()
- turtle.suckDown()
- turtle.down()
- end
- else
- line = line + 1
- if (line == 1) then
- turtle.dig()
- turtle.suck()
- turtle.forward()
- turtle.turnRight()
- turtle.dig()
- turtle.suck()
- turtle.forward()
- turtle.turnRight()
- turtle.dig()
- turtle.suck()
- turtle.digDown()
- turtle.suckDown()
- turtle.down()
- elseif (line == 2) then
- turtle.up()
- turtle.forward()
- turtle.forward()
- Info("Felling the tree is complete.", true)
- active = false
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement