Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function do_forward()
- while not turtle.forward() do
- if not turtle.dig() then
- turtle.attack()
- end
- end
- end
- local function do_up()
- while not turtle.up() do
- if not turtle.digUp() then
- turtle.attackUp()
- end
- end
- end
- local function do_down()
- while not turtle.down() do
- if not turtle.digDown() then
- turtle.attackDown()
- end
- end
- end
- local function go_elevator()
- do_forward()
- turtle.turnRight()
- for i = 1,3 do
- do_forward()
- end
- turtle.turnLeft()
- end
- local function go_home()
- turtle.turnLeft()
- turtle.turnLeft()
- do_forward()
- turtle.turnRight()
- for i = 1,3 do
- do_forward()
- end
- turtle.turnRight()
- end
- local level = 0
- local function go_level(i)
- if level == 0 and i > 0 then
- for i = 1,(5+4*i) do
- do_up()
- end
- elseif i == 0 and level > 0 then
- for i = 1,(5+4*level) do
- do_down()
- end
- elseif level > i then
- for i = 1,(4*(level-i)) do
- do_down()
- end
- else
- for i = 1,(4*(i-level)) do
- do_up()
- end
- end
- level = i
- end
- local function do_cycle(i)
- shell.run("trees.lua")
- go_elevator()
- go_level(4*i)
- do_forward()
- shell.run("champs.lua", 1, 24)
- level = 4*i-3
- turtle.back()
- go_level(0)
- go_home()
- end
- do_cycle(1)
- do_cycle(2)
- do_cycle(3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement