CheeseLordP

Thaumcraft Automated Infusion Computercraft Code

Jul 21st, 2015
507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.21 KB | None | 0 0
  1. --Thaumcraft automatic infuser.
  2. -- This is a computercraft code to automate thaumcraft infusion crafting in Minecraft
  3.  
  4.  
  5. --Wrap the item input
  6.  
  7. p=peripheral.wrap("left")
  8.  
  9.  
  10. --wrap the 24 pedestals that will represent all possible item placement arrangement
  11. --The order goes: LeftMiddle 1, CentreMiddle 1, RightMiddle 1, left Diagonal 1/2, Centre Diagonal 1/2, Right Diagonal 1/2,
  12. --LeftMiddle 2, ...
  13.  
  14. LM1 = peripheral.wrap("container_pedestal_1")
  15. CM1 = peripheral.wrap("container_pedestal_2")
  16. RM1 = peripheral.wrap("container_pedestal_3")
  17. LD12 = peripheral.wrap("container_pedestal_4")
  18. CD12 = peripheral.wrap("container_pedestal_5")
  19. RD12 = peripheral.wrap("container_pedestal_6")
  20. LM2 = peripheral.wrap("container_pedestal_7")
  21. CM2 = peripheral.wrap("container_pedestal_8")
  22. RM2 = peripheral.wrap("container_pedestal_9")
  23. LD23 = peripheral.wrap("container_pedestal_10")
  24. CD23 = peripheral.wrap("container_pedestal_11")
  25. RD23 = peripheral.wrap("container_pedestal_12")
  26. LM3 = peripheral.wrap("container_pedestal_13")
  27. CM3 = peripheral.wrap("container_pedestal_14")
  28. RM3 = peripheral.wrap("container_pedestal_15")
  29. LD34 = peripheral.wrap("container_pedestal_16")
  30. CD34 = peripheral.wrap("container_pedestal_17")
  31. RD34 = peripheral.wrap("container_pedestal_18")
  32. LM4 = peripheral.wrap("container_pedestal_19")
  33. CM4 = peripheral.wrap("container_pedestal_20")
  34. RM4 = peripheral.wrap("container_pedestal_21")
  35. LD41 = peripheral.wrap("container_pedestal_22")
  36. CD41 = peripheral.wrap("container_pedestal_23")
  37. RD41 = peripheral.wrap("container_pedestal_0")
  38.  
  39.  
  40. --loop checks every 15 secs if items are in input(with redstone signal from comparator)
  41.  
  42. x=true
  43. while x == true do
  44.     if rs.getInput("front")==true then
  45.  
  46.         --loop then checks what item is in slot 1 of the chest, and that item will tell the computer what's crafting
  47.  
  48.         slot = p.getStackInSlot(1)
  49.         if slot.display_name=="Boots of the Traveller" and slot.id == "minecraft:iron_sword" then
  50.             print("Boots of the Traveller")
  51.  
  52.             p.pushItemIntoSlot("west",3,1,3)
  53.             p.pushItemIntoSlot("west",3,1,23)
  54.             p.pushItemIntoSlot("west",4,1,7)
  55.             p.pushItemIntoSlot("west",4,1,11)
  56.             p.pushItemIntoSlot("west",5,1,19)          
  57.             p.pushItemIntoSlot("west",6,1,15)
  58.  
  59.             p.pushItemIntoSlot("south",1,1,1)
  60.             p.pushItemIntoSlot("down",2,1,1)
  61.  
  62.             -- iron sword called : Boots of the Traveller * 1
  63.             -- leather boots * 1
  64.             -- enchanted fabric * 2
  65.             -- air shard * 2
  66.             -- feather * 1
  67.             -- raw fish * 1
  68.         elseif slot.display_name=="Sword of the Zephyr" and slot.id == "minecraft:iron_sword" then
  69.             print("Sword of the Zephyr")
  70.  
  71.             p.pushItemIntoSlot("west",3,1,5)
  72.             p.pushItemIntoSlot("west",3,1,11)
  73.             p.pushItemIntoSlot("west",4,1,17)
  74.             p.pushItemIntoSlot("west",5,1,23)
  75.  
  76.             p.pushItemIntoSlot("south",1,1,1)
  77.             p.pushItemIntoSlot("down",2,1,1)
  78.  
  79.             -- iron sword called : Sword of the Zephyr * 1
  80.             -- thaumium sword * 1
  81.             -- air shard * 2
  82.             -- greatwood log * 1
  83.             -- diamond * 1
  84.  
  85.         elseif slot.display_name=="Axe of the Stream" and slot.id == "minecraft:iron_sword" then
  86.             print("Sword of the Zephyr")
  87.  
  88.             p.pushItemIntoSlot("west",3,1,5)
  89.             p.pushItemIntoSlot("west",3,1,11)
  90.             p.pushItemIntoSlot("west",4,1,17)
  91.             p.pushItemIntoSlot("west",5,1,23)
  92.  
  93.             p.pushItemIntoSlot("south",1,1,1)
  94.             p.pushItemIntoSlot("down",2,1,1)
  95.  
  96.             -- iron sword called : Axe of the Stream * 1
  97.             -- thaumium axe * 1
  98.             -- water shard * 2
  99.             -- greatwood log * 1
  100.             -- diamond * 1
  101.  
  102.         elseif slot.display_name=="Pickaxe of the Core" and slot.id == "minecraft:iron_sword" then
  103.             print("Sword of the Zephyr")
  104.  
  105.             p.pushItemIntoSlot("west",3,1,5)
  106.             p.pushItemIntoSlot("west",3,1,11)
  107.             p.pushItemIntoSlot("west",4,1,17)
  108.             p.pushItemIntoSlot("west",5,1,23)
  109.  
  110.             p.pushItemIntoSlot("south",1,1,1)
  111.             p.pushItemIntoSlot("down",2,1,1)
  112.  
  113.             -- iron sword called : Pickaxe of the Core * 1
  114.             -- thaumium pickaxe * 1
  115.             -- fire shard * 2
  116.             -- greatwood log * 1
  117.             -- diamond * 1
  118.  
  119.         elseif slot.display_name=="Hoe of Growth" and slot.id == "minecraft:iron_sword" then
  120.             print("Sword of the Zephyr")
  121.  
  122.             p.pushItemIntoSlot("west",3,1,5)
  123.             p.pushItemIntoSlot("west",4,1,11)
  124.             p.pushItemIntoSlot("west",5,1,17)
  125.             p.pushItemIntoSlot("west",6,1,23)
  126.  
  127.             p.pushItemIntoSlot("south",1,1,1)
  128.             p.pushItemIntoSlot("down",2,1,1)
  129.         elseif slot.display_name=="Shovel of the Earthmover" and slot.id == "minecraft:iron_sword" then
  130.             print("Sword of the Zephyr")
  131.  
  132.             p.pushItemIntoSlot("west",3,1,5)
  133.             p.pushItemIntoSlot("west",3,1,11)
  134.             p.pushItemIntoSlot("west",4,1,17)
  135.             p.pushItemIntoSlot("west",5,1,23)
  136.  
  137.             p.pushItemIntoSlot("south",1,1,1)
  138.             p.pushItemIntoSlot("down",2,1,1)
  139.         elseif slot.display_name=="Ichor" and slot.id == "minecraft:iron_sword" then
  140.             print("Ichor")
  141.  
  142.             p.pushItemIntoSlot("west",3,1,5)
  143.             p.pushItemIntoSlot("west",4,1,11)
  144.             p.pushItemIntoSlot("west",5,1,17)
  145.             p.pushItemIntoSlot("west",6,1,23)
  146.  
  147.             p.pushItemIntoSlot("south",1,1,1)
  148.             p.pushItemIntoSlot("down",2,1,1)
  149.         elseif slot.display_name=="Lamp of Growth" and slot.id == "minecraft:iron_sword" then
  150.             print("Lamp of Growth")
  151.  
  152.             p.pushItemIntoSlot("west",3,1,3)
  153.             p.pushItemIntoSlot("west",4,1,7)
  154.             p.pushItemIntoSlot("west",5,1,11)
  155.             p.pushItemIntoSlot("west",3,1,15)
  156.             p.pushItemIntoSlot("west",4,1,19)
  157.             p.pushItemIntoSlot("west",5,1,23)
  158.  
  159.             p.pushItemIntoSlot("south",1,1,1)
  160.             p.pushItemIntoSlot("down",2,1,1)
  161.  
  162.  
  163.  
  164.  
  165.         else
  166.             print("ERROR. Unknown recipe.")
  167.         end
  168.     end
  169.  
  170.  
  171.  
  172.     LM1.pullItemIntoSlot("south",1)
  173.     CM1.pullItemIntoSlot("south",2)
  174.     RM1.pullItemIntoSlot("south",3)
  175.     LD12.pullItemIntoSlot("south",4)
  176.     CD12.pullItemIntoSlot("south",5)
  177.     RD12.pullItemIntoSlot("east",6)
  178.     LM2.pullItemIntoSlot("east",7)
  179.     CM2.pullItemIntoSlot("east",8)
  180.     RM2.pullItemIntoSlot("east",9)
  181.     LD23.pullItemIntoSlot("east",10)
  182.     CD23.pullItemIntoSlot("east",11)
  183.     RD23.pullItemIntoSlot("north",12)
  184.     LM3.pullItemIntoSlot("north",13)
  185.     CM3.pullItemIntoSlot("north",14)
  186.     RM3.pullItemIntoSlot("north",15)
  187.     LD34.pullItemIntoSlot("north",16)
  188.     CD34.pullItemIntoSlot("north",17)
  189.     RD34.pullItemIntoSlot("west",18)
  190.     LM4.pullItemIntoSlot("west",19)
  191.     CM4.pullItemIntoSlot("west",20)
  192.     RM4.pullItemIntoSlot("west",21)
  193.     LD41.pullItemIntoSlot("west",22)
  194.     CD41.pullItemIntoSlot("west",23)
  195.     RD41.pullItemIntoSlot("south",24)
  196.  
  197.     sleep(15)
  198. end
  199.  
  200. --Implementation of code:
  201.  
  202. --1. place advanced computer facing west.
  203.  
  204. --2. place another enderchest with different frequency (f2) in front of the first enderchest ( on the west side.)
  205.  
  206. --3. place a third enderchest with a third frequency beneath the first enderchest
  207.  
  208. --4.1 if you are automating with applied energistics, then place an ME interface on the left(south) side of the first enderchest.
  209. --4.1 Any recipes for the infusion items should go in this interface
  210. --4.2 If you are not automating with AE, then all you have to do is place another chest here. This chest will is the one the
  211. --4.2 computer will eject the iron swords into.
  212.  
  213. --5. Now construct your infusion alter if it isn't already (24 pedestals) and add amgical paraphinaelia to stabilise the rituals.
  214.  
  215. --6. Now connect networking cables too the computer and then run them to the pedestals.
  216.  
  217. --7. Connect them to the pedestals with peripheral proxys, starting with the first one being the LeftMiddle on the south side, and then going clockwise.
  218.  
  219. --8. Now place transvector interfaces next to each interface. They should be on the face of the pedestal opposite to the alter.
  220.  
  221. --9. Next, link up the transvectors with enderchests that have the same frequency as the 1st enderchest.
  222. --9. (Multiple transvectors can be connected to the same enderchest)
  223.  
  224. --10. Next, place an enderchest with the 2nd frequency close to the centre pedestal and connect some method of item
  225. --10. transportation from it to the pedestal
  226.  
  227. --NOTES:
  228. -- * When adding items to the input chest, add the items in the order mentioned in the code.
  229. -- * Add this code to run in the startup of the computer with edit startup and shell.run(program_name).
  230.  
  231. -- *** If you want the infusion to automatically start, get the rewuired researches for yourself, bind a tome of knowledge sharing to yourself, put that in an autonymous activator, to give it the research, and then give it a wand so it faces the runic matrix and right clicks on it with the wand to start it.
Advertisement
Add Comment
Please, Sign In to add comment