Download
(227Kb)
Download
Updated: 01-31-17 10:31 AM
Pictures
File Info
Compatibility:
Shadows of Argus (7.3.0)
Updated:01-31-17 10:31 AM
Created:08-09-12 03:47 AM
Downloads:10,282
Favorites:60
MD5:
Categories:Miscellaneous, Discontinued and Outdated Mods

IfThen  Popular! (More than 5000 hits)

Version: 2.0.8
by: Jarod24 [More]

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:

Code:
IF HasOpenQuest("My daily fishing quest") AND InZone("Stormwind") 
THEN Cast("Fishing");
Code:
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.

Version 2.0.8 (2017-01-31) -Wow patch 7.1.5
BugFix:
  • OnEvent(UIError) will now trigger properly when inputting a text to match (reported by Louth).
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 2.0.7 (2016-11-09) -Wow patch 7.1.0
BugFix:
  • HaveTalent() will no longer cause lua error when PvP argument is omitted (reported by Spodi2290).
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 2.0.6 (2016-10-26) -Wow patch 7.1.0
General:
  • Updated .TOC for WOW patch 7.1.0
  • The morehelp window has been redesigned. This is due to UI-changes in patch 7.1 by Blizzard.
Removed functions:
  • DBMRange()
Updated functions:
  • HasBuff() now has an optional OP argument.
  • Added a shorthand alias to the PlayAudio() function: "Headless".
  • Report(), PlayerHasMoved() has updated documentation.
Updated variables:
  • %playerCoordinates%, %playerLocation% has updated documentation.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 2.0.5 (2016-10-07) -Wow patch 7.0.3
BugFix:
  • HasBuff() will now also work with capitalized or uppercase input.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 2.0.4 (2016-09-29) -Wow patch 7.0.3
Updated functions:
  • HasBuff() will now return true if your target has an buff/debuff/aura/ability on them with the specified name. It will not consider the harmful/helpful nature of it (reported by yoloswaggger).
  • Report() no longer support "debuff" argument. Use "buff" instead.
Removed funcions:
  • HasDeBuff() is merged with HasBuff().
BugFix:
  • Fixed some typos in the documentaion.
  • Macro should now change to the correct icon when used with ClickActionBar()
  • Fixed lua error in Methods:isInstanceInEncounterJournal()
  • Methods:getNPCNameFromGUID() will no longer print diagnostic info.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 2.0.3 (2016-08-29) -Wow patch 7.0.3
New events:
  • LevelUp (request by Cecile_Curse)
New functions:
  • SetTitle()
  • SummonMount()
  • SummonPet()
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 2.0.2 (2016-08-11) -Wow patch 7.0.3
New functions:
  • OpenTradeSkill()
  • CloseTradeSkill()
  • IsTradeSkillReady()
  • Craft() allows you to craft an item (request by TaraNTino).
BugFix:
  • IfThen macro will now update its icon properly.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 2.0.1 (2016-08-04) -Wow patch 7.0.3
General:
  • Improved clicking a quest/achievement in the objectives tracker while the edit window is open to copy it's name.
  • LibDataBroker integration updated to show tooltiptext and use textureID's instead of texture-strings.
BugFix:
  • IfThen macro will now update its icon properly when using Toybox items. This is a workaround for a Blizzard bug.
  • DBMRange() works again.
  • InWorgenForm() works again. You can now also get a result when targeting NPC's.
  • IsTapped() works again.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 2.0.0 (2016-07-15) -Wow patch 7.0.3
General:
  • Updated .TOC for WOW patch 7.0.3
  • Removed support for Voice Encounter Mods (VEM).
  • Removed support for glyph links.
  • FAQ.txt and Examples.txt updated.
  • You can now click on a quest/achievement in the objectives tracker while the edit window is open to copy it's name.
New functions:
  • IsCurrentSpec() replaces IsCurrentTalentSpec() that has been removed.
  • EnableSpec() replaces EnableTalentSpec() that has been removed.
Updated functions:
  • Print() and RaidMessage() now supports 'DemonHunter' as a color argument.
  • IsClass() added 'Demonhunter' as an input argument.
  • HasPower() rewritten and merged with HavePowerpoints().
  • HaveTalent() added an optional PvP-agument to check for Honor talents.
  • Report()
    • Removed "health" and "power" options.
    • Documentation page does no longer show the "pvpgear" info. This feature was removed back in version 1.9.3
Updated variables:
  • %playerpowertype%, %targetpowertype%, %focuspowertype%, %petpowertype% should now support powertypes for all classes.
Removed functions:
  • HaveGlyph() since glyphs are no longer in game.
  • IsCurrentTalentTree()
  • IsCurrentTalentSpec() is removed. Use IsCurrentSpec() instead.
  • EnableTalentSpec() is removed. Use EnableSpec() instead.
  • HavePowerPoints() is removed use HasPower() instead.
BugFix:
  • Print(), Message() and RaidMessage() will now show raid marker icons instead of text strings.
  • ClickActionBar() now works as it should with "Extra" as input argument.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.9.9 (2016-03-23) -Wow patch 6.2.4
General:
  • Updated to support changes in Battle.net's infrastructure.
  • Removed CHAT_MSG_BN_CONVERSATION since support for conversations has been removed.
Bugfix:
  • Reputation lookup should no longer output debug strings in chat.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.9.8 (2015-08-21) -Wow patch 6.2.0
New functions:
  • InWorgenForm() returns true/false if you are a worgen (race) thats currently in worgen-form (request by rui).
Bugfix:
  • Reputation lookup for Bodyguards/Friends should work again.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.9.7 (2015-07-09) -Wow patch 6.2.0
General:
  • Updated .TOC for WOW patch 6.2.0
Updated variables:
  • %InstanceDifficulty% now works with the new Timewalking and Mythic dungeon difficulty settings.
Bugfix:
  • Screenshot() function is now working again.
  • Syntaxcoloring should now close windows when toggeled on/off.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.9.6 (2015-05-23) -Wow patch 6.1.2
Updated functions:
  • HavePowerPoint() now supports combo-points for Druids in Feral spec (code provided by mcbobbo).
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.9.5 (2015-03-28) -Wow patch 6.1.2
New functions:
  • SetSound() Enable/Disable all sound, effects or music ingame (request by baldricinoz).
  • HaveProfession()
Updated functions:
  • IsMuted() input argument 'both' removed. Now support 'all' so it's consistent with SetSound().
Bugfix:
  • Will no longer output debug info from LFG_LIST_APPLICATION_STATUS_UPDATED.
  • The edit and morehelp window will no longer hide behind other windows just by mousing over another frame.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.9.4 (2015-02-27) -Wow patch 6.1.0
Bugfix:
  • Will no longer cause taint-error from the Blizzard_SocialUI.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.9.3 (2015-02-24) -Wow patch 6.1.0
General:
  • Updated .TOC for WOW patch 6.1.0
  • Keybindings are now found under the "Addons" category instead of "Other".
Updated events:
  • LFGInvite will now also trigger on invitations from the Premade groups tool.
Updated functions:
  • PlayAudio() added a few sounds like Hans'gars "I'll be back".
  • Report() will now query the server for the latest savedinstance info before outputting data.
  • InLFGQueue() does no longer support 'lfr' and 'flex' as input arguments since these are no longer ingame.
New functions:
  • StopAllSound()
Removed functions:
  • HavePVPEquipped()
  • Report() does no longer support the "pvpgear" option.
New variables:
  • %StatToys%
Bugfix:
  • PlayAudio() All shorthand aliases for soundfiles are now working again (pointed to .wav instead of .ogg).
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.9.2 (2014-10-26) -Wow patch 6.0.2
Bugfix:
  • IsQuestCompleted() will no longer crash.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.9.1 (2014-10-13) -Wow patch 6.0.2
General:
  • Updated .TOC for WOW patch 6.0.2
  • Many internal Blizzard functions have got their return values changed from 0/1/nil into true/false.
  • Functions that hook into 'Deadly Boss Mods' (DBM) will now also work with 'Voice Encounter Mods' (VEM): DBMRange(), DBMTimer(), DBMPull(), %BossName%, IsBoss()
  • Shift clicking a quest in the questlog or objectives tracker is removed. It will no longer paste the questname into the text editor.
Updated functions:
  • HaveCritter() will now return true only if a critter is summoned.
  • IsFlyableArea() - Even though the function can return true. You as a player might not be able to fly in the area. That is dependent on your flying skill ability among other things.
New functions:
  • IsQuestCompleted()
Updated variables:
  • %InstanceDifficulty% now also returns "Mythic" as a possible value.
  • %PlayerMark%, %TargetMark%, %FocusMark% and %PetMark% will now appear correct in chat with non-english clients.
Removed variables:
  • %GuildLevel% has been removed since guild levels are no more.
Bugfix:
  • HasTempWeaponEnchant() should now work for offhand enchants.
  • 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).
  • Fixed error when OnEvent's were disabled.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.9.0 (2014-03-23) -Wow patch 5.4.7
New variables:
  • %EnabledEquipmentSet% (request by baldricinoz)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.8.9 (2014-03-18) -Wow patch 5.4.7
Bugfix:
  • The events Chat(), GroupInvite() and RoleCheck() will not require their "Player" argument to be written in the "Playername-Servername" format to be correctly matched. "Playername" is enough.
  • Messages about "Deadly Boss Mods" not loaded at login/reload should no longer appear if you have the addon installed, but disabled.
New functions:
  • IsAddonLoaded()
New variables:
  • %BattleTag%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.8.8 (2013-10-16) -Wow patch 5.4.0
Bugfix:
  • Fixed error regarding DBM's SetMainBossID() function after doing a /reload while inside a raid instance.
  • %BossName% should no longer sometimes return the string 'worldboss'.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.8.7 (2013-10-14) -Wow patch 5.4.0
New functions:
  • DBMPull() - Start a DBM pull-timer.
  • IsClassified() - Lets you check the classification of a unit (worldboss, rare, elite etc).
Updated functions:
  • ClickActionBar() - The code will now try to use the icon for the specified button instead of the default IfThen icon.
  • IsBoss() - Argument is now optional. Will now also check unitname against the enounter journal and DBM like %BossName% does.
New variables:
  • %BossName% - The name of the boss you are currently in combat with (request by 0xygen).
  • %DeathName%, %DeathSpell%, %DeathAmount%, %DeathOverkill% - The name, ability and amount of damage that last killed the player (request by 0xygen).
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.8.6 (2013-09-17) -Wow patch 5.4.0
General:
  • Removed backwards-compatible code for patch 5.3.0
Bugfix:
  • Report() now reacts to the "all" keyword as before when asking about saved instances.
  • Report() will only output titles for party-dungeons since their links are trashed by the chat system (raid will still output links)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.8.5 (2013-09-09) -Wow patch 5.4.0
General:
  • Updated .TOC for WOW patch 5.4.0
  • Some of the changes will only be visible when running version 5.4.x of WoW.
New functions:
  • InDigsite()
  • InWargame()
Updated functions:
  • Report() - Added a "world" argument for the "savedinstance" option. This will list all world-bosses you have killed.
  • InLFGQueue() - Added "flex" as an argument.
  • Added a few more shorthand aliases to the PlayAudio() function. "Ding", "Heads roll", "Not prepared", "Bonestorm", "You fail".
Updated variables:
  • %InstanceDifficulty% can now also return "Heroic Scenario" and "Flexible".
Bugfix:
  • %InstanceDifficulty% should now return the correct difficulty (Normal/Heroic) for your current instance.
  • Fixed various "See also" links in documentation that should now point to the correct page.
Code optimizations:
  • Changes made to Documentation & Parsing that should reduce memory footprint of the addon (about 3KB less).
  • Merged some identical event-handlers to reduce memory footprint even more.
  • Rewritten event handlers to no longer wrap arguments into tables. This should reduce memory consumed at runtime.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.8.4 (2013-06-07) -Wow patch 5.3.0
General:
  • Removed the "PlayAudio" window. This feature is now embedded in the documentation page for PlayAudio().
Documentation:
  • The documentation page of PlayAudio() will now list all shorthand aliases with clickable links to play the sounds.
Bugfix:
  • Addon will no longer trigger errors due to tainting Blizzards UIDropDownMenu (reported by Caraxe).
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.8.3 (2013-06-01) -Wow patch 5.3.0
New events:
  • Added "DuelStart" and "DuelEnd" that is triggered when a duel is requested or finished (requested by Camocanine).
New functions:
  • DuelAccept(), DuelDecline().
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.8.2 (2013-05-20) -Wow patch 5.3.0
General:
  • Updated .TOC for WOW patch 5.3.0
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.8.1 (2013-04-25) -Wow patch 5.2.0
New variables:
  • %StatUniquePets% -Number of unique pets your character has.
Bugfix:
  • Fixed bug in getEquippedItems() that caused a LUA error when calling related functions (like Report() %itemlevel% and so on) when zoning into instances.
Documentation:
  • Updated the text for the events "Casted" and "Casting". There is no change in the underlying events just a clarification in the documentation.
  • "Casted" will trigger on the start of (and sometimes during) channeled spells, and at the end of non-channeled spells.
  • "Casting" will trigger on the start of non-channeled spells.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Version 1.8.0 (2013-03-05) -Wow patch 5.2.0

General:
  • Updated .TOC for WOW patch 5.2.0
Bugfix:
  • HaveCooldown() should be less prone to return true for spells because of the global cooldown.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Version 1.7.9 (2013-02-07) -Wow patch 5.1.0

General:
  • Search-results in the edit window are now clickable. You will then be taken to the documentation page for the function or variable you selected.
  • You can now click on a function listed under the "See also" section of the documentation to jump directly to that function.
  • Parser errors are now clickable. It will take you directly to the page and line number in question.
  • Parser will now output page and linenumber for lines that fail to parse properly. The parser will also output all errors under a single error-header.
  • Added a new 'LineNumber' feature. When enabled it will show linenumbers in the editor.
  • 'Search & Highlight' now displays number of matches found in a better positioned label.
  • Parsing of the raw text will now be suspended until after combat ends. This is to prevent "Script ran too long"-errors with large volumes of text.
  • Addon now supports resolving battlepets-hyperlinks like [battlepet:Cinder Kitten].
New functions:
  • IsHostile() -Is your current target hostile towards you
Updated functions:
  • RaidMessage() -Function will now only color the string you input and not the whole RaidMessageFrame.
  • Report() -Friendship reputations will now output the localized name for the current rank.
Updated events:
  • "Chat" event now also supports "system" to trigger on system messages (requested by Delvai).
Code optimizations:
  • Internal tooltip scanning code will now cache its results for faster lookup of items.
BugFix:
  • Report() will now calculate the correct itemlevel if you only got offhand equipped or 2 weapons.
  • When resolving achievement-hyperlinks the addon will now also try to lookup the achievement using the name specified and not just the ID.
  • When resolving currency-hyperlinks, the addon will first try any ID specifed before using the name.
  • When resolving talent/glyph-hyperlinks, the addon will look in the list of your characters talents/glyphs.
  • Syntaxcoloring will no longer color strings inside quotes as functions. For example RawMacro("/run IFT() /say hello world").
  • Parser will now accept If-Statements with multiple spaces between keywords (THEN, OR, NOT, AND) even when the keywords are in lowercase.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Version 1.7.8 (2012-12-07) -Wow patch 5.1.0

Bugfix:
  • %Itemlevel%, %ItemlevelTotal% and Report() will now calculate the correct itemlevel numbers even with items that are transmorgified or upgraded (credit to Phanx for pointing me in the direction of a solution).
  • Special thanks to Cassiopea-Doomhammer(EU) for helping me out with the testing ;-]
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Version 1.7.7 (2012-11-28) -Wow patch 5.1.0

General:
  • Updated .TOC for WOW patch 5.1.0
  • Added a new searchbox to search and highlight text in the Edit window.
  • Fixed some typos in the documentation.
  • The battleground channel (/bg, /battleground) has been removed from the game. All functions that supported this like Chat(), Report() etc no longer does so.
New events:
  • Added "LostControl" that is triggered when you lose control of your character due to interrupts, root etc.
New functions:
  • HaveLostControl() -Will return true/false if you currently have lost control of your character.
  • InInstanceGroup() -Will return true/false if you are in an instance group (i.e. /instance).
Updated functions:
  • InGroup() -Will now also check if you are in an instancegroup (/instance).
  • Group() -Will now send chat messages to /instance if you are in an instance group.
  • Chat() -Now supports "Instance" as channel argument.
  • Report() -Updated how friendship reputation and rank is calculated due to changes in the Blizzard API.
  • HavePowerPoints() -Blizzard renamed a variable used with the Monk Chi from SPELL_POWER_LIGHT_FORCE to SPELL_POWER_CHI.
Updated variables:
  • %StatPets% will now output the number of pets as reported in your petjournal instead of from the statistics-page.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Version 1.7.6 (2012-11-04) -Wow patch 5.0.5

New functions:
  • IsIndoors() (requested by flabby)
  • IsModifierKeyDown() (requested by flabby)
Updated variables:
  • %instancedifficulty% will now return "Scenario" instead of "Normal" when you are in a scenario.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Version 1.7.5 (2012-10-30) -Wow patch 5.0.5

Code optimizations:
  • Reworked the code that periodically invokes garbage collection. This will hopefully reduce the occurence of "script ran too long" errors.
New functions:
  • ClickActionBar()
  • ExtraActionBarVisible()
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Version 1.7.4 (2012-10-21) -Wow patch 5.0.5

General:
  • Added a few more lines in examples.txt for use with daily quests in Pandaria.
Updated functions:
  • CancelAura() -The function no longer uses the macro to cancel auras/buffs. It will therefore be possible to combine CancelAura() with UseItem() or Cast() in a single if-statement (credit to Doskious).
  • Report() -The 'experience' option will now round outputted numbers and use a a 'K/M' notation.
Updated variables:
  • The following variables will now will now round outputted numbers and use a a 'K/M' notation. Their internal datatype has also been changed from 'number' to 'string'.
  • %playerhealth%, %targethealth%, %focushealth%, %pethealth%, %playermaxhealth%, %targetmaxhealth%, %focusmaxhealth%, %petmaxhealth%
  • %playerpower%, %targetpower%, %focuspower%, %petpower%, %playermaxpower%, %targetmaxpower%, %focusmaxpower%, %petmaxpower%
BugFix:
  • ToggleRaidDisplay() -This function will not work when you are in combat because the Raidframe UI is then marked as protected by Blizzard (credit to Henrick).
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Version 1.7.3 (2012-10-13) -Wow patch 5.0.5

General:
  • Added a new 'EasyCast' feature. When enabled it will trigger the default IfThen-macro when you are out of combat and do a double right-click.
  • You can now shift-click on items/quests/achievements while the edit window is open and it will insert the link-title (just like auctionhouse search).
  • Added several lines in examples.txt for use with daily quests in Pandaria.
New functions:
  • QuestItemInRange()
  • MouseOver() -Same as IsTargeted() but looks at whats under your mouse cursor (idea from Theondry)
Updated functions:
  • UseQuestItem() -Argument is now optional. Will use the first found questitem from tracked list if omitted.
  • IsTargeted() -Added a optional 'match' argument to allow partial matches on names.
New variables:
  • %MouseOverName% -Name of the npc/player/item currently moused over.
BugFix:
  • InRange() can now be found when using the searchboxes.
  • GetQuest feature will now complete quests that only have 1 quest reward as expected.
  • Report() will no longer crash and will properly output friendship reputations.
  • Color feature will no longer start duplicating text or remove newlines if you write a comment with no spaces in it (#;)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Version 1.7.2 (2012-09-24) -Wow patch 5.0.5

Updated functions:
  • InInstance() now supports 'scenario' as an argument.
Updated variables;
  • %InstanceDifficulty%, and %InstanceType% will now return 'Scenarios' or 'Challenge mode'.
  • %GuildLevel% now has a range of 0-25
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Version 1.7.1 (2012-09-15) -Wow patch 5.0.5

General:
  • Added a new 'Color' feature. When enabled it will apply syntax coloring to the editor and examples in documentation.
  • With the introduction of syntax coloring, several of the colors used in the documentation have been changed to better match this new feature.
  • Required arguments are now yellow and optional arguments are purple (formerly blue and yellow).
  • Fixed values are now teal (formerly green).
  • The variables section in the morehelp window now uses a separate color to differ it from the arguments, actions and events sections.
Updated functions:
  • HasCooldown() has been renamed to HaveCooldown()
BugFix:
  • IfThen will now display a error message if your macro-list is full (credit to 'rwthomas111' for this one).
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Version 1.7.0 (2012-09-04) -Wow patch 5.0.4

You can now separate IF-statements to run under different macros. Use the new MacroStart() and MacroEnd() functions (idea by balzakbr).
See the new 'MacroStart' section in '/ifthen morehelp' for more info.

General:
  • Added a searchbox to the Edit window. You can press TAB to jump between searching and editing.
  • Added a searchbox to the Morehelp window.
  • Added a new 'Minimal' feature. When enabled it will remove almost all the documentation from memory to reduce the addons footprint (about 20KB smaller).
  • Parser will now only print the first few possible values for an argument when it failes. This way you won't get insanely long error messages.
  • Updated FAQ with more questions and answers regarding macros and combat.
  • Updated Examples with renamed function names.
Bugfix:
  • Running both Countdown() and StopWatchStart() at the same time will no longer yield strange results.
  • HaveCritter() and HaveMount() functions are now working properly.
Updated functions:
  • Report() now support 'experience' as a type to output your current level and points needed for the next.
  • HasCritter() has been renamed to HaveCritter()
  • HasGlyph() has been renamed to HaveGlyph()
  • HasMount() has been renamed to HaveMount()
  • HasOpenQuest() has been renamed to HaveOpenQuest()
  • HasPet() has been renamed to HavePet()
  • HasTalent() has been renamed to HaveTalent()
New functions:
  • HaveAchievement()
  • HaveDurability()
  • Screenshot()
  • Emote() (idea from xzoner)
  • SetFlag() and Flag() -You can set and check the value of your own internal variables with these functions.
New events:
  • Added "Achievement" event that is triggered when you earn an achievement.
Updated variables:
  • %InstanceDifficulty% now returns 'Raid Finder' when you are in Dragon Soul LFR.
New variables:
  • %WatchedFactionName% -Name of the faction shown on the experience bar.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Version 1.6.4 (2012-08-29) -Wow patch 5.0.4

General:
  • Updated .TOC for WOW patch 5.0.4
  • Removed backwards-compatible code for patch 4.3.3
Updated functions:
  • RawMacro() now lets you specify a optional MacroName argument to let you write to other macros (idea from balzakbr).
New events:
  • Added "PVP" event that is triggered when your pvp-flag is changed.
Bugfix:
  • "AfkOrDnd" event is now only triggered when the player is Afk or Dnd and not other events.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Version 1.6.3 (2012-08-25) -Wow patch 4.3.4 / MOP Beta 5.0.x

Bugfix:
  • HavePowerPoints() will no longer return strange values for Priests and Warlocks when running on patch 4.3.4
  • Warlocks no longer need to specify a type (Shard/Demonic/Ember). The code now infer this from your current spec.
  • Monks, Priests (Shadow Orbs) and Warlock's (Demonic Fury/Burning Embers) will be automatically available when running on patch 5.0.x
  • For all other classes and specs that dont have a secondary powertype (Holy Priest and Mages for example) the function will return false.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Version 1.6.2 (2012-08-25) -Wow patch 4.3.4 / MOP Beta 5.0.x

General:
  • All windows can now be moved around by dragging the top of the window.
  • Removed all references to the 'Debug' option.
  • Examples.txt now got a few examples for Rogues.
  • Updated FAQ with more questions and answers.
Code optimizations:
  • Addon should now start up about 1 millisecond faster on average.
  • Added local pointers for global functions. This should reduce time used on global lookups while running.
  • MacroRefresh feature now uses the new RegisterUnitEvent() to reduce overhead.
Bugfix:
  • Macro will now properly reset to doing nothing if your current executing line dont touch the macro.
New functions:
  • HavePowerPoints() -Lets you check your character's combo-points/chi/balance/rune/holy power/soul-shards/burning-embers (added after request by Pekesino).
  • RawMacro() -Let you output the full raw text to put in the IfThen-Macro (added after request by NeerDeth).
New variables:
  • %LocalTime%, %LocalTime12%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Version 1.6.1 (2012-08-12) -Wow patch 4.3.4 / MOP Beta 5.0.x

General:
  • Added LibDataBroker support.
  • IfThen now add launcher shortcuts for the 'Edit' and 'MoreHelp' windows for databroker compatible addons like TitanPanel, ChocolateBar, Bazooka and so on.
  • You can now configure IfThen through a new interface panel (Game menu -> Interface -> AddOns tab). It has the same effect as using the slash commands (/ifthen or /ift).
  • Switched to using a new button template. The buttons should now look a bit better.
Updated functions:
  • Report() now returns the proper masculine/feminine form for reputation titles depending on your characters gender (%Report% variables).
  • Added support for friendship titles (basically single-Npc factions).
New functions:
  • IsTapped()
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


Version 1.6.0 (2012-08-01) -Wow patch 4.3.4 / MOP Beta 5.0.x

Updated IfThen to work with Mists of Pandaria (MOP) expansion. Many of the game's internal events and functions have been altered, removed or new ones have been added by Blizzard.
  • Some of the changes will only be visible when running version 5.0.x of WoW (The MOP Beta).
  • The .TOC interface number is still that of 4.3.3 to prevent 'Load out of date addons' issues for users on live servers.
  • Added support for the Pandaren monk class. Class color, etc.
  • Things like %GuildLevel% (0-25) and %PlayerLevel% (1-85) will auto-adjust (0-30 & 1-90) when running version 5.0.x of the game.
General:
  • Updated examples.txt with the correct function name "HavePVPEquipped()"
  • The addon will now check and close the existing edit/help window if its open before opening the other window when using slash commands instead of the buttons.
  • Removed hardcoded internal lists used for currencies and factions. It will now use a search-and-cache approach that seems to give the same performance.
New functions:
  • UseQuestItem() Will /use the item that is associated with a quest in you questlog
  • IsStealthed()
  • IsFalling()
  • HasCritter() Do you have a non-combat pet summoned
  • HasMount()
  • InBGQueue() Are you currently in a Battleground queue
  • HasTalent() -New with MOP beta
  • HasGlyph() -New with MOP beta
  • InPetBattle() -New with MOP beta
Updated functions:
  • HavePVPEquipped() is now aware of the new "PvP Power" stat that is introduced with MOP.
  • InLFGQueue() (in WoW 5.0.x) now has an optional 'Type' argument that lets you filter what queue you want to check for (Dungeon finder, Raid finder, Pet-Battles etc).
  • IsChanneling() now supports a new, optional Unit-argument that can be 'target', 'focus' or 'player' (default).
  • InStance() will now work properly with localized versions of the game. However it now requires you to type the exact, localized name of the stance: "Bear Form", "Bärengestalt", and so on.
New variables:
  • %PlayerGold%, %GuildLevel%, %GuildAchievementPoints%, %CritterName%, %MountName%, %PVPTimer%
Updated variables:
  • %PlayerFaction%, %TargetFaction% and %FocusFaction% can return 'Neutral' in some cases in addition to 'Alliance' and 'Horde' (like when you are a level 1 Pandaren).
  • %EquipmentRanged% will disappear when running version 5.0 of the game since the ranged/relic slot no longer exists.
New events:
  • Added "PetBattleStart" and "PetBattleEnd" events that will trigger on the start and finish of pet-battles introduced with MOP.
Updated events:
  • "LFGInvite" event now also triggers when queued for pet-battles.
Bugfix:
  • Chat() will no longer fail when using 'Emote' as an channel-argument.
  • IsMuted() will now properly default to using the 'both' argument if nothing is inputted instead of crashing.
  • "SpellCheck" is now working as intended. Remember "/ifthen spellcheck" to enable.
  • "ItemUnEquipped" event should now trigger correctly.
  • Parser will no longer crash if you only have "ItemEquipped" events but no "ItemUnEquipped" in your raw text.
  • Fixed a bug that caused the parser to not run "ItemEquipped" events if you also didn't have any "ItemUnEquipped" events in your raw text.
  • HasBuff() and HasDeBuff() will now work even if the stackcount returned by the game is 0 (?!).
  • Using "/ifthen onevent" to disable OnEvent()-statements will now properly unregister all of its background events (like those used by chat).
-----------------------------------------------------------------------------------------------------------------------------------------------------------------


For complete list of changes, go here: http://wow.curseforge.com/addons/ift...es/change-log/
Post A Reply Comment Options
Unread 12-07-12, 09:11 PM  
Zathan666
A Murloc Raider
AddOn Author - Click to view AddOns

Forum posts: 6
File comments: 64
Uploads: 4
Balance DoTs

Anyone know if it would be possible with this addon to make a macro to automatically change a castsequence depending on current eclipse state (for balance druids)?

For example, if I'm in Lunar eclipse, I would like my mousebutton5 macro to do:
/castsequence reset=target/combat/5 Sunfire, Moonfire

and if I'm in Solar eclipse, I would like my mousebutton5 macro to do:
/castsequence reset=target/combat/5 Moonfire, Sunfire
Report comment to moderator  
Reply With Quote
Unread 10-15-12, 04:54 PM  
Jarod24
A Theradrim Guardian
AddOn Author - Click to view AddOns

Forum posts: 66
File comments: 26
Uploads: 5
Re: Re: Re: Valid Macro Implementation not working

Originally Posted by Doskious
...
Thanks very much for the reply. I did try the RawMacro call, but neglected to include the "/run IFT()" clause in the RawMacro text, which is likely why it was removing that line. When I tried this, though, the line failed to execute at all. I think it would have resulted in an infinite loop issue, where the first line of "/run IFT()" results in a re-invocation of the IFT() script, and since the preconditions for the line would still be true (because the /cancelaura command wasn't issued yet), the loop would be reset and the RawMacro method reapplied, and it would execute the "/run IFT()" line again, so it was prevented from running.

I tried to add in a custom variable check, which worked flawlessly:

Button Press Line:
IF HasBuff("Goblin Glider") AND HaveGlyph("Falling Meteor") AND HavePowerPoints("50", "gt") AND NOT Flag("Landing","true") THEN SetFlag("Landing","true") AND RawMacro("/run IFT\(\)\; /cancelaura Goblin Glider /cast Demonic Leap");

OnEvent Line:
# Demonic Leap Landing Flag;
OnEvent("Casted","Demonic Leap") AND Flag("Landing","true") THEN SetFlag("Landing","false");

Thanks very much for your help!

You should use Cooldown() instead of SetFlag().


It should not make a infinite loop. When you press a button the following is what happens;
1. line 1 is executed (/run ift() )
2. the script rewrites the macro
3. line 2,3,5 etc is executed (it does not start from the top again)


You can add "#showtooltip" in RawMacro() as the first line btw to change the icon.
__________________
Author of IfThen, Links in Chat
Last edited by Jarod24 : 10-15-12 at 04:57 PM.
Report comment to moderator  
Reply With Quote
Unread 10-14-12, 02:44 PM  
Doskious
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 14
File comments: 12
Uploads: 1
Re: Re: Valid Macro Implementation not working

Originally Posted by Jarod24
Thanks for the feedback man.

This is not a bug, but how its intended to work. The addon is with regards to this stateless; meaning it has no knowledge of events past. Therefore it would not know that on the first press then it should edit the macro (with 2 statements in it) but on subsequent calls to /run IFT() it should leave it alone. Since anything could happen between buttonpress-es then there is no way to reliably implement such a thing.

However; i've looked into the behaviour of /cancelaura specificly in macros and it seems that Blizzard does allow /cancelaura to be executed on the same buttonpress as a subsequest /use or /cast and i will look into implementing that in a later release.

For now: You can put multiple useitem/cast inside a IF-statement. However only the last one will be put in the macro. So you could use RawMacro() function or make two statements; First for cancelaura and the second one to cast demonic leap.

Here is my suggestion for this:
Code:
IF HasBuff("Goblin Glider") AND HaveGlyph("Falling Meteor") AND HavePowerPoints("50", "gt") THEN RawMacro("/run IFT() /cancelaura Goblin Glider /cast Demonic Leap");
Here is an alternative where you need to press the macro twice:
Code:
#First buttonpress -Will do cancelaura and then set the variable 'falling' to true;
IF HasBuff("Goblin Glider") AND HaveGlyph("Falling Meteor") AND HavePowerPoints("50", "gt") AND NOT Flag("Falling", "true") THEN SetFlag("Falling", "true") AND CancelAura("Goblin Glider");
#Second buttonpress -If the variable 'falling' is true then reset the variable and cast demoic leap;
IF Flag("Falling", "true") THEN SetFlag("Falling", "false") AND Cast("Demonic Leap");

When it comes to the keybind stuff you mentioned then yes; you can bind a key/mousebutton to run the macro. IfThen itself even allows you to do that. It's listed in the keybindings section.

This is however in the background identical to dragging a key to a hotbar and it will still be limited by the "cant change macro while in combat" that most people are asking about. The new easycast feature added in 1.7.3 also runs the default macro when you double right-click on the screen.


If the text is outputted in chat; make sure you dont have any typos in the spell's names.
Thanks very much for the reply. I did try the RawMacro call, but neglected to include the "/run IFT()" clause in the RawMacro text, which is likely why it was removing that line. When I tried this, though, the line failed to execute at all. I think it would have resulted in an infinite loop issue, where the first line of "/run IFT()" results in a re-invocation of the IFT() script, and since the preconditions for the line would still be true (because the /cancelaura command wasn't issued yet), the loop would be reset and the RawMacro method reapplied, and it would execute the "/run IFT()" line again, so it was prevented from running.

I tried to add in a custom variable check, which worked flawlessly:

Button Press Line:
IF HasBuff("Goblin Glider") AND HaveGlyph("Falling Meteor") AND HavePowerPoints("50", "gt") AND NOT Flag("Landing","true") THEN SetFlag("Landing","true") AND RawMacro("/run IFT\(\)\; /cancelaura Goblin Glider /cast Demonic Leap");

OnEvent Line:
# Demonic Leap Landing Flag;
OnEvent("Casted","Demonic Leap") AND Flag("Landing","true") THEN SetFlag("Landing","false");

Thanks very much for your help!
Report comment to moderator  
Reply With Quote
Unread 10-14-12, 03:52 AM  
Jarod24
A Theradrim Guardian
AddOn Author - Click to view AddOns

Forum posts: 66
File comments: 26
Uploads: 5
Re: Valid Macro Implementation not working

Originally Posted by Doskious
So I really like the idea of this addon. For all but one thing I've tried to do with it, it's performed marvelously.

The thing I'm trying to do, however, is ... well, not working.

I play a Warlock Engineer. I have the Goblin Glider tinker and have glyphed Falling Meteor, both to ensure that no matter how far I have to fall, I'll survive. The thing is, sometimes the Glider takes me further forward than where I want to go. I'm using the addon in part as a panic button macro for when I'm falling (across multiple characters) and I thought it would be nice if I could implement the following functionality:

Code:
IF HasBuff("Goblin Glider") AND HaveGlyph("Falling Meteor") AND HavePowerPoints("50", "gt") THEN CancelAura("Goblin Glider") AND Cast"(Demonic Leap");
And when used in that particular fashion, once I've deployed the glider, pressing the button does result in my character halting forward motion, and activating Demonic Leap. The process doesn't seem to properly cancel the Glider, though (which results in a very slow descent with both the Meteor and the Glider graphics active, which looks silly), and also causes "Goblin Glider" to be output into my active chat channel, which doesn't seem to be intended by any of the LUA code for the addon that I've reviewed.

While I did note your documentation calls for CancelAura() and Cast() calls to each be "the final statement on the line", I have verified that the Macro:

Code:
/cancelaura Goblin Glider
/cast Demonic Leap
works flawlessly to cancel my Glider and then activate the rapid descent via Falling Meteor, when invoked as an independent freestanding macro.

Finally, oddly, the IfThen macro body is entirely overwritten (rather than simply appended) to be:

Code:
/cancelaura Goblin Glider
/cast Demonic Leap
rather than what I would expect:

Code:
/run Ifthen();
/cancelaura Goblin Glider
/cast Demonic Leap
(Subsequent invocations of the IfThen Macro itself, under the right circumstances, do seem to execute proper macro invocation, resulting in the cancellation of the aura and the rapid descent from the leap.)

Any assistance or insight you could offer would be most appreciated, as I'd very much like to have only one button to press for control over my descent from arbitrarily high altitudes.

In passing, I'd like to note in response to the assertion (made on the Curse comments) that the only way to invoke a macro is via Toolbar-based Action Buttons is not strictly correct, as addons exist (such as Keybind) that allow an individual keypress to be linked directly to macro invocation... While I do use this addon, I have tested the above attempted implementation without other addons active to achieve the above results.

Thanks for the feedback man.

This is not a bug, but how its intended to work. The addon is with regards to this stateless; meaning it has no knowledge of events past. Therefore it would not know that on the first press then it should edit the macro (with 2 statements in it) but on subsequent calls to /run IFT() it should leave it alone. Since anything could happen between buttonpress-es then there is no way to reliably implement such a thing.

However; i've looked into the behaviour of /cancelaura specificly in macros and it seems that Blizzard does allow /cancelaura to be executed on the same buttonpress as a subsequest /use or /cast and i will look into implementing that in a later release.

For now: You can put multiple useitem/cast inside a IF-statement. However only the last one will be put in the macro. So you could use RawMacro() function or make two statements; First for cancelaura and the second one to cast demonic leap.

Here is my suggestion for this:
Code:
IF HasBuff("Goblin Glider") AND HaveGlyph("Falling Meteor") AND HavePowerPoints("50", "gt") THEN RawMacro("/run IFT() /cancelaura Goblin Glider /cast Demonic Leap");
Here is an alternative where you need to press the macro twice:
Code:
#First buttonpress -Will do cancelaura and then set the variable 'falling' to true;
IF HasBuff("Goblin Glider") AND HaveGlyph("Falling Meteor") AND HavePowerPoints("50", "gt") AND NOT Flag("Falling", "true") THEN SetFlag("Falling", "true") AND CancelAura("Goblin Glider");
#Second buttonpress -If the variable 'falling' is true then reset the variable and cast demoic leap;
IF Flag("Falling", "true") THEN SetFlag("Falling", "false") AND Cast("Demonic Leap");

When it comes to the keybind stuff you mentioned then yes; you can bind a key/mousebutton to run the macro. IfThen itself even allows you to do that. It's listed in the keybindings section.

This is however in the background identical to dragging a key to a hotbar and it will still be limited by the "cant change macro while in combat" that most people are asking about. The new easycast feature added in 1.7.3 also runs the default macro when you double right-click on the screen.


If the text is outputted in chat; make sure you dont have any typos in the spell's names.
__________________
Author of IfThen, Links in Chat
Report comment to moderator  
Reply With Quote
Unread 10-13-12, 05:13 PM  
Doskious
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 14
File comments: 12
Uploads: 1
Valid Macro Implementation not working

So I really like the idea of this addon. For all but one thing I've tried to do with it, it's performed marvelously.

The thing I'm trying to do, however, is ... well, not working.

I play a Warlock Engineer. I have the Goblin Glider tinker and have glyphed Falling Meteor, both to ensure that no matter how far I have to fall, I'll survive. The thing is, sometimes the Glider takes me further forward than where I want to go. I'm using the addon in part as a panic button macro for when I'm falling (across multiple characters) and I thought it would be nice if I could implement the following functionality:

Code:
IF HasBuff("Goblin Glider") AND HaveGlyph("Falling Meteor") AND HavePowerPoints("50", "gt") THEN CancelAura("Goblin Glider") AND Cast"(Demonic Leap");
And when used in that particular fashion, once I've deployed the glider, pressing the button does result in my character halting forward motion, and activating Demonic Leap. The process doesn't seem to properly cancel the Glider, though (which results in a very slow descent with both the Meteor and the Glider graphics active, which looks silly), and also causes "Goblin Glider" to be output into my active chat channel, which doesn't seem to be intended by any of the LUA code for the addon that I've reviewed.

While I did note your documentation calls for CancelAura() and Cast() calls to each be "the final statement on the line", I have verified that the Macro:

Code:
/cancelaura Goblin Glider
/cast Demonic Leap
works flawlessly to cancel my Glider and then activate the rapid descent via Falling Meteor, when invoked as an independent freestanding macro.

Finally, oddly, the IfThen macro body is entirely overwritten (rather than simply appended) to be:

Code:
/cancelaura Goblin Glider
/cast Demonic Leap
rather than what I would expect:

Code:
/run Ifthen();
/cancelaura Goblin Glider
/cast Demonic Leap
(Subsequent invocations of the IfThen Macro itself, under the right circumstances, do seem to execute proper macro invocation, resulting in the cancellation of the aura and the rapid descent from the leap.)

Any assistance or insight you could offer would be most appreciated, as I'd very much like to have only one button to press for control over my descent from arbitrarily high altitudes.

In passing, I'd like to note in response to the assertion (made on the Curse comments) that the only way to invoke a macro is via Toolbar-based Action Buttons is not strictly correct, as addons exist (such as Keybind) that allow an individual keypress to be linked directly to macro invocation... While I do use this addon, I have tested the above attempted implementation without other addons active to achieve the above results.
Report comment to moderator  
Reply With Quote
Unread 10-12-12, 09:06 PM  
Jarod24
A Theradrim Guardian
AddOn Author - Click to view AddOns

Forum posts: 66
File comments: 26
Uploads: 5
Version 1.7.3 is now published.

-Added EasyCast feature.
-You can now shift-click links to get the title into the edit window.
-MouseOver() function and %MouseOverName% variable.
-Added some few lines to the http://wow.curseforge.com/addons/ifthen/pages/examples/ for use with Pandaria faction dailies.

See the changelog for a complete list.
__________________
Author of IfThen, Links in Chat
Report comment to moderator  
Reply With Quote
Unread 10-04-12, 03:05 PM  
Jarod24
A Theradrim Guardian
AddOn Author - Click to view AddOns

Forum posts: 66
File comments: 26
Uploads: 5
Re: Tillers

Originally Posted by Theondry
Have you determined if IfThen works well with the Tiller's farming stuff?
...

Yes it works.

Mouseover isn't supported at the moment but i can look into adding that (brilliant idea; why didn't i think of that sooner).

These are the statements that i use myself. Note that IsTargeted() dont support a second argument in release version currently. Its just in beta with some other stuff. Just copy/paste it and put the whole cropname in it for now...
Code:
#Tillers faction - My farm;
IF InZone("Sunsong Ranch") AND IsTargeted("Parched", "startswith") THEN UseItem("Rusty Watering Can");
IF InZone("Sunsong Ranch") AND IsTargeted("Infested", "startswith") THEN UseItem("Vintage Bug Sprayer");
If you're worried about performance i suggest reading the bottom of the FAQ (http://wow.curseforge.com/addons/ifthen/pages/faq/).
I've done my best to optimize stuff. If memory is an issue you can turn on the 'minimal' feature by using "/ifthen minimal" and save a few KB (wont do anything about cpu, just memory used)
__________________
Author of IfThen, Links in Chat
Report comment to moderator  
Reply With Quote
Unread 10-03-12, 09:41 AM  
Theondry
A Deviate Faerie Dragon
AddOn Author - Click to view AddOns

Forum posts: 11
File comments: 110
Uploads: 1
Tillers

Have you determined if IfThen works well with the Tiller's farming stuff?

I saw the suggestion of oPie/Spade but there is something about oPie that makes me angry when time I tried it out. (No rhetoric... The way it takes over buttons and keys and forces itself on you makes me feel violated)

It seems like mouseover targeting would be able to easily figure out if you need to water or shoot bugspray or whatever, but I worry that so much mousing over of everything in the game would slow things down (on a modest computer with as poorly written a script as I'm likely to come up with.)
__________________
Theondry of Perenolde
Report comment to moderator  
Reply With Quote
Unread 08-09-12, 04:45 AM  
Jarod24
A Theradrim Guardian
AddOn Author - Click to view AddOns

Forum posts: 66
File comments: 26
Uploads: 5
More info

For more info, use these links:
FAQ page
Examples page
Complete change log

The addon is also hosted on curseforge and is available though the Curse Client: IfThen at curseforge
Last edited by Jarod24 : 08-09-12 at 04:48 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: