Thread Tools Display Modes
11-25-07, 12:48 PM   #1
Tatheltek
A Cyclonian
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 43
Red Alert

This will serve and the official suggestion thread for Red Alert.

If needed, you may contact me through [email protected]
  Reply With Quote
11-25-07, 12:55 PM   #2
Tatheltek
A Cyclonian
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 43
If I'm registering "CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS" and searching for things that share a similar name such as the shaman buff "focused" with the meta gem proc "focus," how do I differentiate between the two. Atm, Red Alert finds "focus" when "focused" is proccing for shamans and inturn splashing the incorrect alert message

Code:
	if (strfind(msg,"You gain Focused.") ) then
		RedAlertSplashFrame:SetTimeVisible(2)
		RedAlertSplashFrame:AddMessage("|CFF66CCFFFocused!");
		RedAlertDetailsFrame:SetTimeVisible(2)
		RedAlertDetailsFrame:AddMessage("-60% mana cost for next shock!");
	end
	if (strfind(msg,"You gain Focus.") ) then
		RedAlertSplashFrame:SetTimeVisible(2)
		RedAlertSplashFrame:AddMessage("|CFF66CCFFSpell Focus!");
		RedAlertDetailsFrame:SetTimeVisible(2)
		RedAlertDetailsFrame:AddMessage("Casting Time reduced by 50%!");
		PlaySoundFile("Interface\\Addons\\RedAlert\\Sounds\\Alert.wav");
	end
Can i just define two different locals and search for them?

local Focus1 = "focus"
local Focus2 = "focused"

if (strfind(msg, "you gain" .. Focus1 ..) )then
and
if (strfind(msg, "you gain" .. Focus2 ..) )then

???
  Reply With Quote
12-19-07, 03:58 AM   #3
Teif
A Deviate Faerie Dragon
Join Date: May 2006
Posts: 12
What your code is effectively doing is checking for both focused and focus one after the other, where you could instead exclude one based on the results of the other (well .. i managed to put that pretty cryptic o.O).

What i mean is, when you have the "Soandso gains Focused." message your code will first check for focused and regardless of what it found, it will check for focus after. Instead you could determine, based on your first check whether or not it makes sense to carry out the second check.

Since "Focus" will always trigger for "Focused" as well, your code will always override the "Focused" splash with the "Focus" one. The code below should help avoid that by simply adding else to the second if statement, making it only evaluate if the "Focused" check failed.

Code:
if (msg:find("You gain Focused.")) then
   -- Focused was triggered
elseif (msg:find("You gain Focus.")) then
   -- Focus was triggered
end
This should make it only trigger for Focus, when it has determined, that it's not the Focused effect.

Hope this helps any.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Alpha/Beta AddOns and Compilations » Red Alert


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