03-21-14, 11:21 AM | #1 |
Class colors in message output
Greetings all, I am fairly new to lua and I have been pooling multiple resources to try and get this abandoned addon up to date and have made progress, however I am trying to add the class color of the person who conjures/creates and item to show in the message that is sent:
Code:
local timestamp, type, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellID, spellName = ... --print (type,spellID,sourceName,destName) --printMessage (searchTable) if (AnnouncerState == true and (UnitInParty(sourceName) or UnitInRaid(sourceName)) and (type=="SPELL_CREATE" or type=="SPELL_SUMMON" or type=="SPELL_CAST_SUCCESS") and GetNumGroupMembers()>0 and checkTable[spellID]~=nil) then --printMessage ("**************") --printMessage (type,spellID,sourceName,destName) -- use this for cauldrons, they show up only for SPELL_CAST_START and have null for destName if (destName==nil) then destName = spellName end if (destName=="Create Soulwell") then return end local _, class = GetPlayerInfoByGUID(sourceGUID) local color, message = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class] if color then message = ("{rt1}\124c%s%s\124r has created %s{rt1}"):format(color.colorStr, sourceName, GetSpellLink(spellID)) else message = ("{rt1}%s has created %s{rt1}"):format(sourceName, GetSpellLink(spellID)) end |
|
03-21-14, 11:37 AM | #2 |
If you are trying to use this with the SendChatMessage API it will not work.
You cannot send any kind of escape codes (this includes colors) in chat with the exception of target charms. ({rt#}) You can only colorize messages locally (in your own chatframes) I can't tell what you're trying to do from that snippet you posted, you need to post more relevant code or link to the addon in question. |
|
03-21-14, 11:41 AM | #3 |
I am trying to update Conjured Announcer. I have a version that works fine with the exception of noodle carts >Working w/o Carts.
This below is an attempt at printing the class color of the person/player that conjures the item/spell. Tested and confirmed both in game and http://codepad.org/dlhrKHRC there are no errors, but with the lua below the addon loads fine but there is no chat output whatsoever. Code:
function displayMessage(msg) inInstance, instanceType = IsInInstance() local messageType = "PARTY" if AnnouncerPARTY==true then -- elseif inInstance == 1 and instanceType ~= "none" then messageType = "INSTANCE_CHAT" end if (AnnouncerRW == true and (UnitIsGroupAssistant("player") or UnitIsGroupLeader("player")) and IsInRaid()) then messageType = "RAID_WARNING" end SendChatMessage(msg,messageType) end function printMessage(msg) print("|cff7f7fff[CA 2] "..msg) end function OnEvent(self, event, ...) if event == "VARIABLES_LOADED" then if AnnouncerState==nil then AnnouncerState = true end if AnnouncerPARTY==nil then AnnouncerPARTY = true end if AnnouncerRW==nil then AnnouncerRW = false end if AnnouncerState==true then conjuredAnnouncer:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") else conjuredAnnouncer:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED") end printMessage("Conjured Announcer loaded.") printMessage("Type /can or /cann for options. Announcer state is: "..getState(AnnouncerState)) SlashCmdList["FFDCMD"] = SlashCommand; SLASH_FFDCMD1 = "/can"; SLASH_FFDCMD2 = "/cann"; else local timestamp, type, hideCaster, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags, spellID, spellName = ... --print (type,spellID,sourceName,destName) --printMessage (searchTable) if (AnnouncerState == true and (UnitInParty(sourceName) or UnitInRaid(sourceName)) and (type=="SPELL_CREATE" or type=="SPELL_SUMMON" or type=="SPELL_CAST_SUCCESS") and GetNumGroupMembers()>0 and checkTable[spellID]~=nil) then --printMessage ("**************") --printMessage (type,spellID,sourceName,destName) -- use this for cauldrons, they show up only for SPELL_CAST_START and have null for destName if (destName==nil) then destName = spellName end if (destName=="Create Soulwell") then return end local _, class = GetPlayerInfoByGUID(sourceGUID) local color, message = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class] if color then message = ("{rt1}\124c%s%s\124r has created %s{rt1}"):format(color.colorStr, sourceName, GetSpellLink(spellID)) else message = ("{rt1}%s has created %s{rt1}"):format(sourceName, GetSpellLink(spellID)) end if (antispamtable[message]==nil) then antispamtable[message] = time() displayMessage(message) else if (time()-antispamtable[message])>10 then antispamtable[message] = time() displayMessage(message) end end end end end function helptxt() printMessage(" Conjured Announcer 2. Current state: "..getState(AnnouncerState)) printMessage(" ") printMessage(" Activate : /can on") printMessage(" Deactivate: /can off") printMessage(" Announce on party: /can party") printMessage(" Announce on group chat: /can group") printMessage(" Announce on raid warning: /can rw") end function SlashCommand(msg) local argc, argv = 0, {} gsub(msg, "[^%s]+", function (word) argc=argc+1; argv[argc]=word; end); if (argc == 1) then if (argv[1] == "help") then helptxt() elseif (argv[1] == "off") then printMessage("Announcer state OFF. Type /can on to activate") AnnouncerState = false; conjuredAnnouncer:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED") elseif (argv[1] == "on") then printMessage("Announcer state ON. Type /can off to deactivate") AnnouncerState = true conjuredAnnouncer:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") elseif (argv[1] == "party") then AnnouncerPARTY = true printMessage("Announcer set to PARTY.") elseif (argv[1] == "rw") then AnnouncerRW = not AnnouncerRW printMessage("Announcer using raidwarning: "..getState(AnnouncerRW)) elseif (argv[1] == "group") then AnnouncerPARTY = false printMessage("Announcer set to GROUP.") end else helptxt() end end function getState(cond) if cond==true then return "ON" else return "OFF" end end --67826 Jeeves --54711 Scrapbot --44389 Field Repair Bot 110G --22704 Field Repair Bot 74A --57426 Fish Feast --57301 Great Feast --54710 MOLL-E --92824 Ritual of Refreshment --43987 Refreshment Portal --698 Ritual of Summoning --29893 Ritual of Souls --41458 Cauldron of Major Arcane Protection --41500 Cauldron of Major Fire Protection --41501 Cauldron of Major Frost Protection --92649 Cauldron of Battle --92712 Big Cauldron of Battle --87915 Goblin Barbecue Feast --87644 Seafood Magnifique Feast --87643 Broiled Dragon Feast --145196 Pandaren Treasure Noodle Cart Kit --145169 Deluxe Noodle Cart --145166 Noodle Cart --104958 Pandaren Banquet --126492 Banquet of the Grill --126494 Great Banquet of the Grill --126501 Banquet of the Oven --145061 Deluxe Noodle Cart Kit --145038 Noodle Cart Kit --126502 Great Banquet of the Oven --126504 Great Banquet of the Brew --126498 Great Banquet of the Pot --126500 Great Banquet of the Steamer --126496 Great Banquet of the Wok --105193 Great Pandaren Banquet --126503 Banquet of the Brew --126497 Banquet of the Pot --126499 Banquet of the Steamer --126495 Banquet of the Wok --10059 STORMWIND PORTAL --11416 IRONFORGE PORTAL --11417 ORGRIMMAR PORTAL --11418 UNDERCITY PORTAL --11419 DARNASSUS PORTAL --11420 THUNDER BLUFF PORTAL --32266 EXODAR PORTAL --32267 SILVERMOON PORTAL --33691 SHATTRATH PORTAL --35717 SHATTRATH PORTAL --49360 THERAMORE PORTAL --49361 STONARD PORTAL --53142 DALARAN PORTAL --88345 TOL BARAD PORTAL --88346 TOL BARAD PORTAL --120146 ANCIENT DALARAN PORTAL --132620 VALE OF ETERNAL BLOSSOMS PORTAL --132626 VALE OF ETERNAL BLOSSOMS PORTAL spellIDS = {67826,54711,44389,22704,57426,57301,54710,92824,43987,698,29893,41458,41500,41501,92649,92712,87915,87644,87643,145196,145169,145166,104958,126492,126494,126501,145061,145038,126502,126504,126498,126500,126496,105193,126503,126497,126499,126495,10059,11416,11417,11418,11419,11420,32266,32267,33691,35717,49360,49361,53142,88345,88346,120146,132620,132626} checkTable = {} for i=1,#spellIDS do checkTable[spellIDS[i]]=1 end msgType = {} msgType["pvp"]="BATTLEGROUND" msgType["arena"]="PARTY" msgType["party"]="PARTY" msgType["instance"]="INSTANCE" msgType["raid"]="RAID" antispamtable = {} conjuredAnnouncer = CreateFrame("Frame") conjuredAnnouncer:RegisterEvent("VARIABLES_LOADED") conjuredAnnouncer:SetScript("OnEvent", OnEvent) Last edited by Tactica : 03-21-14 at 12:30 PM. Reason: updated working code link |
|
03-21-14, 02:22 PM | #4 |
For some reason the addon does not detect when a player is in an instance/LFD which is a more pressing issue than anything else:
Code:
function displayMessage(msg) inInstance, instanceType = IsInInstance() local messageType = "party" if Announcerparty==true then -- elseif inInstance == 1 and instanceType ~= "none" then messageType = "INSTANCE_CHAT" end if (AnnouncerRW == true and (UnitIsGroupAssistant("player") or UnitIsGroupLeader("player")) and IsInRaid()) then messageType = "RAID_WARNING" end SendChatMessage(msg,messageType) end function printMessage(msg) print("|cff7f7fff[Conjured Announcer 2] "..msg) end function OnEvent(self, event, ...) if event == "VARIABLES_LOADED" then if AnnouncerState==nil then AnnouncerState = true end if Announcerparty==nil then Announcerparty = true end if AnnouncerRW==nil then AnnouncerRW = false end if AnnouncerState==true then conjuredAnnouncer:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") else conjuredAnnouncer:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED") end printMessage("Conjured Announcer 2 loaded.") printMessage("Type /can or /cann for options. Announcer state is: "..getState(AnnouncerState)) SlashCmdList["FFDCMD"] = SlashCommand; SLASH_FFDCMD1 = "/can"; SLASH_FFDCMD2 = "/cann"; else local timestamp, type, sourceGUID,hideCaster, sourceName, sourceFlags,sourceRaidFlags, destGUID, destName, destFlags,destRaidFlags, spellID, spellName = select(1, ...) --print (type,spellID,sourceName,destName) --printMessage (searchTable) if (AnnouncerState == true and (UnitInParty(sourceName) or UnitInRaid(sourceName)) and (type=="SPELL_CREATE" or type=="SPELL_SUMMON" or type=="SPELL_CAST_START") and GetNumGroupMembers()>0 and checkTable[spellID]~=nil) then --printMessage ("**************") --printMessage (type,spellID,sourceName,destName) -- use this for cauldrons, they show up only for SPELL_CAST_START and have null for destName if (destName==nil) then destName = spellName end if (destName=="Create Soulwell") then return end message = "{rt1}" ..sourceName .. " has created " .. GetSpellLink(spellID).."{rt1}" if (antispamtable[message]==nil) then antispamtable[message] = time() displayMessage(message) else if (time()-antispamtable[message])>10 then antispamtable[message] = time() displayMessage(message) end end end end end function helptxt() printMessage(" Conjured Announcer 2. Current state: "..getState(AnnouncerState)) printMessage(" ") printMessage(" Activate : /can on") printMessage(" Deactivate: /can off") printMessage(" Announce on party: /can party") printMessage(" Announce on group chat: /can group") printMessage(" Announce on raid warning: /can rw") end function SlashCommand(msg) local argc, argv = 0, {} gsub(msg, "[^%s]+", function (word) argc=argc+1; argv[argc]=word; end); if (argc == 1) then if (argv[1] == "help") then helptxt() elseif (argv[1] == "off") then printMessage("Announcer state OFF. Type /can on to activate") AnnouncerState = false; conjuredAnnouncer:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED") elseif (argv[1] == "on") then printMessage("Announcer state ON. Type /can off to deactivate") AnnouncerState = true conjuredAnnouncer:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") elseif (argv[1] == "party") then Announcerparty = true printMessage("Announcer set to party.") elseif (argv[1] == "rw") then AnnouncerRW = not AnnouncerRW printMessage("Announcer using raidwarning: "..getState(AnnouncerRW)) elseif (argv[1] == "group") then Announcerparty = false printMessage("Announcer set to GROUP.") end else helptxt() end end function getState(cond) if cond==true then return "ON" else return "OFF" end end --67826 jewels --54711 scrapbot --44389 Field Repair Bot 110G --57426 fishfeast --57301 great feast --54710 moll-e --92824 Ritual of Refreshment --43987 Refreshment Portal --698 Ritual of Summoning --29893 Ritual of Souls --92649 Cauldron of Battle --92712 Big Cauldron of Battle --87915 Goblin Barbecue Feast --87644 Seafood Magnifique Feast --87643 Broiled Dragon Feast --104958 Pandaren Banquet --126492 Banquet of the Grill --126494 Great Banquet of the Grill --126501 Banquet of the Oven --126502 Great Banquet of the Oven --126504 Great Banquet of the Brew --126498 Great Banquet of the Pot --126500 Great Banquet of the Steamer --126496 Great Banquet of the Wok --105193 Great Pandaren Banquet --126503 Banquet of the Brew --126497 Banquet of the Pot --126499 Banquet of the Steamer --126495 Banquet of the Wok --10059 STORMWIND PORTAL --11416 IRONFORGE PORTAL --11417 ORGRIMMAR PORTAL --11418 UNDERCITY PORTAL --11419 DARNASSUS PORTAL --11420 THUNDER BLUFF PORTAL --32266 EXODAR PORTAL --32267 SILVERMOON PORTAL --33691 SHATTRATH PORTAL --35717 SHATTRATH PORTAL --49360 THERAMORE PORTAL --49361 STONARD PORTAL --53142 DALARAN PORTAL --88345 TOL BARAD PORTAL --88346 TOL BARAD PORTAL --120146 ANCIENT DALARAN PORTAL --132620 VALE OF ETERNAL BLOSSOMS PORTAL --132626 VALE OF ETERNAL BLOSSOMS PORTAL spellIDS = {67826,54711,44389,22704,57426,57301,54710,92824,43987,698,29893,41458,41500,41501,92649,92712,87915,87644,87643,145196,145169,145166,104958,126492,126494,126501,145061,145038,126502,126504,126498,126500,126496,105193,126503,126497,126499,126495,10059,11416,11417,11418,11419,11420,32266,32267,33691,35717,49360,49361,53142,88345,88346,120146,132620,132626} checkTable = {} for i=1,#spellIDS do checkTable[spellIDS[i]]=1 end msgType = {} msgType["pvp"]="BATTLEGROUND" msgType["arena"]="PARTY" msgType["party"]="PARTY" msgType["raid"]="RAID" antispamtable = {} conjuredAnnouncer = CreateFrame("Frame") conjuredAnnouncer:RegisterEvent("VARIABLES_LOADED") conjuredAnnouncer:SetScript("OnEvent", OnEvent) Last edited by Tactica : 03-21-14 at 03:19 PM. |
|
03-21-14, 04:01 PM | #5 |
The globals in that code are simply horrifying, and I wouldn't be surprised in the least if it's not working because some other addons are overwriting them. Also, the usage of the VARIABLES_LOADED event is a dead giveaway that the codebase is extremely outdated, or at least that it was copied from some extremely outdated code. Here is a rewritten version that does not leak badly named globals (or any globals) and uses the correct events to function as expected in the current version of WoW:
Lua Code:
However, as Dridzt already pointed out, it is not possible to use colors in messages you send to other players. The other players would need to be using an addon that detected player names in chat messages and colorized them. There is no way for you to do that on your side of things. (The only way to "send colors" would be to send a colorized link, but you can't send player links through SendChatMessage either.)
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. Last edited by Phanx : 03-22-14 at 09:38 PM. |
|
03-21-14, 04:27 PM | #6 | |
Thank you so much! This loaded fine and in game menu commands were beautiful but when I set a banquet out in a party of two people (total) I got:
Code:
function Addon:COMBAT_LOG_EVENT_UNFILTERED(_, combatEvent, _, sourceGUID, sourceName, sourceFlags, _, destGUID, destName, destFlags, _, spellID, spellName) if not announceEvents[combatEvent] or not announceSpells[spellID] or bit.band(sourceGUID, FILTER_GROUP) == 0 then return end -- use this for cauldrons, they show up only for SPELL_CAST_START and have null for destName if not destName then dsetName = spellName end local message = format(MESSAGE_TEMPLATE, sourceName, destName) Just tested some portals cast by another /party member and got the same error as above. I am liking this code but am such a noob at this lua I have searched and can't find the "missing string" in: local message = format(MESSAGE_TEMPLATE, sourceName, destName) Last edited by Tactica : 03-21-14 at 06:34 PM. |
||
03-21-14, 07:32 PM | #7 |
Typo on line 105. Change dsetName to destName
|
|
03-21-14, 07:58 PM | #8 |
Fixed, now getting:
Message: ConjuredAnnouncer\ConjuredAnnouncer-1.9.9.9.3.lua:112: attempt to perform arithmetic on local "lastTime" (a nil value) Time: 03/21/14 21:53:13 Count: 1 Stack: (tail call): ? Code:
local now = GetTime() local lastTime = lastAnnounced[message] if now - lastTime < 10 then return end should it be if now = lastTime < 10 then? Last edited by Tactica : 03-21-14 at 08:03 PM. |
|
03-21-14, 08:10 PM | #9 |
No, you're checking a variable there, not setting one. Change this:
Code:
if now - lastTime < 10 then Code:
if lastTime and now - lastTime < 10 then
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
|
03-21-14, 08:19 PM | #10 |
Excellent! Now this is all great, but what about putting GetSpellLink in the message? What would I modify as this currently uses
Code:
.. TRADESKILL_LOG_THIRDPERSON .. Code:
..sourceName .. " has created " .. GetSpellLink(spellID).. Code:
Addon:SetScript("OnEvent", function(self, event, ...) return self[event](self, ...) end) Code:
function Addon:COMBAT_LOG_EVENT_UNFILTERED(_, combatEvent, _, sourceGUID, sourceName, GetSpellLink, GetSpellLink, sourceFlags, _, destGUID, destName, destFlags, _, spellID, spellName) if not announceEvents[combatEvent] or not announceSpells[spellID] or bit.band(sourceGUID, FILTER_GROUP) == 0 then return end -- use this for cauldrons, they show up only for SPELL_CAST_START and have null for destName if not destName then destName = spellName end local message = format(MESSAGE_TEMPLATE, sourceName, GetSpellLink(spellID)) local now = GetTime() local lastTime = lastAnnounced[message] if lastTime and now - lastTime < 10 then return end Last edited by Tactica : 03-21-14 at 08:49 PM. |
|
03-21-14, 09:06 PM | #11 | |
When using the command /can rw to announce to Raid Warning I get the following error:
Code:
Addon:Print("Raid warning announcements " .. db.raidWarning and "ON" or "OFF") Code:
if command == "off" then db.enabled = false Addon:GROUP_ROSTER_UPDATE() Addon:Print("Announcements OFF. Type '/can on' to enable.") elseif command == "on" then db.enabled = true Addon:GROUP_ROSTER_UPDATE() Addon:Print("Announcements ON. Type '/can off' to disable.") elseif command == "party" then db.partyInRaid = not db.partyInRaid Addon:Print("Now announcing to " .. (db.partyInRaid and "party only" or "the entire raid") .. " while in a raid.") elseif command == "rw" then db.raidWarning = not db.raidWarning Addon:Print("Raid warning announcements " .. db.raidWarning and "ON" or "OFF") Code:
.. GetSpellLink(spellID).. 1) Would like to have spell/item linked in the message 2) Portals messages should be sent on SPELL_CAST_SUCCESS in case the person cancels the cast 3) Noodle Carts still seem to be an issue, but will look into it after I can fix the previous issues Last edited by Tactica : 03-21-14 at 09:27 PM. |
||
03-21-14, 10:17 PM | #12 | ||||
Code:
local message = format(MESSAGE_TEMPLATE, sourceName, GetSpellLink(spellID) or spellName)
Code:
Addon:Print("Raid warning announcements " .. (db.raidWarning and "ON" or "OFF"))
Code:
function Addon:COMBAT_LOG_EVENT_UNFILTERED(_, combatEvent, _, sourceGUID, sourceName, sourceFlags, _, destGUID, destName, destFlags, _, spellID, spellName) if strfind(spellName, "Noodle Cart") then print(sourceName, destName, spellID, spellName) end if not announceEvents[combatEvent] or not announceSpells[spellID] or bit.band(sourceGUID, FILTER_GROUP) == 0 then return end
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
|||||
03-22-14, 06:48 AM | #13 |
Got it working with everything including the noodle carts!
Now the only "issue" I have is there is a period after the spelllink. Is there anyway to remove that period and change "creates" to "has created"? >>>Rakenaid creates [item].<<< to >>>Rakenaid has created [item]<<< Everything else seems to work, I will test more today in lfd/lfr/bgs. EDIT: Works in LFD/LFR/PVP however the player must /can party in order to announce to raid/pvp. Is there any way the addon can autodetect if the player is in a party/Instance/Raid/BG? That way the addon will continue announcing unless commanded otherwise EDIT: Also noticed that the addon loads in an "off" state. I tested in a party of two with portals, and nothing printed until I sent the command /can on. Would like to load the addon as ON upon login. I will look at the code later and see if I can fix that. It would be nice if the /can /cann responded with an "Announcer State: ON/OFF like the old code or better yet "Announcer State: ON/OFF to Party/RW". EDIT: Attempted to add the Traveler's Tundra Mammoth, confirmed spellid but no message. Would be nice since I see so many using this mount for repair in lieu of jeeves nowadays. Last edited by Tactica : 03-22-14 at 04:59 PM. |
|
03-22-14, 05:44 PM | #14 | |||||
Code:
local MESSAGE_TEMPLATE = ">>> " .. TRADESKILL_LOG_THIRDPERSON .. " <<<" Code:
local MESSAGE_TEMPLATE = ">>> %s has created %s <<<"
However, the default state should be "on", but only if you're in a group; it should automatically start listening to combat events if it's enabled when you join a group. If you want it to listen to combat events even while solo, remove the IsInGroup check from the GROUP_ROSTER_UPDATE event handler.
Code:
Addon:Print(Current state is " .. (db.enable and "|cff7fff7fON|" or "|cff7f7f7fOFF|r")) print(" Use /can or /cann with the following commands:") print(" |cffffff7f on |r- enable announcements") print(" |cffffff7f off |r- disable announcements") print(" |cffffff7f party |r- announce only to your party in a raid " .. (db.party and "(|cff7fff7fON|)" or "(|cff7f7f7fOFF|r)")) print(" |cffffff7f rw |r- announce to raid warning when possible " .. (db.rw and "(|cff7fff7fON|)" or "(|cff7f7f7fOFF|r)")) print(" |cffffff7f help |r- shows this list of commands")
Code:
if strfind(spellName, "Tundra Mammoth") then print(combatEvent, sourceName, destName, spellID, spellName) end I've updated the code in my last post to incorporate most of these changes; it doesn't include the debug print for finding spell IDs, and it still only activates while in a group.
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. Last edited by Phanx : 03-22-14 at 05:49 PM. |
||||||
03-22-14, 06:39 PM | #15 | |
Thanks Phanx for all the help...
Code:
function Addon:COMBAT_LOG_EVENT_UNFILTERED(_, combatEvent, _, sourceGUID, sourceName, sourceFlags, _, destGUID, destName, destFlags, _, spellID, spellName) if strfind(spellName, "Traveler's Tundra Mammoth") then print(combatEvent, sourceName, destName, spellID, spellName) end if not announceEvents[combatEvent] or not announceSpells[spellID] or bit.band(sourceGUID, FILTER_GROUP) == 0 then return end This returns an error: expected ) near state. Not a pressing issue but will work on it. Currently loading and rewriting. Will post/edit findings. Last edited by Tactica : 03-22-14 at 06:56 PM. |
||
03-22-14, 06:46 PM | #16 |
03-22-14, 07:09 PM | #17 | |
Code:
Addon:Print("Current state is " .. (db.enable and "|cff7fff7fON|" or "|cff7f7f7fOFF|r")) 1) Addon loads and upon /can returns that its state is ON when in fact it is not. When /can OFF is performed it returns Announcements OFF, but when I /can to check the state it declares it as ON. 2) the strng debug doesn't seem to work with the Traveler's Tundra Mammoth Last edited by Tactica : 03-22-14 at 08:04 PM. |
||
03-22-14, 09:44 PM | #18 | ||
b) Did you change the SavedVariables line in your TOC, and restart WoW?
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
|||
03-23-14, 10:00 AM | #19 | |
Checked toc and found "## SavedVariablesPerCharacter" and replaced that with "## SavedVariables: ConjuredAnnouncerDB" Restarted/reloaded and no change with the issue of have to command /can on after entering a group to get the announcements to work. I personally don't have a mammoth either however a guildie helped me confirm the horde spell id was in fact correct: 61447. Last edited by Tactica : 03-23-14 at 11:23 AM. |
||
03-23-14, 07:21 PM | #20 |
Yes, that's why I wanted the entire event trace; most likely, the problem is that summoning a mammoth triggers a different sub-event than the ones you're listening for, and you need to add the additional sub-event to the "announceEvents" table.
__________________
Retired author of too many addons. Message me if you're interested in taking over one of my addons. Don’t message me about addon bugs or programming questions. |
|
WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Class colors in message output |
«
Previous Thread
|
Next Thread
»
|
Thread Tools | |
Display Modes | |
|
|