Announce to Raid Chat issue
I've been using the mouseover macro below to both whisper the target I cast my battle rez on and announce it to the raid but since 5.1 changed GetRealNumRaidMembers the raid chat announce doesn't work anymore. Does anyone have insight into what I'd need to change to make it work again? I'd also like it to stop the whisper to the target if the spell doesn't fire but I haven't been able to figure that part out. Lastly, I never PvP so the Battleground part can be removed if it's unneeded but I don't know if that's the case. Thanks.
Code:
#showtooltip Raise Ally |
Changing the last line to this should work:
Code:
/run SendChatMessage("Aethran cast Raise Ally on "..UnitName("mouseover")..".", UnitInBattleground("player") and "BATTLEGROUND" or IsInRaid() and "RAID" or IsInGroup() and "PARTY" or "SAY") Edit: Changed to IsInRaid and IsInGroup instead of checking player count. |
Change the last line to:
Code:
/run SendChatMessage("Aethran cast Raise Ally on "..UnitName("mouseover")..".", IsInGroup(LE_PARTY_CATEGORY_INSTANCE) and "INSTANCE_CHAT" or IsInRaid() and "RAID" or IsInGroup() and "PARTY" or "SAY") |
Ah, didn't realize IsInGroup took a parameter. I should start checking wowpedia and not just wowprogramming :P
|
Wowprogramming's documentation tends to be more consistent, but the problem is that it's only updated by a very small group of people (I don't actually know, but I'd guess 1-5 people) while anyone can add info to Wowpedia, so while the documentation can be inconsistent (eg. random functions not documented, writing quality varies wildly, some stuff is really outdated, etc.) it's also more thorough, with lots of notes and examples on usage, bugs, etc.
When in doubt, check the default UI code to verify current API usage. Blizzard is generally pretty bad at writing efficient code, but one thing they are good at is using descriptive variable names. |
Awesome, thanks guys!
|
Quote:
|
Quote:
Edit: This is what I get for replying before reading later posts. Meh. |
Anyone have insight into what change would be needed to stop the whisper if the spell doesn't activate?
|
Quote:
|
Is there a way to do it in the macro instead? It does not need to be limited to the 250 or whatever characters.
|
I don't think there's an easy way to incorporate such "advanced" behaviour into the macro alone.
I think you'd be better off making a small addon for it instead, there are events for when a spell succeeds casting. UNIT_SPELLCAST_SUCCEEDED Fires when a unit's spellcast succeeds, it doesn't seem to provide info on what the spell was cast at, though. |
Quote:
If you have some "unlimited macro" addon, you could technically write all of this in a "macro" but then you would just end up with a macro that you would have to run once (and only once) when you logged in to set up the frame and its event handler, so why not just put the same code in an actual addon that you don't have to manually activate? |
Makes sense, I was just hopping for something easy such as a stopmacro command. I don't pretend to know anything about coding though. Thanks all.
|
A /stopmacro-like command would not work for this, because assuming the first line in your macro casts a spell, that spell is still "being cast" while all other lines in the macro are being processed. For example, if you have this macro:
Code:
/cast Albino Drake |
All times are GMT -6. The time now is 09:09 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI