I'm looking for good loot calculator

I tried to make one but works only if container is full :P cause of getcontainer(0).items[ex. 19].count dont count empty slot as empty, it shows item value from bp before