Allows you to create your own IF THEN statements that will dynamically change the function of a button.

This addon is intended for people that have a basic understanding of programming. Specifically conditional If-Then statements.

The addon allows you to write your own if-then statements that will be evaluated and run whenever you press a button, or they can trigger on certain events ingame.
It provides a simple text editor, a fully documented API and some simple If-Then syntax so that you can string together almost anything you want to react to.


IF HasOpenQuest("My daily fishing quest") AND InZone("Stormwind") 
THEN Cast("Fishing");
OnEvent("GroupInvite") AND InLFGQueue() 
THEN DeclineInvite() AND Reply("Sorry, I am already in the LFG queue");

Look at the FAQ page for the most asked questions, and the Examples page for examples.

Please post bugreports and feature requests on the Curseforge.com project page

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of Jarod24 Jarod24 Sep 08, 2016 at 09:31 UTC - 0 likes

    @b14d3r11: Go

    • There is no "abnormal" macro. IfThen just rewrites a macro.
    • You can NOT rewrite the macro when you are in combat: Read the FAQ.
    • Check the syntax on that PlayerPowerType(). All arguments must be in "quotes".
    • MacroStart() and MacroEnd() is if you want to define extra macros outside the default macro. See the help section in the addon. There is a whole page dedicated to this.
  • Avatar of b14d3r11 b14d3r11 Sep 08, 2016 at 04:06 UTC - 0 likes

    I am trying to figure out several things

    1. Does this work in conjunction with "normal" macros?
    2. Is this possible: "If less than 65% health then use Crimson Vial, or use Saberslash"
    3. A "base" string i edited apparently doesn't work? Looks like it should... OnEvent("TalentSpecChanged") AND InInstance() AND InGroup() AND PlayerPowerType(Mana) THEN Group("Wait a sec while i regen mana. I just switched talents.");
    4. I made a "macro" but i don't know if it will work correctly.. cause i can't get the /macro window syntax to match with IfThen's MacroStart("Finisher"); IF NOT HaveCooldown("Death From Above") THEN Cast("Death From Above") OR HaveCooldown("Death From Above") THEN Cast("Run Through"); MacroEnd();

    To answer some of my own questions and ask others. Number 4 doesn't technically work cause i guess you just inject the /cast ability into a macro before hand so... I guess it won't cast the counter argument ability cause it can't be edited in combat... I don't see why this is such a big deal but...

    Last edited Sep 08, 2016 by b14d3r11
  • Avatar of Jarod24 Jarod24 Aug 29, 2016 at 21:27 UTC - 0 likes

    @Killerkuh: Go

    Try using Emote() instead of RawMacro().

    Last edited Aug 29, 2016 by Jarod24
  • Avatar of Jarod24 Jarod24 Aug 29, 2016 at 21:25 UTC - 0 likes

    @Sexnonstop: Go

    Stack/Count is already there. Look at the documentation: HasBuff(BuffName, Unit, Count).

  • Avatar of Killerkuh Killerkuh Aug 29, 2016 at 19:27 UTC - 0 likes

    Got a Problem with RawMarco

    If i use RawMacro the first time the if statement is fulfilled it writes the macro in the Chat.

    Example: if IsTargeted("Chillkröté","Exact") then RawMacro("/run IFT() /spit");

    if i target myself it first writes "spit" in chat. if i use it a second time it correctly uses the /spit emote.

    Thats the macro that gets created. Its the same for the first and second use /run IFT() /spit

    IfThen V2.0.3

  • Avatar of Sexnonstop Sexnonstop Aug 29, 2016 at 19:22 UTC - 0 likes

    Hey! Great plugin. I have a question:
    Conditions 'HasBuff' convenient for simple situations, but unfortunately no checks count units on a certain aura.
    Is it possible to supplement the test conditions: how many stacks(count) specified buff?
    Thanks for the answer!

    Last edited Aug 29, 2016 by Sexnonstop
  • Avatar of Jarod24 Jarod24 Jul 15, 2016 at 18:37 UTC - 0 likes

    Version 2.0.0 is now released. This is for the Legion pre-patch (7.0.3).

    See the changelog for all the changes.

    Some of the functionality in version 2.0.0 has not yet been tested in depth since its not possible for me to do it on beta/ptr servers.

    This release focuses on making the addon work with Legion.
    After the expansion is released i might add legion-specific features (like variables for outputting Artifact level, Honor/Prestige etc). It all depends on how useful something might be.

  • Avatar of Jarod24 Jarod24 Aug 29, 2015 at 14:43 UTC - 0 likes

    @caelaran1: Go

    IF NOT InCombat() AND HasBuff("Stealth") AND IsTargeted() AND InRange("Pick Pocket") THEN Cooldown("2") AND Cast("Pick Pocket");
    IF NOT InCombat() AND HasBuff("Stealth") AND IsTargeted() THEN Cast("Ambush");
  • Avatar of caelaran1 caelaran1 Aug 28, 2015 at 18:40 UTC - 0 likes

    Can you please post a rogue pickpocket example that checks to ensure you are out of combat, picks the pocket, then runs Ambush?

  • Avatar of Jarod24 Jarod24 Aug 06, 2015 at 09:44 UTC - 0 likes

    @Knbob: Go

    Thanks for installing the addon.
    Yes; you will need to be pressing the button (the one you bound to the macro) for it to work.

    IfThen mixes two types of statements; IF and OnEvent(). The first you need to press the macro for. The latter is triggered when something happens ingame. These can not do any actions like cast or use but you might use them to play a sound, show a message etc.

    This is all described in the FAQ and on the forum pages.


Date created
Oct 06, 2011
Last update
Aug 29, 2016
Development stage
  • enUS
All Rights Reserved
Curse link
Recent files