1. Hello. I'm very new to the WoW API. I have an O.K. understanding of how most programming languages' syntax and structure work but I would still consider myself a novice. I was hoping that this community would be able to help me out with a small personal project for me and my friends. Although if I can get a really good understanding of this I might remake Gag and release it.

    I'm trying to modify the Gag addon (http://wowui.incgamers.com/?p=mod&m=6195). The addon is currently outdated but works fine as long as the Ace2 library is installed. Gag plays specific sounds when called with the proper slash commands for other people with Gag in /say or /emote proximity. It tries to enhance emotes. The thing is, I don't want it to only output to the say/emote channel. I want it to output to the guild or party channels, even if the players are not within say/emote proximity.

    I'm pretty lost. I've been looking through the code from the .lua for days now, still to no prevail. I've gotten to know the WoW API a little better by doing this but I still don't know what the best way is to go about achieving what I want.

    If anyone could look at the source and help me out I would be very grateful.

    If it can send to the SAY channel, that means it's using the SendChatMessage() function. You can view the API documentation for that function, and you should be able to alter it to send to another channel instead of SAY.

    If it can send to the SAY channel, that means it's using the SendChatMessage() function. You can view the API documentation for that function, and you should be able to alter it to send to another channel instead of SAY.

    I was on to something about that the other day. I found the SendChatMessage() function in two areas, both outputting to the say and emote channels. I tried changing the output channel to guild but doing so simply causes Gag to stop working completely, and not play any sounds when called :/.

    Here are the two functions that handle the SendChatMessage() function and the PlaySoundFile() of the addon:

    function Gag:SayGagKey(key) if(self.IsEnabled) then if(self.GroupEnabled) then

     if(time() - Gag.LastEmoteTime>1) then
       local emote = gag_data[key];
       if (emote["text"]~=nil) then SendChatMessage(emote["text"], "GUILD"); end
       if (emote["msg"]~=nil) then SendChatMessage(emote["msg"], "EMOTE"); end
     else
       self:Print("Emote blocked to prevent spam");
     end
    

    else

     self:Print("Disabled by your group leader");
    

    end else self:Print("Disabled. Type \"/gag enable\" to enable this mod."); end end

    and

    function Gag:DoEmote(key) if(self.IsEnabled) then if(self.GroupEnabled) then

     if(time() - Gag.LastEmoteTime>1) then
       local emote = gag_data[key]
       if (emote["emote"]~=nil) then DoEmote(emote["emote"]); end
       if (emote["file"]~=nil) then
         PlaySoundFile(emote["file"]);
       end
       Gag.LastEmoteTime = time();
     end
    

    else

     self:Print("Disabled by your group leader");
    

    end end end

    It seems to me that the sound file is played when the proper call in the emote channel is detected. Am I correct?

    I don't know. Without the whole code (which I don't have the time to look through right now even if I had a chance to download it) I can't say much else. I'm not familiar with the addon or how it's meant to function so it's tough to give specific advice.

    I don't know. Without the whole code (which I don't have the time to look through right now even if I had a chance to download it) I can't say much else. I'm not familiar with the addon or how it's meant to function so it's tough to give specific advice.

    I understand. Thanks anyways

    Anyone else out there who could help me out?

    edit:

    I got it figured out, nevermind this thread.

    Would you mind posting what you've learned?

    Would you mind posting what you've learned?

    What I've learned as in how I went about doing it? Or literally what I learned about programming in WoW while going about this project?

    Lol. I meant about how you solved your problem, since someone else might have a similar problem in the future.

    Lol. I meant about how you solved your problem, since someone else might have a similar problem in the future.

    Hahah oh okay. Well in the code it registered the SAY event like this:

    self:RegisterEvent("CHAT_MSG_SAY");

    which I changed to:

    self:RegisterEvent("CHAT_MSG_GUILD");

    so that it would now be a guild message triggered event.

    This was then used to create the following function:

     function Gag:CHAT_MSG_SAY(var1)
          for key,value in pairs(gag_data) do
            if(string.find(var1,gag_data[key]["text"])) then Gag:DoEmote(key); end
          end
     end
    

    which I respectively changed to:

     function Gag:CHAT_MSG_GUILD(var1)
        for key,value in pairs(gag_data) do
            if(string.find(var1,gag_data[key]["text"])) then Gag:DoEmote(key); end
        end
     end
    

    The DoEmote() function is then called and everyone in the guild hears the sound played.