Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local up = 0
- local right_movement = 0
- local last = "left"
- function getTree()
- turtle.dig()
- turtle.forward()
- while turtle.detectUp() do
- turtle.digUp()
- turtle.up()
- up = up + 1
- end
- repeat
- turtle.down()
- up = up - 1
- until up == 0
- turtle.digDown()
- turtle.select(1)
- turtle.placeDown()
- end
- function back(amount)
- local _back = 0
- repeat
- turtle.back()
- _back = _back + 1
- until _back == amount
- end
- function forward(amount)
- local _forward = 0
- repeat
- turtle.forward()
- _forward = _forward + 1
- until _forward == amount
- end
- function start()
- turtle.turnLeft()
- turtle.forward()
- for q=4,16 do
- turtle.select(q)
- turtle.dropDown()
- end
- back(2)
- turtle.select(1)
- turtle.suckDown(25)
- back(3)
- turtle.select(2)
- turtle.suckDown(25)
- back(3)
- turtle.select(3)
- turtle.suckDown(25)
- forward(7)
- turtle.turnRight()
- end
- function walk()
- local forward = 0
- repeat
- if turtle.forward() == false then
- getTree()
- else
- forward = forward + 1
- end
- until forward == 21
- end
- function moveRight()
- turtle.turnRight()
- forward(3)
- turtle.turnRight()
- right_movement = right_movement + 1
- last = "right"
- end
- function moveLeft()
- turtle.turnLeft()
- forward(3)
- turtle.turnLeft()
- right_movement = right_movement + 1
- last = "left"
- end
- start()
- turtle.up()
- repeat
- walk()
- if last == "left" then
- moveRight()
- elseif last == "right" then
- moveLeft()
- end
- until right_movement == 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement