mercwear

Inventory Manager

Feb 11th, 2019
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. local component = require("component")
  2. local sides = require("sides")
  3. local rsi = component.block_refinedstorage_interface
  4. local term = require("term")
  5. local allItems = rsi.getItems()
  6. local instorage = 0
  7. local extract_count = 10
  8.  
  9. --Table with key value paris for items to monitor and delete
  10. monitored_items = {["Soul Sand"] = 72000, ["Rotten Flesh"] = 500, ["Solidified Experience"] = 300000, ["Glass Bottle"] = 5000, ["Wither Dust"] = 64, Arrow = 64, Stick = 2500, Andesite = 50000, Sand = 175000, Dirt = 50000, Bone = 100000, Gravel = 50000, Cactus = 25000, Bow = 1, Cobblestone = 100000, Dirt = 100000, Granite = 80000}
  11. while true do
  12. allItems = rsi.getItems()
  13. for mon_item, count in pairs (monitored_items) do
  14. for i, item in ipairs(allItems) do
  15. if(item.label == mon_item) then
  16. --print(item.size)
  17. --Determine how much is in storage
  18. instorage = item.size
  19. while instorage > count do
  20. rsi.extractItem(allItems[i],extract_count, sides.back)
  21. instorage = instorage - extract_count
  22. term.clear()
  23. print(mon_item)
  24. print(instorage)
  25. end
  26. end
  27. end
  28. end
  29. instorage = 0
  30. term.clear()
  31. print("Sleeping - Press CTRL + ALT + C To Close")
  32. os.sleep(10)
  33. end
Advertisement
Add Comment
Please, Sign In to add comment