Advertisement
ladyDia

Mekanism Sorting

May 18th, 2025 (edited)
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. --Find all of the bins on the network
  2. --Find if anything is being stored in the bins
  3. --Get list of what is stored in the bins
  4.  
  5. local storageBins = {peripheral.find("mekanism:bin")}
  6. local emptyBins = {}
  7. local claimedBins = {}
  8. local itemList = {}
  9. local itemName = ""
  10.  
  11. local binTiers = {
  12.     BASIC = 4096
  13. }
  14.  
  15. for i=1, #storageBins do
  16.     itemName = storageBins[i].getItemMeta(1).rawName..storageBins[i].getItemMeta(1).name
  17.     if storageBins[i].list() ~= {} then
  18.         if itemList[itemName] == nil then
  19.             itemList[itemName] = {peripheral.getName(storageBins[i])}
  20.         else
  21.             itemList[itemName][#(itemList[itemName])+1] = peripheral.getName(storageBins[i])
  22.         end
  23.         claimedBins[#claimedBins+1] = storageBins[i]
  24.     else
  25.         emptyBins[#emptyBins+1] = storageBins[i]
  26.     end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement