1. #1
    Deleted

    create alias for slash-commands

    hey,

    i'm looking for a way to create aliases for slash commands in WoW so that instead of e.g. /readycheck i could type /rdc (or some other acronym or phrase of MY choosing).

    From googling I've found a GlobalStrings.lua referenced where slash commands are supposed to be stored but that info seems to be outdated since it doesn't exist in my WoW-folder.
    I also don't really want to mess with any WoW-internal files. Obviously, addons can create slash-commands so if it's not too much to ask i'd be glad if someone could hack a quick .lua file together for me to put the aliases in.

    Any other tips or pointers are appreciated.

    Regards,
    zora

    P.S.:
    Code:
    SLASH_RL = '/rl';
    function SlashCmdList.RL(msg, editbox)
     ReloadUI();
    end
    
    SLASH_RDC = '/rdc';
    function SlashCmdList.RDC(msg, editbox)
     DoReadyCheck();
    end
    I got this far. The /rl alias works (triggers Reload UI). But the /rdc alias doesn't work. Why?
    Last edited by mmocc23bbb0a5f; 2013-03-12 at 02:09 PM.

  2. #2
    Deleted
    From the GlobalStrings.lua which you mentioned:
    Code:
    SLASH_READYCHECK1 = "/readycheck";
    SLASH_READYCHECK2 = "/readycheck";
    Adding an additional command should be as simple as:
    Code:
    SLASH_READYCHECK3 = "/rdc"
    Just drop it into its own addon.

  3. #3
    Deleted
    But I don't have a GlobalStrings.lua

    What I do have is my own addon already (using your guide, actually, a while back) but I'm missing the correct code to implement aliases.
    Last edited by mmocc23bbb0a5f; 2013-03-13 at 01:18 AM.

  4. #4
    You do have a GlobalStrings.lua for sure, otherwise you WoW won't work. You just don't see it as a plain text file because it's included in one of the WoW data files. There is a FrameXML extraction utility provided by Blizzard if you want to look at the files (or you could just browse them at https://github.com/tekkub/wow-ui-source).

    You don't need to implement the alias. Just add the one line of Treeston's second code block to a lua file, create a matching toc file and it should work.

  5. #5
    Deleted
    Nope, sadly that didn't work. Thanks for the suggestions though.
    I managed to do it using this code:
    Code:
    SlashCmdList['RELOADUI'] = function() ReloadUI() end
    SLASH_RELOADUI1 = '/rl'
    SLASH_RELOADUI2 = '/reloadui'
    
    SlashCmdList['RDYCHK'] = function() DoReadyCheck() end
    SLASH_RDYCHK1 = '/rdc'
    SLASH_RDYCHK2 = '/rc'
    In case anyone wants the whole, working "addon" i've uploaded it here:
    http://s000.tinyupload.com/index.php...34773782099620

    Regards,
    zora

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •