Download
(216 Kb)
Download
Updated: 03-22-14 05:38 PM
Pictures
File Info
Compatibility:
Siege of Orgrimmar (5.4)
Updated:03-22-14 05:38 PM
Created:08-09-12 03:47 AM
Downloads:1,987
Favorites:38
MD5:
Categories:Miscellaneous, Buff, Debuff, Spell, Character Advancement, Group, Guild & Friends, Developer Utilities
5.4
IfThen
Version: 1.9.0
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 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/
Archived Files (25)
File Name
Version
Size
Author
Date
1.8.9
215kB
Jarod24
03-17-14 07:30 PM
1.8.8
215kB
Jarod24
10-16-13 09:56 AM
1.8.7
216kB
Jarod24
10-14-13 09:19 AM
1.8.6
207kB
Jarod24
09-17-13 02:42 PM
1.8.5
207kB
Jarod24
09-09-13 12:36 PM
1.8.4
206kB
Jarod24
06-07-13 02:18 AM
1.8.3
206kB
Jarod24
06-01-13 07:55 AM
1.8.2
205kB
Jarod24
05-20-13 10:16 AM
1.8.1
205kB
Jarod24
04-25-13 02:59 AM
1.8.0
205kB
Jarod24
03-05-13 05:08 PM
1.7.9
204kB
Jarod24
02-07-13 12:38 PM
1.7.8
195kB
Jarod24
12-07-12 02:13 PM
1.7.7
192kB
Jarod24
11-28-12 01:24 PM
1.7.6
189kB
Jarod24
11-03-12 05:51 PM
1.7.5
188kB
Jarod24
10-30-12 03:17 PM
1.7.4
186kB
Jarod24
10-20-12 04:41 PM
1.7.3
185kB
Jarod24
10-12-12 08:50 PM
1.7.2
181kB
Jarod24
09-24-12 01:44 PM
1.7.1
180kB
Jarod24
09-15-12 01:56 PM
1.7.0
171kB
Jarod24
09-04-12 02:24 PM
1.6.4
161kB
Jarod24
08-29-12 03:15 PM
1.6.3
162kB
Jarod24
08-25-12 02:55 PM
1.6.2
161kB
Jarod24
08-25-12 06:22 AM
1.6.1
159kB
Jarod24
08-12-12 02:20 PM
1.6.0
150kB
Jarod24
08-09-12 03:47 AM


Post A Reply Comment Options
Unread 08-09-12, 04:45 AM  
Jarod24
A Cyclonian
AddOn Author - Click to view AddOns

Forum posts: 48
File comments: 16
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.
Jarod24 is offline 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: 108
Uploads: 3
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
Theondry is offline Report comment to moderator  
Reply With Quote
Unread 10-04-12, 03:05 PM  
Jarod24
A Cyclonian
AddOn Author - Click to view AddOns

Forum posts: 48
File comments: 16
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, LinkTranslator, SetGuildRank, CompressMacro
Jarod24 is offline Report comment to moderator  
Reply With Quote
Unread 10-12-12, 09:06 PM  
Jarod24
A Cyclonian
AddOn Author - Click to view AddOns

Forum posts: 48
File comments: 16
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, LinkTranslator, SetGuildRank, CompressMacro
Jarod24 is offline 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: 11
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.
Doskious is offline Report comment to moderator  
Reply With Quote
Unread 10-14-12, 03:52 AM  
Jarod24
A Cyclonian
AddOn Author - Click to view AddOns

Forum posts: 48
File comments: 16
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, LinkTranslator, SetGuildRank, CompressMacro
Jarod24 is offline 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: 11
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!
Doskious is offline Report comment to moderator  
Reply With Quote
Unread 10-15-12, 04:54 PM  
Jarod24
A Cyclonian
AddOn Author - Click to view AddOns

Forum posts: 48
File comments: 16
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, LinkTranslator, SetGuildRank, CompressMacro
Last edited by Jarod24 : 10-15-12 at 04:57 PM.
Jarod24 is offline Report comment to moderator  
Reply With Quote
Unread 12-07-12, 09:11 PM  
Zathan666
A Murloc Raider
AddOn Author - Click to view AddOns

Forum posts: 6
File comments: 57
Uploads: 2
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
Zathan666 is offline Report comment to moderator  
Reply With Quote
Unread 12-08-12, 02:54 AM  
Jarod24
A Cyclonian
AddOn Author - Click to view AddOns

Forum posts: 48
File comments: 16
Uploads: 5
Re: Balance DoTs

Originally Posted by Zathan666
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)?
...
Take a look at HavePowerPoints() to determine what you currently are and use RawMacro() to edit a macro's content other than the default one.

Remember; macros cant be edited when in combat.

Code:
IF IsClass("Druid") AND IsCurrentTalentTree("1") AND HavePowerPoints("100", "eq", "solar") THEN RawMacro("/castsequence reset=target/combat/5 Sunfire,  Moonfire", "MyMouseButtonMacro");
IF IsClass("Druid") AND IsCurrentTalentTree("1") AND HavePowerPoints("100", "eq", "lunar") THEN RawMacro("/castsequence reset=target/combat/5 Moonfire,  Sunfire", "MyMouseButtonMacro");
__________________
Author of IfThen, Links in Chat, LinkTranslator, SetGuildRank, CompressMacro
Jarod24 is offline Report comment to moderator  
Reply With Quote
Unread 12-09-12, 06:30 AM  
Jarod24
A Cyclonian
AddOn Author - Click to view AddOns

Forum posts: 48
File comments: 16
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
Jarod24 is offline Report comment to moderator  
Reply With Quote
Unread 12-12-12, 04:11 PM  
CoeurDeLapin
A Defias Bandit

Forum posts: 2
File comments: 23
Uploads: 0
Dark Bargain message and timer

Can someone help me make this work, please? I want to make a OnEvent code that lets healers know that I'm delaying damage with Dark Bargain, and 8 seconds later that I now require healing.

Code:
OnEvent("Buff") AND HasBuff("Dark Bargain") AND InGroup() THEN Chat("Say","I made a Dark Bargain, delaying all damage for 8 secs!") AND SetTimer("DarkBargainTimer","8");
OnEvent("Timer","DarkBargainTimer") AND InGroup() THEN Chat("Say","Now taking delayed damage!");
It works, but not correctly: Instead of just 1 message, the first part goes off 2, 3 or even 4 times. The timer part goes off once as expected.
I tried putting in a Cooldown("10") but that delayed both the first and the second message.
I also tried adding HaveCooldown("Dark Bargain") but then it didn't do anything at all.

What am I doing wrong?
Last edited by CoeurDeLapin : 12-12-12 at 04:14 PM.
CoeurDeLapin is offline Report comment to moderator  
Reply With Quote
Unread 12-12-12, 04:31 PM  
Jarod24
A Cyclonian
AddOn Author - Click to view AddOns

Forum posts: 48
File comments: 16
Uploads: 5
Code runs faster than humans can think; whats happening is that the line is beign processed multiple times as people in your group or yourself is doing stuff :-)

Try inputting a Cooldown() in there like this:
Code:
OnEvent("Buff") AND HasBuff("Dark Bargain") AND InGroup() AND Cooldown("10") THEN Chat("Say","I made a [Dark Bargain], delaying all damage for 8 secs!") AND SetTimer("DarkBargainTimer","8");

OnEvent("Timer","DarkBargainTimer") AND InGroup() THEN Chat("Say","Now taking delayed damage!");
You might also look into using OnEvent("Casted", "Dark Bargain", "player") instead of OnEvent("Buff") since that triggers specificly after a spell is casted.
__________________
Author of IfThen, Links in Chat, LinkTranslator, SetGuildRank, CompressMacro
Jarod24 is offline Report comment to moderator  
Reply With Quote
Unread 12-13-12, 01:55 AM  
CoeurDeLapin
A Defias Bandit

Forum posts: 2
File comments: 23
Uploads: 0
Originally Posted by Jarod24
Code runs faster than humans can think; whats happening is that the line is beign processed multiple times as people in your group or yourself is doing stuff :-)

Try inputting a Cooldown() in there like this:
Code:
OnEvent("Buff") AND HasBuff("Dark Bargain") AND InGroup() AND Cooldown("10") THEN Chat("Say","I made a [Dark Bargain], delaying all damage for 8 secs!") AND SetTimer("DarkBargainTimer","8");

OnEvent("Timer","DarkBargainTimer") AND InGroup() THEN Chat("Say","Now taking delayed damage!");
You might also look into using OnEvent("Casted", "Dark Bargain", "player") instead of OnEvent("Buff") since that triggers specificly after a spell is casted.
Thank you for your fast reply.

I should say that I have only tested this alone (without the InGroup() part) and in party with somebody's alt (who was logged out) - so the extra triggers do not come from their gaining buffs.

I already tried putting in Cooldown("10") but what happened was that the message would be sent too late - several seconds after gaining the buff which would then also delay the message that I'm now taking extra damage.

The "casted" seems like a more precise way to get this going so I will try that tonight
CoeurDeLapin is offline Report comment to moderator  
Reply With Quote
Unread 12-13-12, 09:44 AM  
Jarod24
A Cyclonian
AddOn Author - Click to view AddOns

Forum posts: 48
File comments: 16
Uploads: 5
Originally Posted by CoeurDeLapin
Thank you for your fast reply.

I should say that I have only tested this alone (without the InGroup() part) and in party with somebody's alt (who was logged out) - so the extra triggers do not come from their gaining buffs.

I already tried putting in Cooldown("10") but what happened was that the message would be sent too late - several seconds after gaining the buff which would then also delay the message that I'm now taking extra damage.

The "casted" seems like a more precise way to get this going so I will try that tonight

Cooldown("10") will return TRUE the first time its executed and then FALSE for the next 10 seconds. Your placing of the statement inside the line just before Chat() will make sure that the rest of the statement wont been executed again.

The Buff event will be triggered for alot of stuff ingame, when you gain buffs, area buffs, debuffs, procs of your items, etc, etc so thats probably whats happening.
__________________
Author of IfThen, Links in Chat, LinkTranslator, SetGuildRank, CompressMacro
Jarod24 is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: