Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x = 1
- local y = 0
- rednet.open("right")
- function getSapling()
- rednet.broadcast("x: " .. x .. " | y: " .. y)
- while true do
- turtle.select(1)
- turtle.select(1)
- sleep(0.02)
- if turtle.getItemCount() == 0 then
- print("Out of Saplings...")
- Waiting()
- end
- Placing()
- end
- end
- -----------------------
- function Waiting()
- rednet.broadcast("Out of Saplings!")
- while true do
- sleep(0,5)
- if turtle.getItemCount() ~= 0 then
- getSapling()
- end
- end
- end
- --------------
- function Placing()
- local success, block = turtle.inspect()
- if block.name == "minecraft:log" then
- Move()
- end
- turtle.select(1)
- turtle.place()
- while true do
- turtle.select(1)
- turtle.place()
- turtle.select(2)
- turtle.place()
- local success, block = turtle.inspect()
- if block.name == "minecraft:log" then
- Move()
- end
- end
- end
- --------------
- function Move()
- rednet.send(278, "go")
- if x == 0 and y == 0 then
- turtle.turnLeft()
- turtle.back()
- x = x + 1
- local sidex1 = false
- local sidex2 = true
- local sidey1 = false
- local sidey2 = false
- getSapling()
- end
- if x == 10 and y == 7 then
- turtle.turnLeft()
- turtle.back()
- x = x - 1
- local sidex1 = true
- local sidex2 = false
- local sidey1 = false
- local sidey2 = false
- getSapling()
- end
- if x == 0 and y == 7 then
- turtle.turnLeft()
- turtle.back()
- y = y - 1
- local sidey1 = true
- local sidey2 = false
- local sidex1 = false
- local sidex2 = false
- getSapling()
- end
- if x == 10 and y == 0 then
- turtle.turnLeft()
- turtle.back()
- y = y + 1
- local sidey1 = false
- local sidey2 = true
- local sidex1 = false
- local sidex2 = false
- getSapling()
- end
- if x >= 1 or x <= 9 and y == 0 or y == 7 then
- turtle.back()
- if sidex1 == true then
- x = x - 1
- getSapling()
- end
- if sidex2 == true then
- x = x + 1
- getSapling()
- end
- end
- if y >= 1 or y <= 6 and x == 0 or x == 10 then
- turtle.back()
- if sidey1 == true then
- y = y - 1
- getSapling()
- end
- if sidex2 == true then
- y = y + 1
- getSapling()
- end
- end
- end
- ---------------
- getSapling()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement