Thread: Scripting help

  1. #1

    Scripting help

    Hi, i have a script that changes my spec each time i click the button and i was wondering how i can add to it so that it also shows/hides an addon. here is the script:

    /script if (GetActiveTalentGroup() == 2) then SetActiveTalentGroup(1); DEFAULT_CHAT_FRAME:AddMessage("Main Spec"); else SetActiveTalentGroup(2) DEFAULT_CHAT_FRAME:AddMessage("Off Spec"); end

    so basically i want to add /addonname show and /addonname hide so that it will hide/show whenever i change spec.

  2. #2

    Re: Scripting help

    If the addon supports toggle, just add the slash command on a new line after the /sript. Unless /script blocks that from happening? Don't know; don't use any script macros.

  3. #3

    Re: Scripting help

    Nope, /script is basically just like /cast only it lets you program some stuff in LUA.

    You should be able to add the toggle after the /script and it would work fine. If the addon doesn't support toggling, then you may have to find the parent name of the frame and hide/show that frame in the /script.

  4. #4

    Re: Scripting help

    Out of curiosity (sorry for slightly derailing this), why would you need a script like that? I never quite understood, what makes it any better than simply going 'N' and clicking the button?

  5. #5

    Re: Scripting help

    Quote Originally Posted by MushroomBomb
    Out of curiosity (sorry for slightly derailing this), why would you need a script like that? I never quite understood, what makes it any better than simply going 'N' and clicking the button?
    He can bind it. He can bind other stuff (like this) to it aswell.

    There are reasons why he could use it, there isnt really a reason why not to.

  6. #6

    Re: Scripting help

    Depends on what addon it is, for its toggle command. For Healbot you would just add

    /hb t

    Gershuun @ Borean Tundra US - Interface & Macros Moderator

  7. #7

    Re: Scripting help

    Specifying the addon itself would help.
    Some might have a toggle option through a slash command, and letting us know which one it is would help us find that.
    Quote Originally Posted by DeadmanWalking View Post
    Your forgot to include the part where we blame casuals for everything because blizzard is catering to casuals when casuals got jack squat for new content the entire expansion, like new dungeons and scenarios.
    Quote Originally Posted by Reinaerd View Post
    T'is good to see there are still people valiantly putting the "Ass" in assumption.

  8. #8
    Scarab Lord
    15+ Year Old Account
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    4,040

    Re: Scripting help

    I used to use a similar script for one-button swapping of spec and gearset.

Posting Permissions

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