Topic [RESOLVED] Challenging Roar Chat Message Problem
Navitas
Aszune
Navitas
85 Tauren Druid
7410
Edited by Navitas on 27/06/12 15:38 (BST)
I've got an addon which checks for people using various taunts, and sends a chat message to party or raid whenever one is used. However, Challenging Roar is proving to be a nuisance.

It works ... but it sends a chat message for every target affected by it. For example, if you used it on a pack of dragonkin in Grim Batol, three messages would be sent to your party.

How do I make it so that only one message is sent?

This is the code I have just now:


-- 5209: Challenging Roar
-- 71: Defensive Stance
if (spellid == 5209) or (spellid == 71) then
if sourceName ~= myName and UnitInRaid(sourceName) and (inRaid) then
SendChatMessage("<TauntWatch> " .. sourceName .. " used " .. GetSpellLink(spellid) .. ".", "RAID",lang)
elseif sourceName ~= myName and UnitInParty(sourceName) and (inParty) then
SendChatMessage("<TauntWatch> " .. sourceName .. " used " .. GetSpellLink(spellid) .. ".", "PARTY",lang)
end
end
end


I thought that by doing it like this, only one message would be sent. It didn't work.

Any and all help is appreciated!
Dðra
Outland
Dðra
1 Human Rogue
0
1) put in a time delay if possible. If challenging roar message has been sent in the last 60s, then don't send it again.

In your initialisation bit record the time (e.g. as tau).
After
23/06/2012 21:47Posted by Navitas
if (spellid == 5209) or (spellid == 71) then

if tau+60s > time function, stop routine.
then set tau as the new time.

2) record the previous spell id used, and compare it to the current. e.g.

-- 5209: Challenging Roar
-- 71: Defensive Stance
if ( (spellid == 5209) or (spellid == 71) ) and (spellid ~= lastspell )then
if sourceName ~= myName and
elseif sourceName ~= myName and
end
end
end
lastspell=spellid


You will have to check the syntax as I don't know it that well.
Also it might be an idea to store lastspell in an array of all party/raid members.
Ketho
Boulderfist
Ketho
85 Dwarf Priest
8390
Check for SPELL_CAST_SUCCESS instead of SPELL_AURA_APPLIED for spells like Challenging Roar
http://www.wowpedia.org/API_COMBAT_LOG_EVENT
Knarko
Grim Batol
Knarko
90 Human Priest
16715
Is that Ketho I see?
Ketho
Boulderfist
Ketho
85 Dwarf Priest
8390
ehh yes, hi again!! :3
Navitas
Aszune
Navitas
85 Tauren Druid
7410
Thanks for the help. It works fine now.

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Click here to view the Forums Code of Conduct.

Report Post # written by
Reason
Explain (256 characters max)

Reported!

[Close]