Correct way to check class

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

mkmitchell
decaying skeleton
decaying skeleton
Posts: 2
Joined: Fri Dec 12, 2014 3:46 pm

Correct way to check class

Post by mkmitchell » Fri Dec 12, 2014 4:03 pm

I'm attempting to write a small macro that assists whoever in the party says assist me. I have a few different classes in the party and I want them to act based on their class type. It seemed to be working in Events but not in the Sub Main. How can I go about this?

I'm sure you'll see some other errors in there as well. All comments are greatly appreciated.

Thanks!

Code: Select all

#turbo
#Include spell_routines.inc

#Event AssistOn "#1# tells the group, 'Assist me'"
#Event BossAssist "#1# tells the group, 'Boss assist me'"
#Event AssistOff "#1# tells the group, 'Stop assist'"
#Event Status "#1# tells the group, 'Status'"

Sub Main
/declare assisting int outer 0
/g Assisting on
:loop
  /doevents
  /if I tested to see if the character was a Magician here and kept getting errors.
    /if (${Me.Casting.ID}) /goto :loop
	/if (!${Me.Pet.ID}) /g I don't have a pet
	/if (!${Me.PetBuff[Burnout V]}) { 
	  /cast "Burnout V"
	}
/goto :loop
  
Sub Event_AssistOn(Line, Sender)
/varset assisting 1
/assist ${Sender}
/delay 10
/g Assisting ${Sender} with ${Target.CleanName}
/if (${Me.Class}=Rogue){
  /stick behind 10
  /attack
} else if ($Me.Class}=Wizard) {
  /g I'm a wizard and will do stuff here
  /cast "Ether Flame"
} else if ($Me.Class}=Mage) {
  /g I'm a mage and will do stuff here
  /pet attack
  /cast "Ancient:Nova Strike"
}
/return

Sub Event_BossAssist(Line, Sender)
/varset assisting 1
/assist ${Sender}
/delay 10
/g Assisting #{Sender} with ${Target}
/if (${Me.Class}=Rogue){
  :roguntildead
  /if (${Target.PctHps} < 95) {
    /stick behind 10
    /attack
  } else {
    /if (!{Target}) /goto :loop
    /goto :roguntildead
  }
}  else if ($Me.Class}=Wizard) {
  /g I'm a wizard and will do stuff here
  :wizuntildead
  /if (${Target.PctHps} < 95) {
    /cast "Ether Flame"
	/delay 50
  } else {
    /if (!{Target}) /goto :loop
    /goto :wizuntildead
  }
}

/return

Sub Event_AssistOff
/varset assisting 0
/stick off
/attack off
/target clear
/g I'm stopping my attack
/return

Sub Event_Status
/g I will detail status here.

Gomer
a snow griffon
a snow griffon
Posts: 304
Joined: Fri Apr 15, 2005 2:38 pm

Re: Correct way to check class

Post by Gomer » Fri Dec 12, 2014 5:10 pm

The macro I use does it like this:

Code: Select all

/if (${Me.Class.ShortName.Equal[BRD]}) {

mkmitchell
decaying skeleton
decaying skeleton
Posts: 2
Joined: Fri Dec 12, 2014 3:46 pm

Re: Correct way to check class

Post by mkmitchell » Fri Dec 12, 2014 10:03 pm

Works perfect. Thank you