Guest User

Untitled

a guest
May 24th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. function move:ScanDest(container)
  2.     results = {}
  3.     for i,bagid in ipairs(container) do
  4.         local bagtype = GetItemFamily(GetBagName(bagid))
  5.         if not bagtype then
  6.             bagtype = 0
  7.         end --to take care of the nil case
  8.         for slotid=1, getContainerNumSlotsDest(bagid) do
  9.             local id = getContainerItemIDDest(bagid,slotid)
  10.             if not id then
  11.                 if not results[bagtype] then results[bagtype] = {} end
  12.                 table.insert(results[bagtype],{bag = bagid, slot = slotid})
  13.             end--end if not id
  14.         end
  15.     end
  16.     return results
  17. end
Add Comment
Please, Sign In to add comment