Raid Monk Script

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

blakbelt
a lesser mummy
a lesser mummy
Posts: 70
Joined: Wed Aug 27, 2003 12:40 pm
Location: Scotland UK

Raid Monk Script

Post by blakbelt » Tue Oct 14, 2003 11:17 am

Heavily modified version of Jay's rogue script, awesome script and had everything i needed for my 2 boxed monk on raids. Have added a checkbuff for epic, the epic however should be hotkeyd to key 0 to ensure that the script works. Deleted the experience tracker as i dont require it.

Once again i take no credit for this script as i have stolen and modified...

Code: Select all

| usage: /macro raidmonk <Tank Name> 
| usage: /macro raidmonk <Tank Name>
| Thanks to Jay for his Rogue script of which this is a modified version. Great Job. All credit goes to Jay.

#Event Enraged &#8220;has become ENRAGED&#8221;
#Event Offrage &#8220;is no longer enraged&#8221;
#Event Slainby &#8220;You have been slain by&#8221;
#Event Hitme &#8220;hits YOU for &#8220;
#Event Engage &#8220;ENGAGE&#8221;

#turbo @turboamount

Sub Main

| -------- Trigger Details-----------------

/Declare assisthealth global
/Declare turboamount global
/Declare engageddistance global  |editted

| --------- Trigger Values----------------

/Varset turboamount     380		| Turbo Amount.
/Varset engageddistance   150		| How close mob must be to engage.

| ---------- Variables----------------------

/Declare targetname  global
/Declare targeted       global
/Declare tankname    global    	
/Declare attacktarget    global
/Declare haveaggro   global
/Declare tempvar   global
/Declare behindtarget   global
/Declare targetenrage  global
/Declare doengage     global

  /echo Raidmonk now operating&#8230;
     /varset tankname &#8220;@Param0&#8221;
     /echo &#8220;Assisting @tankname&#8221;
     /varset tempvar 0
     /goto :Wait
     /goto :Attack
/return

:Wait
/assist @tankname
/delay 5
/if "$target() &#8220;==&#8221;FALSE&#8221; {
  /target @tankname
  /face nopredict
  /goto :Wait
}
/if  &#8220;$target(type)&#8221;!=&#8221;NPC&#8221;  {
  /face nopredict
  /goto :Wait
}
/if n @tempvar != $target(hp,pct) 
/echo $target(name,clean) targeted at $target(hp,pct)% at distance $target(distance).
/varset tempvar &#8220;$target(hp,pct)&#8221;
/face nopredict


/if n $target(distance)<=@engagedistance;
    /if n $target(pet)==0
    /goto :DoubleCheck
    /Attack off
    /doevents
/goto :Wait  

:DoubleCheck
	/delay 10
	/if n @doengage==1
        	  /if n $target(distance)<@engagedistance
 	    /if n $target(pet)==0
 	       /goto :Attack

:Attack
	/echo attacking $target(name,clean) who has $target(hp,max) hp not bad for a level $target(level) $target(class).
	/varset targetname $target(name)
	/varset targeted $target(id)
	/varset attacktarget 1
	/varset behindtarget 0
	/varset targetenrage 0
	/face nopredict
	/sendkey down up
	/if n @attacktarget==1 /attack on

:Attackloop
	/assist @tankname

	/if &#8220;$target()&#8221;==&#8221;FALSE&#8221;
	/goto :AttackEnd
	/if &#8220;$target(id)&#8221;!=&#8221;@targeted&#8221;
	/goto :AttackEnd

	/if n @targetenrage==1 /varset attacktarget @behindtarget
	/if n @attacktarget==1 
	    /if n $target(distance)<18
	      /if n $char(ability,"Flying Kick")>0 
         /doability "Flying Kick"
/if n @attacktarget==1 /attack on
/if n @attacktarget==0 /attack off

/face fast nopredict
/if n $target(distance)>18 /sendkey down up
/if n $target(distance)<8 /sendkey down down
/if n $target(distance)<13 /sendkey up up
/if n $target(distance)>10 /sendkey up down

/face fast nopredict
/doevents
/if n $target(distance)<18 
    /if n $target(distance)>8
       /goto :Rotate
/goto :EpicCheck

:Rotate
	|---------Clockwise Check-----------------
	/if n $target(heading) >=180
                   /if n $calc($target(heading)-180)<=$char(heading)
                       /if n $char(heading)<$calc($target(heading)-22.5) 
                            /goto :bsclock
	/if n $target(heading)>=180 
                   /if n$char(heading)<=180
	        /if n $calc($char(heading)-22.5)>$calc($target(heading)-360)
	             /goto :bscounter
	/if n $target(heading)<=180
	     /if n $char(heading)<$calc($target(heading)-22.5)
	          /goto :bsclock

|----------Anticlockwise Check-------------
/if n $target(heading) >=180
                   /if n $calc($char(heading)-180)<=$target(heading)
                       /if n $char(heading)>$calc($target(heading)+22.5) 
                            /goto :bscounter
	/if n $target(heading)>=180 
                   /if n$target(heading)<=180
	        /if n $calc($char(heading)-157.5)<$calc($target(heading)+180)
	             /goto :bsclock
	/if n $char(heading)<=180
	     /if n $target(heading)<=180
	        /if n $char(heading)>$calc($target(heading)+25)
	          /goto :bscounter
	/varset behindtarget 1
/goto :AttackLoop

:AttackEnd
	/echo Its dead!!
	/sendkey up up
	/sendkey up down
	/sendkey up ctrl
	/varset attacktarget 0
	/varset tempvar 0
	/varset doengage 0
	/varset haveaggro 0
	/attack off
	/echo waiting for new target&#8230;
	/delay 10
/goto :Wait

:EpicCheck 
/for loop 1 to 15 
  /if "$char(buff,@loop)"!="Vallon's Quickening" 
      /if "$char(buff,@loop)"!="Speed of Vallon" 
         /if "$char(buff,@loop)!="Celestial Tranquility" 
            /press 0 
/goto :AttackLoop

:bsclock
	/sendkey down ctrl
	/sendkey down right
	/sendkey down up
	/sendkey up up
	/sendkey down down
	/sendkey up down
	/sendkey up right
	/sendkey up ctrl
	/press down
	/press ctrl
	/face
	/varset behindtarget 0
/goto :AttackLoop

:bscounter
	/sendkey down ctrl
	/sendkey down left
	/sendkey down up
	/sendkey up up
 	/sendkey down down
	/sendkey up down
	/sendkey up left
	/sendkey up ctrl
	/press down
	/press ctrl
	/face
	/varset behindtarget 0
/goto :AttackLoop

	
|--------------Events-----------------

Sub Event_Enraged
	/if n @behindtarget==0
	    /varset attacktarget 0
	        /varset targetenrage 1
	        /attack off
	/return

Sub Event_Offrage
	/varset targetenrage 0
	/varset attacktarget 1
	/attack on
/return

Sub Event_Slainby
	/endmacro
	/return

Sub Event_Engage
	/varset doengage 1
/return

Sub Event_Hitme
	/attack off
	/doability &#8220;Feign Death&#8221;
	/delay 20
	/stand
	/attack on
/return
	
I havent had chance to test this yet so if anyone can please lemme know how it functions. - editted x 2
Last edited by blakbelt on Thu Oct 16, 2003 3:07 pm, edited 6 times in total.
Blakbelt

TI994a
a ghoul
a ghoul
Posts: 87
Joined: Mon Oct 13, 2003 12:25 pm

Post by TI994a » Tue Oct 14, 2003 1:22 pm

Just pointing out typos...

Code: Select all

   /varset tankname "@ParamO" 
Should be @Param0 (#0, not letter O)

Code: Select all

   /if "$target() "==”FALSE” { 
FALSE is surrounded by reverse quotes. Not sure if this would work, safer to just substitute normal quotes. Same goes for multiple other places throughout the code, so won't keep showing those.

Code: Select all

/if n“$target(distance)<@engagedistance" 
   /if n "$target(pet)==0" 
Again, the quote is an issue. But, $target(distance) needs to be completely enclosed in quotes, rather than having quotes surround the entire comparison. IE, /if n "$target(distance)"<@engageddistance... Same goes for the following line.

Code: Select all

      /if n "$target(distance)<@engagedistance" 
      /if n "$target(pet)~O" 
See above fix.

Code: Select all

   Ivarset targeted $target(id) 
Typo... /varset instead of Ivarset

Code: Select all

  /if n @behindtarget 0 
No comparison operator here.

Not being picky, just trying to help for those who just cut and paste.

- TI

blakbelt
a lesser mummy
a lesser mummy
Posts: 70
Joined: Wed Aug 27, 2003 12:40 pm
Location: Scotland UK

Post by blakbelt » Tue Oct 14, 2003 1:43 pm

LOL cos i wrote it at work and had no disks to bring it home so i dumped into ocr ;/ wil amend those now

*EDITTED*
Blakbelt

kagonis
a hill giant
a hill giant
Posts: 228
Joined: Sat May 24, 2003 8:48 pm

Post by kagonis » Tue Oct 14, 2003 3:40 pm

As a good rule of thumb: Numerical comparisons shouldn't be in quotes, only strings.

Ie: if n "@foo"=="@bar" should just be if n @foo==@bar.

The n tells the if parser that it is working with a numerical value (or does it actually tell that it is working with an integer?).

Strings should be in quotes, the operator should not, ie: if "@foo"=="This is the content of the variable foo" got quotes around each string.

blakbelt
a lesser mummy
a lesser mummy
Posts: 70
Joined: Wed Aug 27, 2003 12:40 pm
Location: Scotland UK

Post by blakbelt » Tue Oct 14, 2003 4:47 pm

Thanks

Editted
Blakbelt

blamstick
orc pawn
orc pawn
Posts: 27
Joined: Sat Sep 06, 2003 6:50 pm

Post by blamstick » Tue Oct 14, 2003 8:54 pm

This looks pretty nice. I'll probably mess around with it later this week and toss in some
kind of event detection to also wait for an assist call before attacking. At most raids, people
and tanks usually don't appreciate it when you jump in and attack a mob before assist is called since
the tank wants to get a few hits in and build up some decent aggro.

I think this should work but I'm not near any system to check it but add it into the :Wait loop at some point.

Code: Select all

|Check whether the tank has called for assist

#Event AttackIt "Assist me and )(>>ATTACK<<)("   |Insert the tanks assist text between the quotes"


Sub Main
/Declare AttackCheck global
/Varset AttackCheck 0

:Wait
   /doevents AttackIt
   /if n @AttackCheck==0 /goto :Wait
.
.
.
:AttackEnd
   /Varset AttackCheck 0
/return


Sub Event_AttackIt
   /Varset AttackCheck 1
/return

blakbelt
a lesser mummy
a lesser mummy
Posts: 70
Joined: Wed Aug 27, 2003 12:40 pm
Location: Scotland UK

Post by blakbelt » Wed Oct 15, 2003 2:05 am

Blam look at the #event "ENGAGE" ;)

That is how our tanks call it...
Blakbelt

blamstick
orc pawn
orc pawn
Posts: 27
Joined: Sat Sep 06, 2003 6:50 pm

Post by blamstick » Wed Oct 15, 2003 6:27 am

Doh - I missed that. You rock, good job =) Can't wait to try it out!

hmmmmmmm

hmmm

Post by hmmmmmmm » Wed Oct 15, 2003 12:29 pm

/Varset engageddistance 150 | How close mob must be to engage.
Im getting problems when it comes to this, its saying bad variable

Also something that notices vallons quickening or speed of vallon so it doesnt try to use epic would be nice

User avatar
vladk
a ghoul
a ghoul
Posts: 122
Joined: Wed Oct 15, 2003 1:01 am

Re: hmmm

Post by vladk » Wed Oct 15, 2003 12:38 pm

hmmmmmmm wrote:
/Varset engageddistance 150 | How close mob must be to engage.
Im getting problems when it comes to this, its saying bad variable

Also something that notices vallons quickening or speed of vallon so it doesnt try to use epic would be nice

instead of /Declare engageddistance
do /Declare engageddistance global

the script doesn't work for me so I just wrote my own based on this/rogue :)

blakbelt
a lesser mummy
a lesser mummy
Posts: 70
Joined: Wed Aug 27, 2003 12:40 pm
Location: Scotland UK

Re: hmmm

Post by blakbelt » Wed Oct 15, 2003 2:11 pm

hmmmmmmm wrote:
Also something that notices vallons quickening or speed of vallon so it doesnt try to use epic would be nice
Try this just off hte top of my head:

Code: Select all

:EpicCheck
/for loop 1 to 15
  /if "$char(buff,@loop)"!="Vallon's Quickening"
      /if "$char(buff,@loop)"!="Speed of Vallon"
         /if "$char(buff,@loop)!="Celestial Tranquility"
            /press 0
/goto :AttackLoop

         
Should work again untested... Wish i wasnt working so hard at F work :/
Blakbelt

chimaera
a lesser mummy
a lesser mummy
Posts: 37
Joined: Fri Aug 01, 2003 4:14 pm

Post by chimaera » Thu Oct 16, 2003 5:41 am

Is the use of { and } no longer nessecary since you only used them a few times in this script ?

blakbelt
a lesser mummy
a lesser mummy
Posts: 70
Joined: Wed Aug 27, 2003 12:40 pm
Location: Scotland UK

Post by blakbelt » Thu Oct 16, 2003 7:09 pm

I think if you dont need an else statement then the use of { can be avoided unless you are nesting if, have checked this code out and its buggy but i have no idea where yet - follows target ok but doesnt do a lot else
Blakbelt

in_training
Craptastic
Posts: 115
Joined: Fri Oct 10, 2003 8:25 am

Post by in_training » Sat Oct 18, 2003 3:59 pm

yeah, It dosen't seem to be working properly. I hydra a monk, and this would really rock, if it worked.

Is there a way to set the "ENGAGE" as a param that is set? We have more then 10 tanks with more then 9000 hps, and they all like to use different Assist messages. Also, would allow for using in an Exp group.

blakbelt
a lesser mummy
a lesser mummy
Posts: 70
Joined: Wed Aug 27, 2003 12:40 pm
Location: Scotland UK

Post by blakbelt » Sun Oct 19, 2003 3:22 am

We too have lots of 9k tanks and yes they all do have different engage messages but the one thing common to them all is ENGAGE :)

I know this isnt working properly and when i get chance i will look at it - but i am no coding genius, i just take code and manipulate it to serve my needs ;)
Blakbelt