Detect mail from ah
Hello,
first my code: Lua Code:
I'm trying to Detect if the mail is from a succesfull auction, it never return the AH or MAIL, i'm still new to lua stuff, been looking at http://wowprogramming.com/docs/api/GetInboxInvoiceInfo http://wowprogramming.com/docs/api/GetInboxNumItems |
I don't know what the invoiceType string exactly looks like, but I guess it is something like "Sold item: Seller ..."?
In that case you'll have to search for the pattern "seller" inside the string. Comparing the full string does not work as "seller" is not equal to "Sold item: Seller ....". Lua Code:
If you are unsure if it is "seller" or "Seller" or "SELLER" or whatever, then it could be helpful to convert invoiceType before comparing them: Lua Code:
And last but not least you should declare auditorMode as local and return it with you function: Lua Code:
If you do not use auditorMode somewhere else then this would be a better way to do it: Lua Code:
Personally I would return a boolean instead of a string as this is a bit easyer to handle. Like Lua Code:
Lua Code:
Lua Code:
[e] And if you're not using multiple files with you addon, then you should probably declare you function as local: Lua Code:
|
Very nice thanks for the help, gonna play a bit whit it :)
|
Still don't fire when i get money from the ah in the mail.
|
do'h ... just had overwritten my on old post :D
|
Tested the last code you added, its never print any thing.
|
Hm. Wowprogramming says
Quote:
Totally guessing: the first one is the number of mails the player had opened at least once, and the second one is the number of opened and unopened mails? You could try: Lua Code:
Does this change anything? |
Still return nill, there are like no info on google about that :(
|
I'll look into it later on. Don't have any access to a wow client right now.
|
Sure no problems :)
|
Looks as GetInboxNumItems() returns the number of mails in your inbox that were in it when you opened it the last time.
I would say you can't query GetInboxNumItems() (or at least don't get up-to-date results) without an open inbox. What does happen if you open your mailbox and then use the function? |
When i open the mailbox i get:
Message: Interface\AddOns\Accountant_Classic\Accountant.lua:459: attempt to call global 'Accountant_DetectAhMail' (a nil value) Time: 09/23/14 17:51:09 Count: 1 Stack: Interface\AddOns\Accountant_Classic\Accountant.lua:459: in function `Accountant_OnEvent' [string "*:OnEvent"]:1: in function <[string "*:OnEvent"]:1> [C]: in function `TurnOrActionStop' [string "TURNORACTION"]:4: in function <[string "TURNORACTION"]:1> Locals: self = AccountantFrame { 0 = <userdata> numTabs = 5 selectedTab = AccountantFrameTab1 { } } event = "MAIL_SHOW" arg1 = nil arg2 = nil oldmode = "" (*temporary) = nil (*temporary) = "attempt to call global 'Accountant_DetectAhMail' (a nil value)" link to the code https://github.com/Tntdruid/Accounta...Accountant.lua |
Remove the local keyword from
Lua Code:
Use MAIL_INBOX_UPDATE instead: Lua Code:
Lua Code:
|
it's still trigger the OTHER event and not the AH.
Can see seller is corect for mail from ah whit gold. |
Did you remove
Lua Code:
? :) |
yes its gone
|
Well, then let's talk about what you're trying to accomplish. :)
Are you looking for something like this? Lua Code:
Lua Code:
|
I want the AH when i sell stuff on ah, MAIL for normal mails.
|
Quote:
|
Quote:
|
All times are GMT -6. The time now is 09:14 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI