Posted by kreolx on Mon, 05 Mar 2012 01:59:53
Hi! I'm write next script: x=GetInboxNumItems(); for i=1,x,1 do AutoLootMailItem(i); end; The script works, but it collects only the first letter attachment. Where am I wrong?
Posted by jnwhiteh on Mon, 05 Mar 2012 07:52:25
I think it might require a hardware event, I'm not sure.
Posted by chemical66 on Sat, 17 Mar 2012 10:54:35
I'm just guessing (I don't have the time to try it out now) ..
but I suppose you can't just rattle through your loop in at once, because that loop will only need a fraction of a second, and in that time you can't loot your complete mailbox.
My strategy would be (UNTESTED !!!):
- Get amount of items with GetInboxNumItems()
- Start opening first mail
- Wait for event, this could be
"UNIT_INVENTORY_CHANGED"(check the problems there when stacking items ...)
- Open next mail, and don't forget mails are deleted when they contain no text, so that your next index will be the same as before
- Continue at 3