How to tell if there is a combat ability currently running

A forum for macro code snippets to be used in writing other macros. Post routines or .inc files here only, completed macros go to the Macro Depot. MQ2Data format only!

Moderator: MacroQuest Developers

pw
a ghoul
a ghoul
Posts: 130
Joined: Sun Jan 02, 2005 5:59 am

How to tell if there is a combat ability currently running

Post by pw » Wed Aug 08, 2007 5:28 am

Apologies if this has been answered somewhere else. I tried search and didn't easily find the answer.

I wanted to be able to check if there was a combat ability currently running so that I didn't try and start a second or third ability running at the same time (which wouldn't work!). The only way to tell seems to be to check for the label text in the combat abilities window being currently set to "No Effect" like this:

Code: Select all

${Window[CombatAbilityWnd].Child[CAW_CombatEffectLabel].Text.Equal[No Effect]}
For a real use of this check, I have the following inside a Combat sub-routine:

Code: Select all

      /if (${Me.CombatAbilityReady[Savage Onslaught Discipline]} && ${Target.PctHPs} > 10 && ${Me.PctEndurance} > 50 && ${Window[CombatAbilityWnd].Child[CAW_CombatEffectLabel].Text.Equal[No Effect]}) {
          /disc Savage Onslaught Discipline
      }
   
      /if (${Me.CombatAbilityReady[Furious Discipline]} && ${Target.PctHPs} > 10 && ${Me.PctEndurance} > 50 && ${Window[CombatAbilityWnd].Child[CAW_CombatEffectLabel].Text.Equal[No Effect]}) {
          /disc Furious Discipline
      }
      
      /if (${Me.CombatAbilityReady[Fellstrike Discipline]} && ${Target.PctHPs} > 10 && ${Me.PctEndurance} > 50 && ${Window[CombatAbilityWnd].Child[CAW_CombatEffectLabel].Text.Equal[No Effect]}) {
          /disc Fellstrike Discipline
      }

jacensolo
a snow griffon
a snow griffon
Posts: 427
Joined: Wed Feb 14, 2007 8:51 am
Location: Right behind you

Post by jacensolo » Wed Aug 08, 2007 10:10 am

As far as I know, there isn't a way to check that, at least not through the Me TLO, which is where I would expect it to be. The only other ways I could think of doing it require way more code than what you're doing, and also less flexibility.

However, that code you're using to check it is a very creative workaround.

Does it still return that info if the combat abilities window is closed? Or do you need to keep it open to get the info?

pw
a ghoul
a ghoul
Posts: 130
Joined: Sun Jan 02, 2005 5:59 am

Post by pw » Thu Aug 09, 2007 5:51 am

It *sometimes* works when the window is closed too. :roll:

For reliable use, just Alt+C to get the window up and park it out the way.