Targetting Question

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

gillgian
orc pawn
orc pawn
Posts: 18
Joined: Tue Mar 16, 2004 3:09 pm

Targetting Question

Post by gillgian » Thu Mar 25, 2004 3:07 pm

Would this work:

The 'master' calls assist me in channel

Event triggered for an assist

Code: Select all

Sub Event_Assist 
  /assist @MasterName 
  /delay 2s 
  /face 
  /pet attack
  /varset MainTarget $target(id)
  :CombatBegin 
 
  /call lifetapmob
  /call DotMob				  
  /call MaintainBuffs
  /call MaintainPetHealth	  
  
  /target id  @MainTarget
  /if $target(type)==NULL /call ResetEvents
   
  /goto :CombatLoop 
/return 
Is the a correct way to save a target and then retarget the same mob?

MrSmallie
a hill giant
a hill giant
Posts: 167
Joined: Fri Oct 11, 2002 11:18 am

Post by MrSmallie » Thu Mar 25, 2004 3:07 pm

Code: Select all

/varset MainTarget $target(id)
......
/target @MainTarget
..........
/if n $target(id)!=@MainTarget /call ResetEvents
Me
[img]http://home.comcast.net/~mrsmallie/ches.JPG[/img]

Gumby
a ghoul
a ghoul
Posts: 99
Joined: Sat Jan 24, 2004 5:27 pm

Post by Gumby » Fri Mar 26, 2004 11:39 am

MrSmallie wrote:

Code: Select all

/varset MainTarget $target(id)
......
/target @MainTarget
..........
/if n $target(id)!=@MainTarget /call ResetEvents
Grin, posted it right initially:

Code: Select all

/target id @MainTarget
One tidbit about this code, you're going to be hangnig out in the event queue and will be able to take no other actions from it; recommend doing the assist as a event and your combat loop still under Main or another sub, and have /doevents still in the loop for various other things.

Also if using $target(id)!=@MasterTarget, if the script winds up on a corpse it's going to keep executing through the code. Haven't found a way to reliably check circumstances with a single comparison anyway =/.

Code: Select all

/if $target()==FALSE
/if $target(state)==DEAD
/if $target(type)!=NPC
...
Etc. Still need the reliable pet check which I never finished ;) Maybe could do it in two comparisons with the !=@MasterTarget and target(state)==DEAD.

G