Almost working macro afknuke.mac

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

fantum409
a ghoul
a ghoul
Posts: 141
Joined: Fri Nov 14, 2003 10:03 pm

Almost working macro afknuke.mac

Post by fantum409 » Sun Apr 25, 2004 10:54 pm

This works well the first target, but as soon as that dies it doesn't reassist. I'm a noob at this and can't seem to figure out where it messes up. If someone can fix, or point out the spots for me to fix I would really appreciate the help. BTW this isn't mind, it's a copy/paste job from the depot.
Thanks

Code: Select all

|----------------------------------------------------------------------------| 
#include SPELLCAST.inc 
#Event SLAINBY  "You have been slain by " 
#Event EXP   "You gain " 

#turbo 380 

Sub Main 
   /ECHO  =+= Slothy's AutoNuke Macro Enabled =+= 
   /ECHO  =+= Version Realease: 0.1b =+= 
   /ECHO  =+= Usage:  /Macro AFNuke <Tank name> =+= 
|-----------------(Tank Declaration Flag=1)--------- 
   /declare tankname global 

|-----------------(Casting Flags=6)----------------- 
   /declare Casteagle_Flag global 
   /declare Castsot_Flag global 
   /declare Castsotp_Flag global 

|-----------------(Engage Flag=3)------------------- 
   /declare engagedistance global 
   /declare engagedmob global 
   /declare mobhealth global 

|-----------------(Experience Flags=11)------------- 
   /declare mobname global 

|-(Amount of flags have to equal Amount of variable) 
|----------------(Current Amount=21)---------------- 
|----------------(Variable Initialized)------------- 
   /varset engagedistance 300      | How close mob must be to engage 
   /varset mobhealth 90      | Mob health before engage 
   /varset tankname @Param0   | Assigns Param0 to variable 
   /varset engagedmob 0      | Flag to check if mob is engaged 
   /varset mobname 0 
   /varset Casteagle_Flag 0 
   /varset Castsotp_Flag 0 
   :Mainloop 
   /call Combatcheck 
   /doevents 
   /delay 1s 
   /goto :mainloop 
/return 

| --> This sub command is a switch to check for mob target 
| --> This sub command also checks for your own health 
Sub Combatcheck 
   /Echo Your Main Assist is @tankname 

   /if (@engagedmob==1) { 
      /assist @tankname 
      /call Nuke 
   } 

   /if (@engagedmob==0) /goto :stopfiring 
   :stopfiring 
   /doevents 
   /assist @tankname 
   /delay 5 
   /if (${Target.Type.Equal[NPC]}) { 
      /Echo ${Target.CleanName} is at the distance of: ${Target.Distance} 
      /Echo ${Target.CleanName} is considered an ${Target.Race} 
      /varset mobname ${Target.Name} 
      /face 
      /delay 3 
      /if (${Target.PctHPs}<=@mobhealth) /if (${Target.Distance}<@engagedistance) /goto :DoubleCheck 

      :DoubleCheck 
      /doevents 
      /delay 3 
      /if (${Target.Distance}>@engagedistance) /goto :stopfiring 
      /if (${Target.PctHPs}>=@mobhealth) /goto :stopfiring 
      /if (${Target.PctHPs}<=@mobhealth) /if (${Target.Distance}<@engagedistance) /goto :fire 

      :fire 
      /doevents 
      /Echo Autofire Engaged at the distance of: ${Target.Distance} 
      /varset engagedmob 1 
      /call nuke 
   } 

   /if (${Target.Type.NotEqual[NPC]}) { 
      /delay 5s 
      /varset engagedmob 0 
      /goto :stopfiring 
   } 

   /if (${Target.Type.Equal[NULL]}) { 
      /delay 5s 
      /varset engagedmob 0 
      /goto :stopfiring 
   } 

/return 

| --> Loop for arrows, and also adjusts for distance of mobs usually 
| --> This loop also checks for snaring the mob at 91% 
Sub Nuke 
   :nukeloop 
   /doevents 
   /keypress forward 
   /if (${Target.Type.NotEqual[NULL]}) { 
      /face fast 

      /call Cast "Draught of E`ci"      |Change arrow button to your own 
   } 

   /if (${Target.Type.NotEqual[NPC]}) { 
      /varset engagedmob 0 
      /delay 1s 
      /call Combatcheck 
   } 

   /if (${Target.Type.Equal[NULL]}) { 
      /varset engagedmob 0 
      /delay 1s 
      /call Combatcheck 
   } 

   /goto :nukeloop 
/return 




Sub Event_EXP 
   /varset mobname 0 
/return 

Sub Event_SLAINBY 
   /Echo You Died, macro over, so sad to see you go  
   /endmacro 
/return 
| --> End of Events 
| --> End of Macros

unknwon
orc pawn
orc pawn
Posts: 10
Joined: Tue Mar 02, 2004 11:18 am

Here you go..

Post by unknwon » Mon Apr 26, 2004 2:36 pm

|----------------------------------------------------------------------------|
#include SPELLCAST.inc
#Event SLAINBY "You have been slain by "
#Event EXP "You gain "
#Event Enraged "has become ENRAGED"
#Event rampaged "goes on a RAMPAGE"
#Event offrampaged "is no longer RAMPAGE"
#Event Offrage "is no longer enraged"
#Event CastResist "Your target resisted "
#Event LeaderCheck "has left the group"
#chat group
#turbo 380

/ECHO =+= Slothy's AutoNuke Macro Enabled =+=
/ECHO =+= Version Realease: 0.1b =+=
/ECHO =+= Usage: /Macro AFNuke <Tank name> =+=
Sub Main

/declare ReportInterval Global
/declare Report Timer
/declare StartLvlExp Global
/declare StartLvl Global
/declare StartAAExp Global
/declare StartAA Global
/declare LastAAExp Global
/declare LastLvlExp Global
/declare TotalLVLearned Global
/declare TotalAAearned Global
/declare Counter Global
/varset Counter 1
/varset StartLvlExp ${Me.PctExp}
/varset StartLvl ${Me.Level}
/varset LastLvlExp ${Me.PctExp}
/varset LastAAExp ${Me.PctAAExp}
/varset StartAAExp ${Me.PctAAExp}
/varset StartAA ${Me.AAPoints}
/varset Report ${Math.Calc[@ReportInterval*600]}


/varset ReportInterval 10

/echo [${Time.Time12}] ExpMon running. Will report every @ReportInterval minute(s)

|-----------------(Tank Declaration Flag=1)---------
/declare tankname global

|-----------------(Casting Flags=6)-----------------
/declare Casteagle_Flag global
/declare Castsot_Flag global
/declare Castsotp_Flag global

|-----------------(Engage Flag=3)-------------------
/declare engagedistance global
/declare engagedmob global
/declare mobhealth global

|-----------------(Experience Flags=11)-------------
/declare mobname global

|-(Amount of flags have to equal Amount of variable)
|----------------(Current Amount=21)----------------
|----------------(Variable Initialized)-------------
/varset engagedistance 200 | How close mob must be To engage
/varset mobhealth 80 | Mob health before engage
/varset tankname @Param0 | Assigns Param0 to variable
/varset engagedmob 0 | Flag to check if mob is engaged
/varset mobname 0
/varset Casteagle_Flag 0
/varset Castsotp_Flag 0
:Mainloop
/Call Medtime
/call Combatcheck
/doevents
/delay 1s
/goto :mainloop
/return

| --> This sub command is a switch to check for mob target
| --> This sub command also checks for your own health
Sub Combatcheck
/Echo Your Main Assist is @tankname
/If (@engagedmob==1) {
/assist @tankname
/call Nuke
}

/if (@engagedmob==0) /goto :stopfiring
:stopfiring
/doevents
/assist @tankname
/delay 5
/if (${Target.Type.Equal[NPC]}) {
| /Echo ${Target.CleanName} Is at the distance of: ${Target.Distance}
| /Echo ${Target.CleanName} Is considered an ${Target.Race}
/varset mobname ${Target.Name}
/face
/delay 3
/if (${Target.PctHPs}<=@mobhealth) /if (${Target.Distance}<@engagedistance) /goto :DoubleCheck

:DoubleCheck
/doevents
/delay 3
/if (${Target.Distance}>@engagedistance) /goto :stopfiring
/if (${Target.PctHPs}>=@mobhealth) /goto :stopfiring
/if (${Target.PctHPs}<=@mobhealth) /if (${Target.Distance}<@engagedistance) /goto :fire

:fire
/doevents
|/Echo Autofire Engaged at the distance of: ${Target.Distance}
/varset engagedmob 1
/call nuke
}

/if (${Target.Type.NotEqual[NPC]}) {
/delay 5s
/varset engagedmob 0
/goto :stopfiring
}

/if (${Target.Type.Equal[NULL]}) {
/delay 5s
/varset engagedmob 0
/goto :stopfiring
}

/return

| --> Loop for arrows, and also adjusts for distance of mobs usually
| --> This loop also checks for snaring the mob at 91%
Sub Nuke
:nukeloop
/doevents
/keypress forward
/if (${Target.Type.NotEqual[NULL]}) {
/face fast
|/gsay "${Target.CleanName} is about to become very cold. :)"
/Call Cast "Pillar of Frost" |Change arrow button To your own
/delay 20
}

/if (${Target.Type.NotEqual[NPC]}) {
/varset engagedmob 0
/delay 1s
/call Combatcheck
}
/If (${Target.ID}==0) {
/varset engagedmob 0
/delay 1s
/Call MedTime

/echo test
/return
}
|/If (${Target.Type.Equal[Null]}) {
/varset engagedmob 0
/delay 1s

/Call Combatcheck
}

/goto :nukeloop
/return

Sub MedTime
/echo Meditating.
/doevents
:medup
/doevents
/delay 1s
/newif (${String[${Me.State}].Equal[STAND]}==1) {
/sit
}
/delay 7
/If (${Me.PctMana}<=70) {
| /echo mana Is still too low. Meditating again..
/goto :medup
}
/echo GTG "${Me.PctMana}"

/return

Sub Event_rampage
/delay 100
/return

Sub Event_EXP
/varset mobname 0
/return

Sub Event_SLAINBY
/Echo You Died, macro over, so sad to see you go
/q
/endmacro
/return

Sub Event_Timer()
/declare LVLearned local
/declare AAearned local
/varset TotalLVLearned ${Math.Calc[${Math.Calc[${Me.PctExp}-@StartLvlExp]}+${Math.Calc[${Math.Calc[${Me.Level}-@StartLvl]}*100]}]}
/varset TotalAAearned ${Math.Calc[${Math.Calc[${Me.PctAAExp}-@StartAAExp]}+${Math.Calc[${Math.Calc[${Me.AAPoints}-@StartAA]}*100]}]}
/varset LVLearned ${Math.Calc[${Math.Calc[${Me.PctExp}-@LastLvlExp]}]}
/varset AAearned ${Math.Calc[${Math.Calc[${Me.PctAAExp}-@LastAAExp]}]}

/echo -----------------------------------------------------------
/echo [${Time.Time12}] LVL: ${Me.PctExp} (@LVLearned%, ${Math.Calc[@TotalLVLearned/${Math.Calc[@ReportInterval*@Counter]}]}%/min , ${Math.Calc[${Math.Calc[@TotalLVLearned/${Math.Calc[@ReportInterval*@Counter]}]}*60]}%/hr]
| /echo [${Time.Time12}] AA: ${Me.PctAAExp} (@AAearned%, ${Math.Calc[@TotalAAearned/${Math.Calc[@ReportInterval*@Counter]}]}%/min , ${Math.Calc[${Math.Calc[@TotalAAearned/${Math.Calc[@ReportInterval*@Counter]}]}*60]}%/hr]
|/echo Next AA In ${Math.Calc[${Math.Calc[100-${Me.PctAAExp}]}/${Math.Calc[@TotalAAearned/${Math.Calc[@ReportInterval*@Counter]}]}]} minutes
/echo Next LVL In ${Math.Calc[${Math.Calc[100-${Me.PctExp}]}/${Math.Calc[@TotalLVLearned/${Math.Calc[@ReportInterval*@Counter]}]}]} minutes

/varset Report ${Math.Calc[@ReportInterval*600]}
/varset LastLvlExp ${Me.PctExp}
| /varset StartLvl ${Me.Level}
/varset LastAAExp ${Me.PctAAExp}
| /varset StartAA ${Me.AAPoints}
/varadd Counter 1
/return

Sub Event_CastResist
/echo target resisted.
/delay 20
/return

Sub Event_leadercheck
/echo " someone left grp"
/return


| --> End of Events
| --> End of Macros


=====================================

It will also display a report for the XP and will med when you mana gets low.

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Mon Apr 26, 2004 5:22 pm

Isn't there a RTFM on how to post code?

fantum409
a ghoul
a ghoul
Posts: 141
Joined: Fri Nov 14, 2003 10:03 pm

Post by fantum409 » Mon Apr 26, 2004 8:17 pm

Here it is, formatted by vc6, but I dont know if thats an acceptable way to do it once formatting is lost by posting as text...

Anyway, I get an error when I run it. Invalid mathcalc at line 37.

Code: Select all

|----------------------------------------------------------------------------| 
#include SPELLCAST.inc 
#Event SLAINBY "You have been slain by " 
#Event EXP "You gain " 
#Event Enraged "has become ENRAGED" 
#Event rampaged "goes on a RAMPAGE" 
#Event offrampaged "is no longer RAMPAGE" 
#Event Offrage "is no longer enraged" 
#Event CastResist "Your target resisted " 
#Event LeaderCheck "has left the group" 
#chat group 
#turbo 380 

/ECHO =+= Slothy's AutoNuke Macro Enabled =+= 
/ECHO =+= Version Realease: 0.1b =+= 
/ECHO =+= Usage: /Macro AFNuke <Tank name> =+= 
Sub Main 

/declare ReportInterval Global 
/declare Report Timer 
/declare StartLvlExp Global 
/declare StartLvl Global 
/declare StartAAExp Global 
/declare StartAA Global 
/declare LastAAExp Global 
/declare LastLvlExp Global 
/declare TotalLVLearned Global 
/declare TotalAAearned Global 
/declare Counter Global 
/varset Counter 1 
/varset StartLvlExp ${Me.PctExp} 
/varset StartLvl ${Me.Level} 
/varset LastLvlExp ${Me.PctExp} 
/varset LastAAExp ${Me.PctAAExp} 
/varset StartAAExp ${Me.PctAAExp} 
/varset StartAA ${Me.AAPoints} 
/varset Report ${Math.Calc[@ReportInterval*600]} 


/varset ReportInterval 10 

/echo [${Time.Time12}] ExpMon running. Will report every @ReportInterval minute(s) 

|-----------------(Tank Declaration Flag=1)--------- 
/declare tankname global 

|-----------------(Casting Flags=6)----------------- 
/declare Casteagle_Flag global 
/declare Castsot_Flag global 
/declare Castsotp_Flag global 

|-----------------(Engage Flag=3)------------------- 
/declare engagedistance global 
/declare engagedmob global 
/declare mobhealth global 

|-----------------(Experience Flags=11)------------- 
/declare mobname global 

|-(Amount of flags have to equal Amount of variable) 
|----------------(Current Amount=21)---------------- 
|----------------(Variable Initialized)------------- 
/varset engagedistance 200 | How close mob must be To engage 
/varset mobhealth 80 | Mob health before engage 
/varset tankname @Param0 | Assigns Param0 to variable 
/varset engagedmob 0 | Flag to check if mob is engaged 
/varset mobname 0 
/varset Casteagle_Flag 0 
/varset Castsotp_Flag 0 
:Mainloop 
/Call Medtime 
/call Combatcheck 
/doevents 
/delay 1s 
/goto :mainloop 
/return 

| --> This sub command is a switch to check for mob target 
| --> This sub command also checks for your own health 
Sub Combatcheck 
/Echo Your Main Assist is @tankname 
/If (@engagedmob==1) { 
	/assist @tankname 
		/call Nuke 
} 

/if (@engagedmob==0) /goto :stopfiring 
:stopfiring 
/doevents 
/assist @tankname 
/delay 5 
/if (${Target.Type.Equal[NPC]}) { 
	| /Echo ${Target.CleanName} Is at the distance of: ${Target.Distance} 
	| /Echo ${Target.CleanName} Is considered an ${Target.Race} 
	/varset mobname ${Target.Name} 
	/face 
		/delay 3 
		/if (${Target.PctHPs}<=@mobhealth) /if (${Target.Distance}<@engagedistance) /goto :DoubleCheck 
		
		:DoubleCheck 
		/doevents 
		/delay 3 
		/if (${Target.Distance}>@engagedistance) /goto :stopfiring 
		/if (${Target.PctHPs}>=@mobhealth) /goto :stopfiring 
		/if (${Target.PctHPs}<=@mobhealth) /if (${Target.Distance}<@engagedistance) /goto :fire 
		
		:fire 
		/doevents 
		|/Echo Autofire Engaged at the distance of: ${Target.Distance} 
	/varset engagedmob 1 
		/call nuke 
} 

/if (${Target.Type.NotEqual[NPC]}) { 
	/delay 5s 
		/varset engagedmob 0 
		/goto :stopfiring 
} 

/if (${Target.Type.Equal[NULL]}) { 
	/delay 5s 
		/varset engagedmob 0 
		/goto :stopfiring 
} 

/return 

| --> Loop for arrows, and also adjusts for distance of mobs usually 
| --> This loop also checks for snaring the mob at 91% 
Sub Nuke 
:nukeloop 
/doevents 
/keypress forward 
/if (${Target.Type.NotEqual[NULL]}) { 
	/face fast 
		|/gsay "${Target.CleanName} is about to become very cold. " 
		/Call Cast "Pillar of Frost" |Change arrow button To your own 
		/delay 20 
} 

/if (${Target.Type.NotEqual[NPC]}) { 
	/varset engagedmob 0 
		/delay 1s 
		/call Combatcheck 
} 
/If (${Target.ID}==0) { 
	/varset engagedmob 0 
		/delay 1s 
		/Call MedTime 
		
		/echo test 
		/return 
} 
|/If (${Target.Type.Equal[Null]}) { 
	/varset engagedmob 0 
		/delay 1s 
		
		/Call Combatcheck 
} 

/goto :nukeloop 
/return 

Sub MedTime 
/echo Meditating. 
/doevents 
:medup 
/doevents 
/delay 1s 
/newif (${String[${Me.State}].Equal[STAND]}==1) { 
	/sit 
} 
/delay 7 
/If (${Me.PctMana}<=70) { 
	| /echo mana Is still too low. Meditating again.. 
		/goto :medup 
} 
/echo GTG "${Me.PctMana}" 

/return 

Sub Event_rampage 
/delay 100 
/return 

Sub Event_EXP 
/varset mobname 0 
/return 

Sub Event_SLAINBY 
/Echo You Died, macro over, so sad to see you go 
/q 
/endmacro 
/return 

Sub Event_Timer() 
/declare LVLearned local 
/declare AAearned local 
/varset TotalLVLearned ${Math.Calc[${Math.Calc[${Me.PctExp}-@StartLvlExp]}+${Math.Calc[${Math.Calc[${Me.Level}-@StartLvl]}*100]}]} 
/varset TotalAAearned ${Math.Calc[${Math.Calc[${Me.PctAAExp}-@StartAAExp]}+${Math.Calc[${Math.Calc[${Me.AAPoints}-@StartAA]}*100]}]} 
/varset LVLearned ${Math.Calc[${Math.Calc[${Me.PctExp}-@LastLvlExp]}]} 
/varset AAearned ${Math.Calc[${Math.Calc[${Me.PctAAExp}-@LastAAExp]}]} 

/echo ----------------------------------------------------------- 
/echo [${Time.Time12}] LVL: ${Me.PctExp} (@LVLearned%, ${Math.Calc[@TotalLVLearned/${Math.Calc[@ReportInterval*@Counter]}]}%/min , ${Math.Calc[${Math.Calc[@TotalLVLearned/${Math.Calc[@ReportInterval*@Counter]}]}*60]}%/hr] 
										  | /echo [${Time.Time12}] AA: ${Me.PctAAExp} (@AAearned%, ${Math.Calc[@TotalAAearned/${Math.Calc[@ReportInterval*@Counter]}]}%/min , ${Math.Calc[${Math.Calc[@TotalAAearned/${Math.Calc[@ReportInterval*@Counter]}]}*60]}%/hr] 
										  |/echo Next AA In ${Math.Calc[${Math.Calc[100-${Me.PctAAExp}]}/${Math.Calc[@TotalAAearned/${Math.Calc[@ReportInterval*@Counter]}]}]} minutes 
										  /echo Next LVL In ${Math.Calc[${Math.Calc[100-${Me.PctExp}]}/${Math.Calc[@TotalLVLearned/${Math.Calc[@ReportInterval*@Counter]}]}]} minutes 
										  
										  /varset Report ${Math.Calc[@ReportInterval*600]} 
/varset LastLvlExp ${Me.PctExp} 
| /varset StartLvl ${Me.Level} 
/varset LastAAExp ${Me.PctAAExp} 
| /varset StartAA ${Me.AAPoints} 
/varadd Counter 1 
/return 

Sub Event_CastResist 
/echo target resisted. 
/delay 20 
/return 

Sub Event_leadercheck 
/echo " someone left grp" 
/return 


| --> End of Events 
| --> End of Macros 

Preocts
a snow griffon
a snow griffon
Posts: 312
Joined: Thu Jan 29, 2004 1:02 pm

Post by Preocts » Mon Apr 26, 2004 8:24 pm

yay, someone who can use the code brackets.

You're getting an error with that first math.calc because your @ReportInterval has never been set to anything. How do you multiply NULL by 600? :wink:

fantum409
a ghoul
a ghoul
Posts: 141
Joined: Fri Nov 14, 2003 10:03 pm

Post by fantum409 » Mon Apr 26, 2004 8:55 pm

Thanks. I switched the /varset ReportInterval 10 and the /varset Report ${Math.Calc[@ReportInterval*600]} lines around so it knows what reportinterval is when it goes to calc something with it. hehe.
decent macro at a glance, will be testing tonight. Thanks for ythe help guys.

unknwon
orc pawn
orc pawn
Posts: 10
Joined: Tue Mar 02, 2004 11:18 am

Sorry, just start posting this week...:(

Post by unknwon » Tue Apr 27, 2004 11:28 am

Code: Select all

|----------------------------------------------------------------------------| 
#include SPELLCAST.inc 
#Event SLAINBY  "You have been slain by " 
#Event EXP   "You gain " 
#Event Enraged "has become ENRAGED"
#Event rampaged "goes on a RAMPAGE" 
#Event offrampaged "is no longer RAMPAGE" 
#Event Offrage "is no longer enraged" 
#Event CastResist "Your target resisted " 
#Event LeaderCheck "has left the group"
#chat group
#chat raid
#turbo 380 

/ECHO  =+= Slothy's AutoNuke Macro Enabled =+= 
   /ECHO  =+= Version Realease: 0.1b =+= 
   /ECHO  =+= Usage:  /Macro AFNuke <Tank name> =+=
Sub Main 
   
  /declare ReportInterval Global 
  /declare Report Timer 
  /declare StartLvlExp Global 
  /declare StartLvl Global 
  /declare StartAAExp Global 
  /declare StartAA Global 
  /declare LastAAExp Global 
  /declare LastLvlExp Global 
  /declare TotalLVLearned Global 
  /declare TotalAAearned Global 
  /declare Counter Global 
 /varset Counter 1 
  /varset StartLvlExp ${Me.PctExp} 
  /varset StartLvl ${Me.Level} 
  /varset LastLvlExp ${Me.PctExp} 
  /varset LastAAExp ${Me.PctAAExp} 
  /varset StartAAExp ${Me.PctAAExp} 
  /varset StartAA ${Me.AAPoints} 
  /varset Report ${Math.Calc[@ReportInterval*600]} 

 
     /varset ReportInterval 10 

/echo [${Time.Time12}] ExpMon running. Will report every @ReportInterval minute(s) 

|-----------------(Tank Declaration Flag=1)--------- 
   /declare tankname global 

|-----------------(Casting Flags=6)----------------- 
   /declare Casteagle_Flag global 
   /declare Castsot_Flag global 
   /declare Castsotp_Flag global 

|-----------------(Engage Flag=3)------------------- 
   /declare engagedistance global 
   /declare engagedmob global 
   /declare mobhealth global 

|-----------------(Experience Flags=11)------------- 
   /declare mobname global 

|-(Amount of flags have to equal Amount of variable) 
|----------------(Current Amount=21)---------------- 
|----------------(Variable Initialized)------------- 
   /varset engagedistance 200      | How close mob must be To engage 
   /varset mobhealth 80     | Mob health before engage 
   /varset tankname @Param0   | Assigns Param0 to variable 
   /varset engagedmob 0      | Flag to check if mob is engaged 
   /varset mobname 0 
   /varset Casteagle_Flag 0 
   /varset Castsotp_Flag 0 
   :Mainloop
   /Call Medtime 
   /call Combatcheck 
   /doevents 
   /delay 1s 
   /goto :mainloop 
/return 

| --> This sub command is a switch to check for mob target 
| --> This sub command also checks for your own health 
Sub Combatcheck 
   /Echo Your Main Assist is @tankname 
   /If (@engagedmob==1) { 
      /assist @tankname 
      /call Nuke 
   } 

   /if (@engagedmob==0) /goto :stopfiring 
   :stopfiring 
   /doevents 
   /assist @tankname 
   /delay 5 
   /if (${Target.Type.Equal[NPC]}) { 
     | /Echo ${Target.CleanName} Is at the distance of: ${Target.Distance} 
     | /Echo ${Target.CleanName} Is considered an ${Target.Race} 
      /varset mobname ${Target.Name} 
      /face 
      /delay 3 
      /if (${Target.PctHPs}<=@mobhealth) /if (${Target.Distance}<@engagedistance) /goto :DoubleCheck 

      :DoubleCheck 
      /doevents 
      /delay 3 
      /if (${Target.Distance}>@engagedistance) /goto :stopfiring 
      /if (${Target.PctHPs}>=@mobhealth) /goto :stopfiring 
      /if (${Target.PctHPs}<=@mobhealth) /if (${Target.Distance}<@engagedistance) /goto :fire 

      :fire 
      /doevents 
      |/Echo Autofire Engaged at the distance of: ${Target.Distance} 
      /varset engagedmob 1 
      /call nuke 
   } 

   /if (${Target.Type.NotEqual[NPC]}) { 
      /delay 5s 
      /varset engagedmob 0 
      /goto :stopfiring 
   } 

   /if (${Target.Type.Equal[NULL]}) { 
      /delay 5s 
      /varset engagedmob 0 
      /goto :stopfiring 
   } 

/return 

| --> Loop for arrows, and also adjusts for distance of mobs usually 
| --> This loop also checks for snaring the mob at 91% 
Sub Nuke 
   :nukeloop 
   /doevents 
   /keypress forward 
   /if (${Target.Type.NotEqual[NULL]}) { 
      /face fast 
	|/gsay "${Target.CleanName} is about to become very cold. :)" 
      /Call Cast "Pillar of Frost"      |Change arrow button To your own 
	/delay 20  
   } 
	
   /if (${Target.Type.NotEqual[NPC]}) { 
      /varset engagedmob 0 
      /delay 1s 
      /call Combatcheck 
   } 
/If (${Target.ID}==0) {
/varset engagedmob 0 
      /delay 1s 
 	/Call MedTime

	/echo test
	/return 
}
   |/If (${Target.Type.Equal[Null]}) { 
      /varset engagedmob 0 
      /delay 1s 
      
            /Call Combatcheck 
   } 

   /goto :nukeloop 
/return 

Sub MedTime 
   /echo  Meditating. 
   /doevents 
    :medup 
   /doevents 
   /delay 1s 
   /newif (${String[${Me.State}].Equal[STAND]}==1) { 
      /sit
   }   
    /delay 7 
   /If (${Me.PctMana}<=70) { 
     | /echo mana Is still too low.  Meditating again.. 
      /goto :medup 
   } 
    /echo GTG "${Me.PctMana}"

/return 

Sub Event_rampage
 /delay 100
/return

Sub Event_EXP 
   /varset mobname 0 
/return 

Sub Event_SLAINBY 
   /Echo You Died, macro over, so sad to see you go  
   /q 
   /endmacro 
/return 

Sub Event_Timer() 
  /declare LVLearned local 
  /declare AAearned local 
  /varset TotalLVLearned ${Math.Calc[${Math.Calc[${Me.PctExp}-@StartLvlExp]}+${Math.Calc[${Math.Calc[${Me.Level}-@StartLvl]}*100]}]} 
  /varset TotalAAearned ${Math.Calc[${Math.Calc[${Me.PctAAExp}-@StartAAExp]}+${Math.Calc[${Math.Calc[${Me.AAPoints}-@StartAA]}*100]}]} 
  /varset LVLearned ${Math.Calc[${Math.Calc[${Me.PctExp}-@LastLvlExp]}]} 
  /varset AAearned ${Math.Calc[${Math.Calc[${Me.PctAAExp}-@LastAAExp]}]} 
    
  /echo ----------------------------------------------------------- 
  /echo [${Time.Time12}] LVL: ${Me.PctExp} (@LVLearned%, ${Math.Calc[@TotalLVLearned/${Math.Calc[@ReportInterval*@Counter]}]}%/min , ${Math.Calc[${Math.Calc[@TotalLVLearned/${Math.Calc[@ReportInterval*@Counter]}]}*60]}%/hr] 
 | /echo [${Time.Time12}] AA: ${Me.PctAAExp} (@AAearned%, ${Math.Calc[@TotalAAearned/${Math.Calc[@ReportInterval*@Counter]}]}%/min , ${Math.Calc[${Math.Calc[@TotalAAearned/${Math.Calc[@ReportInterval*@Counter]}]}*60]}%/hr] 
  |/echo Next AA In ${Math.Calc[${Math.Calc[100-${Me.PctAAExp}]}/${Math.Calc[@TotalAAearned/${Math.Calc[@ReportInterval*@Counter]}]}]} minutes 
  /echo Next LVL In ${Math.Calc[${Math.Calc[100-${Me.PctExp}]}/${Math.Calc[@TotalLVLearned/${Math.Calc[@ReportInterval*@Counter]}]}]} minutes 

  /varset Report ${Math.Calc[@ReportInterval*600]} 
  /varset LastLvlExp ${Me.PctExp} 
|  /varset StartLvl ${Me.Level} 
  /varset LastAAExp ${Me.PctAAExp} 
|  /varset StartAA ${Me.AAPoints} 
  /varadd Counter 1 
/return 

Sub Event_CastResist 
   /echo target resisted.
   /delay 20
/return 

Sub Event_leadercheck
/echo " someone left grp"
/return


| --> End of Events 
| --> End of Macros
Have used this for 4 hours last with out problems...