Advertisement
Jkerr

Minecraft Turtle Program - Simple crafty turtle 3x3 craft

Dec 21st, 2024 (edited)
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | Gaming | 0 0
  1. -- Crafty turtle to grab raw materials, craft a 3x3 recipe and output the result
  2.  
  3. -- Place a drawer above with raw materials
  4. -- Place craft turtle below that
  5. -- place a drawer below for output
  6.  
  7. -- Can also use chests if that's the only thing in them
  8. term.clear()
  9. print("Starting...")
  10.  
  11. function getMaterialsFromAbove()
  12.    turtle.suckUp(9)
  13.    turtle.transferTo(2,1)
  14.    turtle.transferTo(3,1)
  15.    turtle.transferTo(5,1)
  16.    turtle.transferTo(6,1)
  17.    turtle.transferTo(7,1)
  18.    turtle.transferTo(9,1)
  19.    turtle.transferTo(10,1)
  20.    turtle.transferTo(11,1)
  21. end
  22.  
  23. sourceDrawer = peripheral.wrap("top")
  24.  
  25. while true do
  26.   rawCount = 0
  27.   if sourceDrawer.getItemDetail(1) then
  28.     rawCount = sourceDrawer.getItemDetail(1).count
  29.   end
  30.  
  31.   if rawCount > 8 then
  32.     term.clear()
  33.     getMaterialsFromAbove()
  34.     turtle.craft()
  35.     turtle.dropDown()
  36.   else
  37.     print("count: "..rawCount.." - sleeping for 10 seconds...")
  38.     os.sleep(10)
  39.   end -- if
  40. end -- End of while true loop.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement