Advertisement
JereTheJuggler

inventoryRemover.lua

Nov 19th, 2021
1,010
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. local inv = peripheral.wrap("left")
  2.  
  3. function shouldTrash(item)
  4.     if item.name == "occultism:datura_seeds" then return true end
  5.     if item.tags ~= nil then
  6.         for _,tag in ipairs(item.tags) do
  7.             if tag == "forge:cobblestone" then return true end
  8.         end
  9.     end
  10. end
  11.  
  12. function shouldStore(item)
  13.     if item.tags ~= nil then
  14.         for _,tag in ipairs(item.tags) do
  15.             if tag == "create:crushed_ores" then return true end
  16.         end
  17.     end
  18. end
  19.  
  20. while true do
  21.     for slot,item in pairs(inv.getItems()) do
  22.         if shouldTrash(item) then
  23.             inv.removeItemFromPlayer("DOWN",item.count,slot,item.name)
  24.         elseif shouldStore(item) then
  25.             inv.removeItemFromPlayer("LEFT",item.count,slot,item.name)
  26.         end
  27.     end
  28.     sleep(3)
  29. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement