Page 1 of 1

/target

Posted: Fri Jun 04, 2004 5:52 pm
by the_horror
having trouble with /target. Trying to target the target of the target

*trying to snare the target once the mob drops below a certain %


when ran MQ says:

there are no spawns matching: (0-100) any null
[MQ2] NULL
The current Macro has ended

Code: Select all


Sub Main

/declare Casting string outer
/declare Delay int outer

/if (${Me.TargetOfTarget.PctHPs}<=20) /goto :Snare 


          
:Snare 
          
             /Target ${Me.TargetOfTarget.Name}
             /echo ${Me.TargetOfTarget.Name} 
             /stand 
             /g Snare on %t! 
             /varset Casting Ensnare 
             /cast "Ensnare" 
             /doevents 
             /varset Delay ${Math.Calc[${Spell[Ensnare].MyCastTime}*10+10]} 
             /delay ${Delay} 
             /if (${Sit}==1) /sit 
         


/return
 

Posted: Fri Jun 04, 2004 7:19 pm
by macrolover
not certain on this but don't you need the group ability to use target of target? if so that would be a possibility of why it's returning that can't check becuase i don't have that ability myself. I'm not good at coding myself so can't help if that doesn't do it for you

Posted: Fri Jun 04, 2004 7:20 pm
by dont_know_at_all
There are so many things wrong, I don't know where to start.

You know TargetOfTarget is not always available, right?

ok

Posted: Fri Jun 04, 2004 7:58 pm
by the_horror
when is targetoftarget avail? sorry just learning and that is what i saw in others code and that is what was suggest before. BTW thanks for the help

Posted: Fri Jun 04, 2004 8:42 pm
by ieatacid
Target of target is available when the leader of the group has purchased it with GoD leadership points.

Posted: Fri Jun 04, 2004 8:47 pm
by Marze
Don't use /goto unless you have to. It leads to what we call sphagetti code. Here is the proper way:

Code: Select all

Sub Main 

/if (${Me.TargetOfTarget.PctHPs}<=20) {
   /echo ${Me.TargetOfTarget.Name} 
   /target ${Me.TargetOfTarget.Name} 
   /g Snare on %t! 
   /cast "Ensnare" 
   /doevents 
   /delay ${Math.Calc[${Spell[Ensnare].MyCastTime}*10+10]} 
   /if (${Sit}==1) /sit  | what is this? some global var?
   }       
/return
You don't need /stand anymore since they made it such that you auto stand when you cast a spell. Works on duck and FD too.

As to why its not targetting... I don't know, but I just tried Me.TargetOfTarget on someone nearby and it return NULL even though the character had me targetted. Maybe you need the ability, or maybe its not working right.