Advertisement
SenpaiJody

Ingot Sorter

Oct 15th, 2022 (edited)
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.15 KB | None | 0 0
  1. local ironChestName = "ironchest:crystal_chest_6"
  2. local copperChestName = "ironchest:crystal_chest_7"
  3. local goldChestName = "ironchest:crystal_chest_3"
  4. local osmiumChestName = "ironchest:crystal_chest_4"
  5. local tinChestName = "ironchest:crystal_chest_8"
  6. local leadChestName = "ironchest:crystal_chest_5"
  7. local uraniumChestName = "ironchest:crystal_chest_9"
  8.  
  9. local chestName = "quark:variant_chest_5"
  10.  
  11. local inputChest = peripheral.wrap(chestName)
  12.  
  13. local chests = {
  14.      iron_ingot = ironChestName,
  15.      gold_ingot = goldChestName,
  16.      copper_ingot = copperChestName,
  17.      ingot_osmium = osmiumChestName,
  18.      ingot_tin = tinChestName,
  19.      ingot_uranium = uraniumChestName,
  20.      ingot_lead = leadChestName
  21.     }
  22.  
  23. while true do
  24.     if inputChest.getItemDetail(1) ~= nil then
  25.         for i = 1, inputChest.size(), 1 do
  26.             local detail = inputChest.getItemDetail(i)
  27.             if detail == nil then break end
  28.             local name = detail.name:gsub(".*:","")
  29.             if chests[name] ~= nil then
  30.                 inputChest.pushItems(chests[name], i, 64)
  31.                 end
  32.             end
  33.         end
  34.     os.sleep(0.05)
  35.     end
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement