Advertisement
RabaGhast

Test

Oct 25th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. print("v0.3")
  2. items = {}
  3. qty = {}
  4. names = {"gold", "iron"}
  5. chest = peripheral.wrap("left")
  6.  
  7.  
  8.  
  9. for i = 1,chest.getInventorySize() do
  10.   item =  chest.getStackInSlot(i)
  11.   if item ~= nil then
  12.     print(item["name"])
  13.     for j = 1,#names do
  14.       if string.match(item["name"], names[j]) then
  15.         items[#items+1] = item["name"]
  16.         qty[#qty+1] = item["qty"]
  17.         break
  18.       end
  19.     end
  20.   end
  21. end
  22.  
  23. for i=1,#items do
  24.   print(qty[i].." "..items[i])
  25. end
  26.  
  27.  
  28. ---------------------------------------------------------------------------------------
  29.  
  30.  
  31. function tellNames()
  32.   for i = 1,chest.getInventorySize() do
  33.     item =  chest.getStackInSlot(i)
  34.     print(item["name"]..", "..item["display_name"]..", "..item["raw_name"]..", "..item["mod_id"])
  35.   end
  36. end
  37.  
  38.  
  39. --[[
  40.  
  41. pastebin get 5yu5bhR3
  42.  
  43. for i,v in pairs(someItem) do
  44.   print(i..", "..v)            prints eg. "display_name, Crafting Table", "qty, 2", "max_size, 64"
  45. end
  46. ]]--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement