• 0

    posted a message on Chat_Msg_Channel Problems
    I just want to say thanks. Not only have you helped me fix my problem, but you also went above and beyond to help. The community that you guys create here is awesome for addon development. Keep up the good work!
    Posted in: Need Help?
  • 0

    posted a message on Chat_Msg_Channel Problems
    You know, I never thought of that. I have to admit, it's been a while since I tried programming anything, and I'm self-taught (poorly, I might add). Could you give me a hint as to how I could still pass those arrays to that function without rebuilding them? I don't like the idea of them being globals, but I'm very rusty at this, and I can't think of another way off the top of my head.
    Posted in: Need Help?
  • 0

    posted a message on Chat_Msg_Channel Problems
    http://pastebin.com/zVd5JRGt


    ^ entire code. I apologize if it's hard to read, as I'm sure there are better ways that duplicating all that code. EDIT: Forgot to format to LUA, new link included.

    ...e\AddOns\Trade Chat Champion\Trade Chat Champion.lua:185: attempt to concatenate global 'arg2' (a nil value)
    Count: 99
    
    Call Stack:
    (tail call): ?
    [C]: ?
    ...e\AddOns\Trade Chat Champion\Trade Chat Champion.lua:185: in function <...e\AddOns\Trade Chat Champion\Trade Chat Champion.lua:154>
    ...e\AddOns\Trade Chat Champion\Trade Chat Champion.lua:606: in function <...e\AddOns\Trade Chat Champion\Trade Chat Champion.lua:603>
    
    Posted in: Need Help?
  • 0

    posted a message on Chat_Msg_Channel Problems
    I apologize, I realize I didn't include that.

    The error I'm getting is telling me that the "..arg2.." inside of my response array is a nil value. The exact line is (after slimming down the similar responses below this one):

    local responses = {
    "This is my automated response "..arg2..". There are many like it, but this one is mine.",
    }

    There are good 20 similar lines of responses after that, but I feel as though they aren't the issue, and I figured I'd spare your eyes.

    I would like to point out this addon was perfectly functional during the era of ToC and I believe early ICC. I lose track of time terribly, but I haven't changed the code, and this version I'm running is downloaded directly from my version on Curse, which hasn't been updated past the last working version.
    Posted in: Need Help?
  • 0

    posted a message on Chat_Msg_Channel Problems
    Hi,

    First off, let me say that I usually use the search feature before posting, so I apologize if this was addressed recently, but it doesn't seem to like me, so figured it might just be easier to post.

    My problem is this:

    I recently decided to update a rather fun little addon I wrote that uses CHAT_MSG_CHANNEL to pull the authors name via arg2 to respond to them by name directly. However, using my random response generation, which basically just picked a random string (that contains an ag2 variable) inside of my array of possible responses. However, it's now throwing a nil value error back at me. I haven't updated this addon since wrath, and I'm guessing that something dealing with events has changed. Does anyone have an idea as to what might be wrong?

    local f = CreateFrame("Frame")
    f:RegisterEvent("CHAT_MSG_CHANNEL")
    f:RegisterEvent("CHAT_MSG_BATTLEGROUND") 
    f:SetScript("OnEvent", function (self, event, msg, arg2, _, _, _, _, _, channel, channame)
    
    	if (event == "CHAT_MSG_CHANNEL") and (channame == "tcctest") then
    			CheckMsgMatch(msg, "CHANNEL", channel)
    	end
    
    end


    This is my event register(er?). The CheckMsgMatch basically just checks whether the addons user is responding to a guildmate or friend, and if it is not, then it responds with several witty and clever remarks. Does anyone have an idea as to what might be wrong? Any help would be met with hugs.
    Posted in: Need Help?
  • 0

    posted a message on Silent Communication between addons
    After looking into a lot of different ways to do this, I'm still hitting a wall on the following problem.

    I have created a few extra functions to help deal with the addon responding or not responding based on if another addon has "spoken" , so to speak. That is to say, if another addon has randomed a lower number than the instance we are speaking about, and replied sooner, the instance of the addon that we're speaking about will not reply. However, I am missing one crucial element. I cannot seem to figure out how to have the addon wait and still understand that at the end of the wait period, if no other addon has responded THEN reply. I am at a loss as to how to do this without a loop. Also, I fear including and calling an addon library isn't something I'm 100% sure how to do. Is that the only way? Should I be researching how to embed a function from a library (I assume thats how it works)?

    The following is the main function in my LUA program. I fear my programming skills are just insufficient, and to be honest, I feel a little out of control now. I know the following code really doesn't do what it's supposed to, so I'm looking for a little help.

    Things to know:

    fTimeIni is a function that will retrieve the current time and the time the addon is allowed to respond once. At the end of its sequence, it changes a variable from 0 to 1, disallowing another call.

    Matchtrigger is a function that checks for a trigger (for debugging, I've added [TCC] to the beginning of all responses) and if it finds it, it will change AllowTalk to 1, disallowing the CheckMsgMatch function to execute.

    fTime is the same as TimeIni, but will execute as many times as necessary.

    CheckMsgMatch will check if the player is a friend, or a guildmate. If not, it will roll 1-100 (chance to respond). If it rolls below the percentage number, it will respond. If not, it will print something to the user letting them know what happened.

    local f = CreateFrame("Frame")
    f:RegisterEvent("CHAT_MSG_CHANNEL")
    f:RegisterEvent("CHAT_MSG_BATTLEGROUND")
    f:SetScript("OnEvent", function (self, event, msg, arg2, _, _, _, _, _, channel, channame)
    fTimeIni()
    -- Mod test channel.
    if (event == "CHAT_MSG_CHANNEL") and (channame == "tcctest") then
    if GetTime() >= waittime then
    matchTrigger(msg, "CHANNEL", channel)
    if AllowTalk == 0 then
    sent() -- **Debug**
    CheckMsgMatch(msg, "CHANNEL", channel)
    end
    AllowTalk=0
    fTime()
    end
    end
    Posted in: Need Help?
  • 0

    posted a message on Silent Communication between addons
    You guys have given me a lot to think about, and learn, so for now I'm going to say thank you very much, and I will most likely be back with more questions!

    I appreciate the help very much, you guys are awesome.
    Posted in: Need Help?
  • 0

    posted a message on Silent Communication between addons
    I considered something like that in the very beginning, but I was unable to find any wait commands that didn't cause WoW to lock up. Are there any working ones that exist in LUA? I was under the impression that a sleep/pause function didn't exist.

    Also, thinking about it, using your way, I could just random 1-20, say, and then the lowest response time would go off, correct? I liked this idea when I first started, but then I ran into the problem of "Well, how am I going to make it wait when LUA doesn't have a sleep command?"

    I tried a simple loop along the lines of:

    while TimePlusWait > GetTime() do
    end

    But that froze my WoW up. I assumed WoW doesn't like an addon taking up CPU cycles. Or perhaps my addon is somehow sleeping the entire WoW program, but that seems unlikely.

    I also looked into the use of libraries with sleep functions, and while I really would prefer to not include a library in this addon, if that is the only way, I guess a must is a must.
    Posted in: Need Help?
  • 0

    posted a message on Silent Communication between addons
    I'm not saying that it has to communicate over trade, just something that can operate along side trade. A custom channel seems like the best way to do this because only the addon users will have joined it, and then (I hope) all the chat can be hidden from the user.
    Posted in: Need Help?
  • 0

    posted a message on Silent Communication between addons
    I may be mistaken, but don't you access that with SendAddonMessage? That only works for party, raid, battleground, guild, or whisper. I need something that can communicate between guilds or parties, over trade chat.
    Posted in: Need Help?
  • 0

    posted a message on Silent Communication between addons
    Is there a way to hide such a communication? I've been looking rather extensively to find something of that nature.

    EDIT: What I'm asking for is a way to have the instances of my addons communicate with each other. They need to be able to communicate cross-city, and continent. They need to be free of guild or group communication restrictions. And it all needs to be hidden from the user.
    Posted in: Need Help?
  • 0

    posted a message on Silent Communication between addons
    I've been working on my addon, Trade Chat Champion, recently, and as it's grown in popularity, the need as arisen to have the addons communicate between each other. The addon needs to roll in a preset channel unique to those addons, and not display the rolls in any visible area of chat. While it is rolling, the addon will use a GetTime() function just prior to rolling and add 2 to it.

    After waiting two seconds for all the rolls, the if / then command with the time + 2 variable will meet its conditions, and continue with the rest of the commands that is required IF, and only if, that specific instance of the addon had the highest roll.

    Problem is, I'm not 100% sure how to do this because I have just recently started teaching myself LUA, so if you're reading this, feel free to drop a suggestion, even if your idea / help is even a tiny part of the whole function I'm looking to create!

    Obviously, with time, I'll be able to google my way through the problem, but I figure why not try two different sources.

    Again, any help at all will be greatly appreciated, and I thank those that will respond in advance!

    - Daemios


    Update:
    After looking into the situation a bit more, I'm interested in the SendAddonMessage API. Is it possible to send information over a private channel using this?

    In other news, I've worked out a rough logic for my addon, and while I have reservations for displaying my lack of skill, it is the following:

    1. /join channel on login (optional: when player joins trade / BG (separate channels for each?))

    Currently, the the addon uses JoinChannelByName, and joins my test channel "tcctest".

    2. When triggered, the addon should use GetTime() + 2 to retrieve the time and add a sufficient enough delay.

    3. Read chat

    4. Compare math.random(1, 1000) of all the addons

    5. Highest number continues to main function, rest end (if then with 0 or 1?)

    6. (optional: /leave channel when you leave the respective trade / bg channel) -- LeaveChannelByName("channel") - Leaves the channel with the specified name.
    Posted in: Need Help?
  • 0

    posted a message on Missing Addon?
    I recently have been working on a rather simple addon, and have uploaded it to CurseForge. Recently, it was approved, and I moved it into release phase, but after a day, it still hasn't appeared on Curse.com. When I click it's Curse.com link in CurseForge, I get the following page error:

    The post you requested cannot be found or no longer exists. The administrator or moderator may have deleted the post.

    It has been like that since I set it to release. I've read the FAQ's, but I'm afraid they're terribly confusing, and I would appreciate any help on the matter.
    Posted in: Need Help?
  • To post a comment, please or register a new account.