Find the games function call for pick up item.
Find the array of items.
Loop for items near enough to you? that match your filter eg rare, money etc.
Call the function from the game thread *just detour the games window loop to goto your dll and do your own code*
For each item you want to pick up.