Advertisement
BigGamingGamers

Untitled

Nov 14th, 2020 (edited)
4,948
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. local SLOT_COUNT = 16
  2.  
  3. KEEP_ITEMS = {
  4. "minecraft:diamond",
  5. "minecraft:iron_ore",
  6. "minecraft:gold_ore",
  7. "thermalfoundation:ore",
  8. "ic2:resource"
  9. }
  10.  
  11. function dropItemsFromList()
  12. print("Purging Inventory...")
  13.  
  14. for slot = 1, SLOT_COUNT, 1 do
  15. local item = turtle.getItemDetail(slot)
  16. local keepItem = false
  17. if(item ~= nil) then
  18. for keepItemIndex = 1, #KEEP_ITEMS, 1 do
  19. if(item["name"] == KEEP_ITEMS[keepItemIndex]) then
  20. keepItem = true
  21. end
  22.  
  23. print(item["name"])
  24. print(KEEP_ITEMS[keepItemIndex])
  25. print(item["name"] == KEEP_ITEMS[keepItemIndex])
  26.  
  27. if(not keepItem) then
  28. turtle.select(slot)
  29. turtle.dropDown()
  30. end
  31. end
  32. end
  33. end
  34. end
  35.  
  36. dropItemsFromList()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement