Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fromHome = 0
- finished = false
- term.clear()
- term.setCursorPos(1,1)
- print("Ready to commence simpole tree harvest!")
- print()
- print("Place wood blocks in Slot 1.")
- print("Place saplings in Slot 16.")
- print()
- print("Press [ENTER] to begin.")
- read(input)
- -- Functions
- local function fuel()
- if turtle.getFuelLevel() < 1000 then
- turtle.refuel(1)
- end
- end
- local function tMove(distance)
- fuel()
- for i=1,distance do
- while turtle.forward() == false do
- turtle.dig()
- turtle.attack()
- sleep(0.5)
- end
- end
- end
- local function tDescend(distance)
- for i=1,distance do
- while turtle.down() == false do
- turtle.digDown()
- turtle.attackDown()
- sleep(0.5)
- end
- end
- end
- local function tAscend(distance)
- for i=1,distance do
- while turtle.up() == false do
- turtle.digUp()
- turtle.attackUp()
- sleep(0.5)
- end
- end
- end
- local function turnaround()
- turtle.turnRight()
- turtle.turnRight()
- end
- -- Main Loop
- while fromHome < 8 do
- tMove(2)
- height = 0
- turtle.select(1)
- tMove(1)
- while turtle.detectUp() == true do
- tAscend(1)
- height = height + 1
- end
- tDescend(height)
- turtle.digDown()
- turtle.select(16)
- turtle.placeDown()
- turtle.select(1)
- fromHome = fromHome + 1
- end
- turtle.turnRight()
- tMove(1)
- turtle.turnRight()
- tMove(3*fromHome)
- turtle.turnRight()
- tMove(1)
- turtle.turnRight()
- for i=2,15 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
Advertisement
Add Comment
Please, Sign In to add comment