1. My addon is working smoothly now (thanks jnwhiteh), but I have another problem.

    Currently, the only way to find out commands for the addon is to Alt-Tab and open a seperate (HTML) file. This simply will not do, and I'm sure the users don't like it.

    I want to have a simple '/help' command that will display a window with all the commands in it - something like QuestHelper has.

    Any help will be great, and thanks so much for helping me get my addon to work!

    My addon is working smoothly now (thanks jnwhiteh), but I have another problem.

    Currently, the only way to find out commands for the addon is to Alt-Tab and open a seperate (HTML) file. This simply will not do, and I'm sure the users don't like it.

    I want to have a simple '/help' command that will display a window with all the commands in it - something like QuestHelper has.

    Any help will be great, and thanks so much for helping me get my addon to work!

    Oh, there is also something else I need help with (wasn't allowed to edit my original post, so I apologise for this double post).

    Currently, I have 'Playing sound sent from: <USER>' when a sound is received by CHAT_MSG_ADDON - is there a way to make it say something like:

    Bob plays a sound: Need backup.

    Joe plays a sound: Roger that.

    In other words: '<USER> plays a sound: <SOUND ID>'.

    I've tried sending another prefix via SendAddonMessage, but that just breaks things.

    My addon is working smoothly now (thanks jnwhiteh), but I have another problem.

    Currently, the only way to find out commands for the addon is to Alt-Tab and open a seperate (HTML) file. This simply will not do, and I'm sure the users don't like it.

    I want to have a simple '/help' command that will display a window with all the commands in it - something like QuestHelper has.

    Any help will be great, and thanks so much for helping me get my addon to work!

    Then you just need to alter your slash command so that it prints a help message.  For example:

    SLASH_MYADDON1 = "/foo"

    SlashCmdList["MYADDON"] = function(msg, editbox)

      -- If there is no non-space text in the arguments the user sent

      if not msg:match("%S") then 

        print("Slash command usage for '/foo':")

        print("  /foo mute - Mutes this addon")

        print("  /foo unmute - Unmutes this addon")

        return

      end

      -- Rest of your slash command goes here

    end 

    Oh, there is also something else I need help with (wasn't allowed to edit my original post, so I apologise for this double post).

    Currently, I have 'Playing sound sent from: <USER>' when a sound is received by CHAT_MSG_ADDON - is there a way to make it say something like:

    Bob plays a sound: Need backup.

    Joe plays a sound: Roger that.

    In other words: '<USER> plays a sound: <SOUND ID>'.

    I've tried sending another prefix via SendAddonMessage, but that just breaks things.

    This doesn't have anything to do with the message being sent, or the prefix.  You can just make a table in your local addon that maps sound filenames to text strings:

    local soundMap = {

      ["Interface\\Addons\\MyAddon\\RogerThat.mp3"] = "Roger that",

      ["Interface\\AddOns\\MyAddon\\NeedBackup.mp3"] = "Need backup",

    }

    Then when you want to print out your message, you just convert the filename into the text and display that instead. 

    This doesn't have anything to do with the message being sent, or the prefix.  You can just make a table in your local addon that maps sound filenames to text strings:

    local soundMap = {

      ["Interface\\Addons\\MyAddon\\RogerThat.mp3"] = "Roger that",

      ["Interface\\AddOns\\MyAddon\\NeedBackup.mp3"] = "Need backup",

    }

    Then when you want to print out your message, you just convert the filename into the text and display that instead. 

    How do I do that? I'm sorry for all these questions, but I really (really, really, REALLY) appreciate your help.

     

    SLASH_MYADDON1 = "/foo"

    SlashCmdList["MYADDON"] = function(msg, editbox)

      -- If there is no non-space text in the arguments the user sent

      if not msg:match("%S") then 

        print("Slash command usage for '/foo':")

        print("  /foo mute - Mutes this addon")

        print("  /foo unmute - Unmutes this addon")

        return

      end

      -- Rest of your slash command goes here

    end



    I had something like that before, but felt it was a bit too much spam for the users chat frames.
    XSSFilter could not parse (X)HTML:
    
    
    
    <blockquote>
    <blockquote>
    <p>This doesn't have anything to do with the message being sent, or the prefix.  You can just make a table in your local addon that maps sound filenames to text strings:</p>
    <pre>local soundMap = {<br />  ["Interface\\Addons\\MyAddon\\RogerThat.mp3"] = "Roger that",<br />  ["Interface\\AddOns\\MyAddon\\NeedBackup.mp3"] = "Need backup",<br />}</pre>
    <p>Then when you want to print out your message, you just convert the filename into the text and display that instead. </p>
    </blockquote>
    
    
    <p>How do I do that? I'm sorry for all these questions, but I really (really, really, REALLY) appreciate your help.</p>
    
    <p></blockquote></p>
    
    <p>It's completely impossible for me to tell you how to do things like this without seeing your code.  The first 6 chapters of the book are to get you familiar with these types of coding exercises.  Here is an example using the above table.</p>
    
    
    <p>-- if soundFile is "Interface\\AddOns\\MyAddon\\NeedBackup.mp3" then you can do something like this:<br />print("Someone sent this sound: " .. soundMap[soundFile])</p>
    
    
    <p>As for the slash command.. I have no idea what you're looking for if it's not that.. could you please elaborate?</p>
    
    
    <p> </p>
    
    

    Going by your response, you're not familiar with an addon called QuestHelper: http://wow.curse.com/downloads/wow-addons/details/quest-helper.aspx

    There is a command (/qh) that gives you a window with all the commands in it. That is the sort of thing I am looking for.

    I'm familiar with Questhelper, but don't ever access the help command and do not use the addon regularly.  If you want to create a window that displays text, there are a number of examples that show how to do this in the book.  You can then just show that frame when the user users the slash command.  Alternatively, look at the Questhelper code and see how they accomplish it.

    I've tried that, and when I try and use the same code for myself, WoW always comes up with an error of some kind.

    local f = CreateFrame("Frame",nil,UIParent)
    f:SetFrameStrata("BACKGROUND")
    
    f:ShowText({{INSERT HELP HERE.}})
    

    When I start WoW and enter the help command, it always says that 'ShowText' is a 'nil value'.

    The curly brackets are meant to be square brackets, but they kept getting parsed as an HTML link, so I replaced them.

    I've tried that, and when I try and use the same code for myself, WoW always comes up with an error of some kind.

    local f = CreateFrame("Frame",nil,UIParent) f:SetFrameStrata("BACKGROUND")

    f:ShowText({{INSERT HELP HERE.}})

    When I start WoW and enter the help command, it always says that 'ShowText' is a 'nil value'.

    The curly brackets are meant to be square brackets, but they kept getting parsed as an HTML link, so I replaced them.

    Thanks for the report about the square braces. Frames do not have a ShowText() method, so you obviously can't call it. What you're likely thinking of is SetText.. but frames do not have that method either. What you want to do is create a frame with a font string and then set that. For example you could use this snippet.

    That's fantastic. Just the sort of thing I was looking for.

    One final question - could you direct me to the tutorial on creating buttons? I trust scrollbars are created automatically.

    I'm not sure what you mean by a tutorial for buttons. And no, scrollbars are not created automatically. For something more complex like that you're going to have to read up on creating Buttons and ScrollFrames, both covered in the book.