Advertisement
PancakePhD

Circuit Crafter

Feb 4th, 2023 (edited)
800
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. chestFull = false
  2.  
  3. function fillSlots(start, finish)
  4.     for i=start,finish do
  5.         turtle.select(i)
  6.         while turtle.getItemCount() < 64 do
  7.             turtle.suck(64-turtle.getItemCount())
  8.         end
  9.     end
  10. end
  11.  
  12. function emptyInventory()
  13.     for i=1,16 do
  14.         turtle.select(i)
  15.         item = turtle.getItemDetail()
  16.         if item and item.name == "ic2:itemmisc" and item.damage == 451 then
  17.             dropped, message = turtle.dropDown()
  18.  
  19.             if not dropped then
  20.                 chestFull = true
  21.                 return
  22.             else
  23.                 chestFull = false
  24.             end
  25.         end
  26.     end
  27. end
  28.  
  29. function craftCircuit()
  30.     turtle.turnLeft()
  31.     fillSlots(1, 3)
  32.     fillSlots(9, 11)
  33.    
  34.     turtle.turnRight()
  35.    
  36.     fillSlots(6,6)
  37.    
  38.     turtle.turnRight()
  39.  
  40.     fillSlots(5, 5)
  41.     fillSlots(7, 7)
  42.    
  43.     turtle.turnLeft()
  44.  
  45.     turtle.craft()
  46. end
  47.  
  48. while true do
  49.     while redstone.getInput("back") and not chestFull do
  50.         emptyInventory()
  51.         if not chestFull then
  52.             craftCircuit()
  53.         end
  54.     end
  55.     sleep(1)
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement