jille_Jr icon

CC: Crafting script Mk.3

jille_Jr | PRO | 09/27/12 08:18:56 PM UTC | 0 ⭐ | 379 👁️ | Never ⏰ | []
Lua |

690 B

|

None

|

0 👍

/

0 👎

-- got 2 log in slot 1
turtle.select(1)
turtle.craft(2)
 
local z = 0
while turtle.detect() do -- This makes sure that it's empty in front of the turtle.
  turtle.turnRight()
  if z ~= 4 then z = z + 1 end
  if z == 4 then
    turtle.select(16)
    turtle.dig()
    turtle.drop()
    turtle.select(1)
  end
end
 
local x = 0
for i = 1, 8 do
  x = x + 1
  if x == 4 or x == 8 or x == 6 then x = x + 1 end
  turtle.select(1) -- Instead of turtle.drop() and turtle.suck() we use turtle.place() and turtle.dig()
  turtle.place()
  turtle.select(x)
  turtle.dig()
end
 
turtle.select(1)
 
if not turtle.craft() then
  print("Failed crafting!")
else
  print("Successful crafting!")
end

Comments