Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while not turtle.detectDown() do
- turtle.down() -- get the turtle down to the ground.
- end
- turtle.up() -- to keep the turtle 1 block up in the air.
- -- I got 2 pieces of log, and I want to craft a chest...
- -- The log is in the first position in the turtles inventory
- turtle.select(1)
- turtle.craft(2)
- for i = 1, 9 do -- I THINK this will execute 8 times, starting on 1...
- if i == 4 or i == 6 or i == 8 then i = i + 1 end -- to get the crafting grid for a chest.
- if i ~= 8 then turtle.dropDown(8 - i) end -- drop the stuff below the turtle, unless it's on it's 8th run.
- if i ~= 1 then turtle.select(i) end -- select the correct slot (not on first run)
- if i ~= 8 then turtle.suckDown() end -- pick everything thats below up again, putting it in the expected slot.
- end
- if not turtle.craft() then
- print("Failed crafting!")
- end
- -- so the turtle should place wooden planks in this pattern:
- -- [ ] [ ] [ ]
- -- [ ] N/A [ ]
- -- [ ] [ ] [ ]
- -- unless someone else picks up the blocks or if extra blocks where placed below
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement