Advertisement
Findz

Untitled

May 27th, 2023 (edited)
1,135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.81 KB | None | 0 0
  1. local items = {'minecraft:gold_ingot', 'minecraft:gold_nugget','minecraft:diamond_axe','minecraft:diamond_sword','minecraft:diamond_boots','minecraft:diamond_shovel','minecraft:diamond_helmet','minecraft:diamond_pickaxe','minecraft:diamond_leggings','minecraft:diamond_chestplate'}
  2.  
  3. local chest = peripheral.wrap('top')
  4. local chestDown = peripheral.wrap("bottom")
  5.  
  6. local function contains(table, val)
  7.    for i=1,#table do
  8.       if table[i] == val then
  9.          return true
  10.       end
  11.    end
  12.    return false
  13. end
  14.  
  15.  
  16. while true do
  17.     for slot, item in pairs(chest.list()) do
  18.  
  19.         if contains(items, item.name) == false then
  20.             print(item.name .. ' - NOT VALID')
  21.             chestDown.pullItems(peripheral.getName(chest),slot)
  22.         else
  23.             print(item.name .. ' - VALID')
  24.         end
  25.     end
  26.     sleep(1)
  27.  
  28. end
  29.  
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement