Advertisement
jille_Jr

CC: Crafting script Mk.3

Sep 27th, 2012
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. -- got 2 log in slot 1
  2. turtle.select(1)
  3. turtle.craft(2)
  4.  
  5. local z = 0
  6. while turtle.detect() do -- This makes sure that it's empty in front of the turtle.
  7.   turtle.turnRight()
  8.   if z ~= 4 then z = z + 1 end
  9.   if z == 4 then
  10.     turtle.select(16)
  11.     turtle.dig()
  12.     turtle.drop()
  13.     turtle.select(1)
  14.   end
  15. end
  16.  
  17. local x = 0
  18. for i = 1, 8 do
  19.   x = x + 1
  20.   if x == 4 or x == 8 or x == 6 then x = x + 1 end
  21.   turtle.select(1) -- Instead of turtle.drop() and turtle.suck() we use turtle.place() and turtle.dig()
  22.   turtle.place()
  23.   turtle.select(x)
  24.   turtle.dig()
  25. end
  26.  
  27. turtle.select(1)
  28.  
  29. if not turtle.craft() then
  30.   print("Failed crafting!")
  31. else
  32.   print("Successful crafting!")
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement