MineMcMine

ThermionicCrafter

Apr 1st, 2022 (edited)
914
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. --[[
  2.     Using: CC: Tweaked, Plethora
  3.     pastebin run xHQv4Jf4
  4.     pastebin get xHQv4Jf4 startup
  5. ]]--
  6.  
  7. inputChest = peripheral.wrap("minecraft:ender chest_0")
  8.  
  9. fabricatorsMap = {}
  10. fabricatorsMap ["forestry:fabricator_0"] = { material = "Tin Ingot" }
  11.  
  12. fabricatorPerip = {}
  13. for key, perip in pairs(fabricatorsMap) do
  14.     perip.perip = peripheral.wrap(key)
  15. end
  16.  
  17. function sendAll(items, fabricator)
  18.     for i, _ in pairs(items) do
  19.         inputChest.pushItems(fabricator, i)
  20.     end
  21. end
  22.  
  23. while (true) do
  24.     local items = inputChest.list()
  25.  
  26.     for i, item in pairs(items) do
  27.         local meta = inputChest.getItem(i).getMetadata()
  28.         for key, fabMap in pairs(fabricatorsMap) do
  29.             if(string.find(meta.displayName, fabMap.material)) then
  30.                 sendAll(items, key)
  31.             end
  32.         end
  33.     end
  34. end
  35.  
  36.  
Add Comment
Please, Sign In to add comment