IfThen

IfThen

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

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

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

Examples:

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


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

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

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

  • Avatar of Jarod24 Jarod24 Apr 25, 2013 at 09:01 UTC - 0 likes

    Version 1.8.2 is out.

    See the changelog for the changes.

    Last edited May 22, 2013 by Jarod24
  • Avatar of Jarod24 Jarod24 Mar 05, 2013 at 23:10 UTC - 0 likes

    Version 1.8.0 is released.

    • The .TOC is updated for WOW patch 5.2.0
    • HaveCooldown() should be less prone to return true for spells because of the global cooldown.

    See the changelog for a complete list.

  • Avatar of Pekesino Pekesino Feb 26, 2013 at 22:22 UTC - 0 likes

    @Jarod24: Go

    Ok, I understand. I`ll be waiting for another version to see the improvement. Thanks a lot.

    Last edited Feb 26, 2013 by Pekesino
  • Avatar of Jarod24 Jarod24 Feb 24, 2013 at 12:21 UTC - 0 likes

    @Pekesino: Go

    hmmm. Global cooldown you say.
    HaveCooldown() looks at a spell's or item's cooldown. That means the time until you can use it again (i.e your heartstone got x minutes left until you can use it).

    However when i dived deeper into the subject it also seems that the blizzard functions used for this will include the GDC when query'ing for cooldown on -items/spells (as you pointed out).

    One solution i can think of just now would be to add a extra argument to HaveCooldown() so that it will ignore values below a certain threshold and still return true (hardcoding in a GCD value dosent make sense since it varies with the player's stats and some spells dont use GCD).

    Update:

    • It seems that items are not affected by the GCD issue. Just spells. The blizzard function does not return the GCD instead of the items cooldown, so if you check the cooldown of say a 'mana gem' or 'heartstone' then that should still return false even when the GCD is up.

    • GCD is dynamic and will vary depending on the players gear, buffs etc. I've seen other addons using simpler solutions where they will just ignore spell cooldowns when they are less then 1.5 seconds.

    • Been working on the HaveCooldown() function to better determine if the spell cooldown value returned is the actual spell cooldown or just the GCD and i got a somewhat working solution at the moment.
      The only outstanding issue is if you call the function too fast after the actual cast then it can return false even when you have a cooldown. This should however not be a problem in practice, since even the Tick-event only occurs every 1 seconds. This is because the blizzard function initially returns the GCD value for all spells until the GCD is done, after that it will return the spell's specific cooldown.
      In effect, i cant trust the values since they might be spell-specific or global.
    Last edited Feb 24, 2013 by Jarod24
  • Avatar of Pekesino Pekesino Feb 23, 2013 at 10:53 UTC - 0 likes

    Hi Jarod,

    Glad to see active your addon. I need your advice. Using HasCooldown() I got a false both on GCD and the spell cooldown. I'm trying to figure out a way to distinghish among the Global Cooldown and the real spell cooldown. Any hint please? Thanks anyway.

  • Avatar of Jarod24 Jarod24 Feb 22, 2013 at 13:29 UTC - 0 likes

    @diejetty: Go

    Nope.
    You got to write multiple statements.

    Last edited Feb 22, 2013 by Jarod24
  • Avatar of diejetty diejetty Feb 22, 2013 at 05:21 UTC - 0 likes

    @diejetty: Go

    Hey Jarod,

    Is there a way to have an event trigger on every form of chat; guild, group, whisper, say, etc ? Without having to make multiple lines for each type. OnEvent("Chat","Group","","hello")

    Thx.

    Last edited Feb 22, 2013 by diejetty
  • Avatar of Jarod24 Jarod24 Feb 07, 2013 at 18:44 UTC - 0 likes

    Ok, lots of changes in version 1.7.9

    • You can now click on links in the search results or the 'see also' section and it will take you directly to the documentation page.
    • Parser errors now have links you can click to goto the page & line that failed.
    • New linenumber feature.
    • IsHostile() is a new function.
    • OnEvent("Chat") now accepts "system" as a channel argument.

    See the changelog for a complete list.

  • Avatar of Delvai Delvai Feb 06, 2013 at 20:17 UTC - 0 likes

    @Jarod24: Go

    Awesome! Thanks a lot. Love your addon btw! Keep up the great work :)

    Delv

  • Avatar of Jarod24 Jarod24 Feb 05, 2013 at 22:24 UTC - 0 likes

    @Delvai: Go

    Done.
    The next version will support "system" as a channel argument for the OnEvent("Chat") event.

    I got no estimate for when the next version is released though.
    Lots of changes have been done and i need time to make sure stuff dosent break/implode.

Facts

Date created
Oct 06, 2011
Categories
Last update
May 20, 2013
Development stage
Release
Language
  • enUS
License
All Rights Reserved
Curse link
IfThen
Downloads
4,326
Recent files

Authors