Advertisement
PancakePhD

Wire Crafter

Feb 4th, 2023 (edited)
1,043
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:itemcable" 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.     fillSlots(1, 3)
  31.     fillSlots(9, 11)
  32.    
  33.     turtle.turnLeft()
  34.  
  35.     fillSlots(5, 7)
  36.    
  37.     turtle.turnRight()
  38.  
  39.     turtle.craft()
  40. end
  41.  
  42. while true do
  43.     while redstone.getInput("back") and not chestFull do
  44.         emptyInventory()
  45.         if not chestFull then
  46.             craftCircuit()
  47.         end
  48.     end
  49.     sleep(1)
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement