Can MQ detect casting?

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

Benev0lent
Placid Leech
Placid Leech
Posts: 19
Joined: Fri Dec 26, 2003 9:01 am

Can MQ detect casting?

Post by Benev0lent » Tue Mar 23, 2004 9:17 am

That time of the morning again where I sit by and scheme how to make el twist a bit more transparent.

to that end my question....

Is it possible for MQ to detect when a spell is cast manually from a spell gem. Poked around the manual but found nothing and somehow doubt this is doable.

By this I mean if I click on a spell icon with the mouse, is there any way to get a macro to detect that? Same applies to starting spells via the hotkey bank as a spell gem. Is it possible for a macro to detect when a spell is cast via UI gem (where there is no text based echo) so that I can reroute the macro to a subroutine?

Thanks for any help

+Benev0

bonehand
a lesser mummy
a lesser mummy
Posts: 48
Joined: Tue Feb 17, 2004 5:16 pm

Post by bonehand » Tue Mar 23, 2004 9:47 am

I haven't tried it, but $char(casting) should return TRUE if your character is casting a spell.

wassup
Official Guardian and Writer of TFM
Official Guardian and Writer of TFM
Posts: 1487
Joined: Sat Oct 26, 2002 5:15 pm

Re: Can MQ detect casting?

Post by wassup » Tue Mar 23, 2004 10:06 am

Benev0lent wrote:That time of the morning again where I sit by and scheme how to make el twist a bit more transparent.

to that end my question....

Is it possible for MQ to detect when a spell is cast manually from a spell gem. Poked around the manual but found nothing and somehow doubt this is doable.

By this I mean if I click on a spell icon with the mouse, is there any way to get a macro to detect that? Same applies to starting spells via the hotkey bank as a spell gem. Is it possible for a macro to detect when a spell is cast via UI gem (where there is no text based echo) so that I can reroute the macro to a subroutine?

Thanks for any help

+Benev0
What bonehand said...

Best way to detect if you are in the process of casting a spell.

JGC84
a ghoul
a ghoul
Posts: 116
Joined: Sat Nov 29, 2003 2:51 am

Post by JGC84 » Tue Mar 23, 2004 10:08 am

use an "you begain casting" event, else where in your code define a variable like macrocast and you can use it as a 0 or 1 flag for if the marco casted the spell or not so in the "you begain casting" event you could do

/if macrocast {
....
}else {
....
}

just a thought
ACK! I think I blew it up....

I dont think your allowed to talk about this outside of a "free speech zone" anymore.

eqg4m3r
decaying skeleton
decaying skeleton
Posts: 6
Joined: Mon Mar 01, 2004 12:34 pm

Post by eqg4m3r » Thu Apr 08, 2004 8:27 pm

This is exactly where I am stumbling over a lil problem as well :)

Ok, basically this macro should do the following: Upon incoming you start the macro and your friendly neighbourhood wizard'll summon a flaming sword of xuzl, then activate the swarm pet AA and then start a nuke rotation (and every now and then twist in concussion using the ele legs). Now I am having troubles detecting wether or not the character is casting, as right now the check does nothing and the char tries to nuke while xuzl AA is activated.

Also, the same check should be used should you run low on mana and then cast either harvest or harvest of druzzil, what ever comes first, and then delay long enough (as you're stunned).

As I didn't find a way to check wether a spell or AA was castable ATM or not (sort of something like "spellup" or something) I wanted to use the check wether or not your casting... and if you're casting just wait long enough.

Following is the code, don't let the german spellnames distract you, using ancient cold nuke, icemeteor, icespear of solist and ele leggins, flaming sword of xuzl, call of xuzl, harvest and harvest of druzzil.

Code: Select all

Sub Main 
   /zapvar 
   /declare zZeit1 global
   /declare zZeit2 global
   /declare zZeit3 global
   /declare zZeit4 global
   /declare zZeit5 global
   
   /varcalc zZeit1 25+10*$spell("Alt: Zerstörung des Eises",casttime)
   /varcalc zZeit2 25+10*$spell("Eisspeer von Solist",casttime)
   /varcalc zZeit3 25+10*$spell("Eismeteor",casttime)
   /varcalc zZeit4 25+20
   /varcalc zZeit5 25+10*$spell("Flammenschwert von Xuzl",casttime)
      
   
   /echo Xuzl's Feuermesser --> $target(name,clean)
   /cast "Flammenschwert von Xuzl"
   /delay @zZeit5
   
   /echo Xuzl-Messer (plural) --> $target(name,clean) FALLS UP!!
   /alt activate 208
   /if $char(casting)==TRUE /delay 9s
   
   :Nuke
     /echo Alt: Zerstörung des Eises --> $target(name,clean)
     /cast "Alt: Zerstörung des Eises"
     /delay @zZeit1
     /if $target(name)=="NULL" {
         /echo Mob down
         /endmacro
       }
       
     /echo Eisspeer von Solist --> $target(name,clean)
     /cast "Eisspeer von Solist"
     /delay @zZeit2
     /if $target(name)=="NULL" {
         /echo Mob down
         /endmacro
       }
       
     /cast item "Maelins Überhosen des Wissens"
     /delay @zZeit4
          /if $target(name)=="NULL" {
         /echo Mod down
         /endmacro
       }
       
     /echo Eismeteor --> $target(name,clean)
     /cast "Eismeteor"
     /delay @zZeit3
     /if $target(name)=="NULL" {
         /echo Mob down
         /endmacro
       }
       
     /cast item "Maelins Überhosen des Wissens"
     /delay @zZeit4
     /if $target(name)=="NULL" {
         /echo Mob down
         /endmacro
       }
       
     /if n $char(mana,pct)<=80 {
       /echo Mache mir massig Mana! (Harvest!)
       /cast "Ernte"
       if $char(casting)==TRUE /delay 13s
     }
     
     /if n $char(mana,pct)<=80 {
       /echo Mache mir massig Mana! (Harvest of Druzzil)
       /alt activate 172
       if $char(casting)==TRUE /delay 13s
     }
     /if $target(name)=="NULL" {
            /echo Mod down
            /endmacro
            }
     /goto :Nuke
/return 
Any ideas where I'm going wrong?
Life is a game - play it... But play to win!

daerck
a ghoul
a ghoul
Posts: 134
Joined: Mon Jan 12, 2004 8:44 pm

Post by daerck » Thu Apr 08, 2004 9:50 pm

Hmm... for me $char(casting) is true when I do an AA ability.
Maybe the macro is "too fast" and checks for the casting before your character actually starts casting. Try adding a short delay after the /alt activate and the casting test

Code: Select all

   /echo Xuzl-Messer (plural) --> $target(name,clean) FALLS UP!! 
   /alt activate 208 
[color=red]   /delay 3[/color]
   /if $char(casting)==TRUE /delay 9s 
For the Harvest part, try replacing if with /if

Oh and I love "Maelins Überhosen"

eqg4m3r
decaying skeleton
decaying skeleton
Posts: 6
Joined: Mon Mar 01, 2004 12:34 pm

Post by eqg4m3r » Fri Apr 09, 2004 1:12 am

Thank you so very much :) Works like a charm now
Life is a game - play it... But play to win!