Have you tried TM's looter? It uses bag of sending, it also has an option to loot from the ground.
I tried writing my own simple looter just to loot the ground and ran into lots of issues, so I wouldn't share that with anyone. There is lots to take into account when trying to grab something and moving the character. There is also issues over instanced corpses that I have not seen any script fix, because most of the time you will loot within the few minutes until the corpse is released to be lootable by anyone.