Help expanding an Addon
I went looking for an addon that could detect when someone was spam-clicking group food items. I found one but it was outdated. I edited it to work with Banquet of the Wok, tested it and it works. Now I'd like to expand it to monitor all the new MoP banquets in a single addon. Here's what I'm working with so far.
Code:
local Food_Hog_Wok = CreateFrame("Frame", "Food_Hog", UIParent) |
I'd do something like this:
Code:
local alert = "%s is hogging the %s! (%d)" Currently it doesn't track different banquets separately, so if someone clicks multiple banquets repeatedly, it will warn about them, but this seems fine. |
Wow, thanks!
This looks a lot simpler than the original. |
Should
Lua Code:
be Lua Code:
? |
No. You'll always have a valid unit token from the UNIT_AURA event, so you'll always get a name from UnitName. You just need to check if the server name from UnitName is both (a) non-nil and (b) not an empty string, so you can append it to the name for cross-realm players.
|
Oh I see, I hadn't though about the difference between nil, and an empty string. Thank you very much for the explanation.
|
All times are GMT -6. The time now is 04:21 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI