You also probly need to account for the timing of instanced corpses, which this does not do. You'd have to loot it once at the beginning, and then again after a couple minutes when the other corpses become un-instanced. (Is that a word?) Or if you're finding corpses nonstop, instead of looting it twice, find the corpse, set it to an instanced timer, then loot it just once when it combines the instances. But if you're competing with others, probly better to just loot it twice. So you get your items at least. That %contWait timer probly needs some tweaking also. It looks like it would work correctly, but I'm not sure. It seems to wait as long as it takes for a corpse to open, plus 100ms. But is that too long? After opening a corpse with event macro 17, you have to wait at least 1000ms on OSI to perform another action. That's something to consider. That's why I made the timer 1100. But what if the container opens in 500 ms, you'd have a spare 500 ms you'd have to wait before performing an action, so you'd have to account for that somewhere.
set %corpseContSize ; Set this to whatever size the container is for a corpse on your shard
set %corpseLooted n/a
finditem %corpses G_2
if #findcnt > 0
{
set #lobjectid #findid
set %contid #contid
event macro 17
set %contWait #sysTime + 1100
while #contsize <> %corpseContSize || #contid = %contid
{
if #contid <> %contid
{
wait 5
break
}
}
if %contWait < #sysTime
{
set %corpseLooted #false
return ; Return on container error
}
set %corpseContId #contid
finditem %itemTypes c_ , %corpseContId
{
if #findcnt > 0
{
; Find and loot whatever you want here
set %corpseLooted #true
}
}
if %corpseLooted = #true
ignoreitem %contid
}