IfThen

IfThen

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.

Examples:

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 Mar 26, 2015 at 16:01 UTC - 0 likes

    @loudwhitenoise: Go

    Like your story.
    I'm adding a HaveProfession() function in the next version. For now you could use HasItem(), HasName() or something like that

    There is as far as i know no way to determine if a mob is skinnable, except using tooltip scanning and that is a shaky method at best (mouseover or not, target tapped by player, localization etc), so i can't make a reliable IsSkinnable() function. Using %TargetCreatureType% is your best bet.

    Last edited Mar 26, 2015 by Jarod24
  • Avatar of loudwhitenoise loudwhitenoise Mar 24, 2015 at 21:54 UTC - 0 likes

    storytime: I wanted to print a reminder for any character that has skinning to remember to skin. I couldn't find anything that sees what profession skills I, the player, have. That might be a feature worth adding. I got around it by using HasItem("Skinning Knife"), which works ok as long as I'm not using a Gnomish Army Knife. Now to figure out how to get it to only show up for beasts and dragonkin... I tried Compare with %TargetCreatureType% and it looked great in theory... In practice, targets are deselected when they die so it doesn't really work as I hoped. Oh well.

  • Avatar of Jarod24 Jarod24 Mar 15, 2015 at 18:00 UTC - 0 likes

    @baldricinoz: Go

    It won't add a complete SetCVar() function since if you input an invalid console variable then you get a lua error returned.
    But i will add a function to directly control sound ingame in the next version.

    Right now however, you can use rawmacro to get the same effect.

    OnEvent("Zoning") AND InZone("Lunarfall") THEN PlayAudio("Ding") AND Print("Press to mute music") AND RawMacro("/run IFT() /script SetCVar(\"Sound_EnableMusic\",\"1\")");
    



  • Avatar of baldricinoz baldricinoz Mar 13, 2015 at 09:44 UTC - 0 likes

    Is it possible to expose the function SetCVar() as an action?  

    I'd like do stuff like control the sound when I zone i.e.:

    OnEvent("Zoning") AND InZone("Lunarfall") THEN SetCVar("Sound_EnableMusic",1);
    OnEvent("Zoning") AND NOT InZone("Lunarfall") THEN SetCVar("Sound_EnableMusic",0);

    I likes my jukeboxes (^8

  • Avatar of Jarod24 Jarod24 Feb 24, 2015 at 15:56 UTC - 0 likes

    Version 1.9.3 is now released. It supports Patch 6.1.0

    See the changelog for all the changes.

    Last edited Feb 24, 2015 by Jarod24
  • Avatar of Jarod24 Jarod24 Oct 13, 2014 at 14:11 UTC - 0 likes

    Version 1.9.1 is now released. It supports Patch 6.0.2 (Warlords)

    • New function: IsQuestCompleted()
    • The %GuildLevel% variable has been removed since guild levels are no more.
    • A few bugfixes.
    • The text-cursor should no longer jump around if you type non-english charaters (like ü, ë and so on) while Syntaxcoloring is enabled (reported by chamann81).

    See the changelog for all the changes.

  • Avatar of Jarod24 Jarod24 Mar 18, 2014 at 10:44 UTC - 0 likes

    @baldricinoz: Go

    Ok, version 1.9.0 now got %EnabledEquipmentSet% variable implemented.

    Last edited Mar 22, 2014 by Jarod24
  • Avatar of baldricinoz baldricinoz Mar 18, 2014 at 03:50 UTC - 0 likes

    Hello Jarod,

    Great addon, thanks for your hard work.

    Could we please have a variable for the name of the currently enabled equipment set? i.e. %enabledequipmentset%

  • Avatar of Jarod24 Jarod24 Mar 18, 2014 at 01:28 UTC - 0 likes

    Version 1.8.9 is now released with a few fixes and additions.

    • New function: IsAddonLoaded()
    • New variables: %BattleTag%

    See the changelog for all the changes.

  • Avatar of Jarod24 Jarod24 Oct 14, 2013 at 15:58 UTC - 0 likes

    Version 1.8.7 is now released.

    • IsBoss() has been improved and there is a new %BossName% variable.
    • New variables: %DeathName%, %DeathSpell%, %DeathAmount%, %DeathOverkill%
    • New functions: DBMPull(), IsClassified()

    See the changelog for all the changes.

Facts

Date created
Oct 06, 2011
Categories
Last update
Mar 28, 2015
Development stage
Release
Language
  • enUS
License
All Rights Reserved
Curse link
IfThen
Downloads
7,858
Recent files

Authors