Thread Tools Display Modes
09-16-06, 12:02 PM   #1
doumakes
A Defias Bandit
Join Date: Aug 2006
Posts: 3
Deleting mailbox items

I'm working on a mod to take money from certain Inbox items, then delete the items. I'm running up against a problem that I imagine has been solved several times before.

The job is to step through the Inbox items, recognize certain special ones, take the money and then delete the item, all without the user doing more than opening the mailbox. My code will succeed at doing that for one or two mails, and then stop.

When I take the inbox money I call TakeInboxMoney() and then wait for the PLAYER_MONEY event. Then I call DeleteInboxItem() on the same mail, and wait for MAIL_INBOX_UPDATE, and check to see whether the item count has changed. Sometimes the money never gets taken, sometimes the item never gets deleted. I'm convinced the code is doing what I intend it to be doing; the problem seems to be the events never fire.

Am I taking the wrong approach here? Should I be watching some other event(s)?
  Reply With Quote
09-22-06, 01:37 PM   #2
Daklu
A Defias Bandit
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 2
You mentioned that "the problem seems to be the events never fire." Are you sure they don't fire? There is a debugging mod out there that lets you register events and will alert you via the chat box when they fire. I don't remember exactly which one does it, but take a look at DebugTools.

Sorry I can't give you any info on the events you're using or how appropriate they are.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Deleting mailbox items


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off