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 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.

  • Avatar of Knbob Knbob Aug 05, 2015 at 20:17 UTC - 0 likes

    installed IfThen manually by unzipping into approp directory.
    could not get IF IsFalling() AND IsClass("mage") THEN Cast("Slow Fall");
    as only statement to work.
    installed Curse installer and used it to update the install.
    Still doesn't seem to work.
    I'm testing it by going up in a griffin then dismounting 500 feet up.
    First test killed my mage.  landed next to the bank in SWC.
    After that I test only over the deep water in the front moat of SWC.  :)
    My understanding is that IF the mage is falling then he/she should cast 'slow fall'.
    I have slow fall on my taskbar btw.
    but slow fall doesn't get cast unless i clk on the taskbar icon.
    Do I have the wrong assumption about how this is supposed to work?  If not, what am I doing wrong?

  • Avatar of Jarod24 Jarod24 Jul 09, 2015 at 21:06 UTC - 0 likes

    Version 1.9.7 released.

    • Screenshot() works again.
    • %InstanceDifficulty% support Mythic dungeon and Timewalking.
  • Avatar of Jarod24 Jarod24 Jun 28, 2015 at 18:39 UTC - 0 likes

    Update: Seems that patch 6.2.0 among other things broke the screenshot feature. I will look into it later this week (vacation).

  • Avatar of Jarod24 Jarod24 May 23, 2015 at 11:47 UTC - 0 likes

    @mcbobbo: Go

    Thanks for that well formatted code :-D
    The changes you made are added to version 1.9.6.

    If you find any more bugs in the future, don't hesitate to submit stuff.

  • Avatar of mcbobbo mcbobbo May 22, 2015 at 04:36 UTC - 0 likes

    @mcbobbo: Go

    Okay, so this seems to work....

    Modified Documentation.lua starting at 1204 to...

    	p[ARG]	=	{
    				"INT[1;400]",	"REQ{Value}    -Value to compare.",
    				"OP[]",		"OPT{OP}        -Comparison operator: @OP@.",
    				"STR[blood;unholy;frost;death;lunar;solar;combo]",	"OPT{Type}     -Runetype for DeathKnights: 'VAL{Blood}', 'VAL{Unholy}', 'VAL{Frost}', 'VAL{Death}'. Balance-type for Druids: 'VAL{Lunar}', 'VAL{Solar}', 'VAL{Combo}'. Ignored for other classes."

    And modified Methods.lua starting line 5273 like so:

    	elseif (strClass == "DRUID") then --For Druids we return balance, for other than balance spec it will return 0
    		local intActive	= GetActiveSpecGroup(false, false); --Returns 1 or 2 (Primary/Secondary)
    		local intSpec	= GetSpecialization(false, false, intActive); --Returns nil,1,2,3 or 4 (druids got 4th spec). Returns nil if the player isnt specced
    		--Balance (spec 1) is the only spec that uses Balance
    		if (intSpec ~= 1 and intSpec ~= 2) then return false; end --IfThen:msg_error("HavePowerPoints(): Current Druid spec do not have Balance or Feral.")
    		if (strType ~= "lunar" and strType ~= "solar" and strType ~= "combo") then
    			IfThen:msg_error("HavePowerPoints(): You must specify a type (lunar/solar/combo) when used with Druid class.");
    			return false;
    		if (intSpec == 1) then
    			intCurr = tonumber(UnitPower("player" , SPELL_POWER_ECLIPSE)); -- from [-100 Lunar to Solar +100]. WOD: Values change automatically as combat happens.
    			if (intCurr ~= 0) then --if its exactly 0 then just do the compare without looking at strType
    				if strType == "lunar" and intCurr > 0 then return false; end --Lunar are negative numbers
    				if strType == "solar" and intCurr < 0 then return false; end
    			end--if intCurr
    			if (intCurr < 0) then intCurr = intCurr *-1; end --Negate number
    		elseif (intSpec == 2) then
    			intCurr = tonumber(GetComboPoints("player")); end --WOD: Combopoints are now shared for all targets while in combat.

    This might not be the best way to do it, and at first I tried hooking into the Rogue section. But couldn't get that to work. Confirmed this, though, with some smoke testing.

  • Avatar of mcbobbo mcbobbo May 22, 2015 at 03:49 UTC - 0 likes

    @mcbobbo: Go

    Actually, I see it in the methods file. No the combo points only fires for the rogue class, and the druid section filters for balance.

    I think I can tweak it, though... Stay tuned.


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