Noob question: Warrior.mac

Need help running MacroQuest2? Ask your questions about how to get things to work on your computer.

Moderator: MacroQuest Developers

Anasazu
decaying skeleton
decaying skeleton
Posts: 6
Joined: Wed Jul 21, 2004 3:41 pm

Noob question: Warrior.mac

Post by Anasazu » Wed Jul 21, 2004 10:58 pm

I have 3 boxed characters of a cleric, bard and warrior. My strategy is for the bard to pull the warrior to tank and of course the cleric to sit on his butt. Anyways, I'm having trouble with the warrior macro. I've designed it to assist the bard after a pull however, I keep getting the error non-numeric encounter. I dumbfounded or rather found to be dumb on what's the cause of it. Here is the code for it. Tell me, what am I doing wrong.

#event assist "..... Tells you, 'Assist me'"
#event sit "..... Tells you, 'You need to fix your wounds'"
#event follow "..... Tells you, 'Follow me'"
#event cannotsee "You cannot see your target"
#event toofar "Your target is too far away"
#event loading "LOADING, PLEASE WAIT..."
#event Slainby "You have been slain by a"
#event endfollow "we are here"

Sub Main
:loop
/doevents
/goto :loop
/return

sub event_assist
:attackstart
/assist .....
/attack on
/delay 1s
/if (${Target}==NULL) /g You have no target.
/if (${Target}==NULL) /return
/attack on
/g Attacking %T

:attackfight
/if (${Target.Type}!=NPC) /goto :attackend
/if (${Target.CurrentHPs}==0) /g Bring on the next one.
/if (${Target.CurrentHPs}==0) /goto :attackend
/face
/if (${Target.Distance}>9) /keypress up
/if (${Target.Distance}<5) /keypress down
/if (${Me.AbilityReady[Taunt]}==TRUE) /doability 1
/delay 1s
/if (${Me.AbilityReady[Kick]}==TRUE) /doability 2
/doevents
/goto :attackfight

:attackend
/attack off
/return

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Post by ieatacid » Wed Jul 21, 2004 11:14 pm

Target.Type is a string. You want:

Code: Select all

/if (${String[${Target.Type}].Equal[NPC]})

zanomo
a hill giant
a hill giant
Posts: 285
Joined: Thu Jun 24, 2004 11:21 pm

Post by zanomo » Thu Jul 22, 2004 1:19 am

or:

Code: Select all

    /if (${Target.Type.NotEqual[NPC]}) /goto :attackend
And these can be:

Code: Select all

    /if (${Me.AbilityReady[Taunt]}) /doability 1
    /delay 1s
    /if (${Me.AbilityReady[Kick]}) /doability 2

Code: Select all

    /if (!${Target.ID}) {
        /g You have no target.
        /return
    }
Cheers.