Monk Melee Mac

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

Losingteam
a lesser mummy
a lesser mummy
Posts: 75
Joined: Wed May 21, 2003 8:52 pm
Location: Chicago,Illinois

Monk Melee Mac

Post by Losingteam » Mon Jun 09, 2003 2:40 am

Below is a little creation not at all mine really. Part of it I 'borrowed form Macrokit. And the majority of it is 'borrowed' from Grimjack. I was hoping someone might be able to pin point the spot that I need to change. Right now when the target is lost. (IE: Hit ESC). The Macro ends, which is what I want it to do. But then after the macro ends it immediately turns auto attack on. I am looking to see where I need to add the /attack off command to fix this.

Code: Select all

| Melee.mac 
|I give credit to Grimjack and Macrokit as the source for the code used 
| This particular script is designed to be used in tandem with my getbehind script. 
| This is designed to be an always on script.  It will automaticly move to the mob that you have 
| targeted when you turn on attack. It will also auto evade, turn off/on attack for enrage, 
| If there are any improvments that you see can be made let me know please. 
| useage: 
|/macro rogue.mac [minimum distance to mob] [maximum distance to mob] [distance at which to move fast] 

#define RangeMin v50 
#define RangeMax v51 
#define FastRange v52 
#Turbo 72 
#define Combatstatus v60 
#define CastTimer t1 
#define EnrageVar v61 
#Event Enraged "has become ENRAGED" 
#Event Offrage "is no longer enraged" 

Sub Main 
   /varset RangeMin $p0 
   /varset RangeMax $p1 
   /varset FastRange $p2 
   /varset Combatstatus 0 
   /varset EnrageVar 0 
   :Mainloop 
   /call Combatcheck 
   /if $Combatstatus=="1" /call RangeSub 
   /if $Combatstatus=="1" /call Melee
   /doevents 
   /goto :Mainloop 
/return 


sub Melee
/varset a(8,3) $target(id)
/face
/sendkey down up
:CloserAF
  /if "$target(id)"!="$a(8,3)" /endmacro
  /if n $target(distance)>15 /sendkey down up
  /if n $target(distance)<6 /sendkey down down
  /if n $target(distance)<16 /sendkey up up
  /if n $target(distance)>5 /sendkey up down
  /if n $target(distance)<15 /attack on
  /if n $target(distance)>19 /attack off
  /face fast nopredict
  /if n $char(ability,"Flying Kick")>0 /doability "Flying Kick"
  /if n $char(ability,"Disarm")>0 /doability "Disarm"
  /goto :CloserAF

Sub Combatcheck 
   /if $EnrageVar=="1" { 
      /if $target()=="TRUE" { 
         /return 
      } else { 
         /varset EnrageVar 0 
         /varset Combatstatus 0 
      } 
   } 
   /if $target()=="FALSE" { 
      /varset Combatstatus 0 
      /if $combat=="TRUE" { 
         /attack off 
      } 
      /return 
   } 
   /if $target()=="TRUE" { 
      /if $combat=="TRUE" { 
         /varset Combatstatus 1 
         /return 
      } 
   } 
/varset Combatstatus 0 
/return

Sub Rangesub 
   /face fast nopredict 
   /if n $target(distance)>=$FastRange /call Fastmove 
   /if n $target(distance)>$RangeMax { 
      /press up 
   } 
   /if n $target(distance)<$RangeMin { 
      /press down 
   } 
/return 


Sub Event_Enraged 
   /if $target()=="TRUE" { 
      /varset EnrageVar 1 
      /attack off 
   } 
/return 

Sub Fastmove 
   :fastmoveloop 
   /if $target()=="FALSE" { 
      /varset Combatstatus 0 
      /sendkey up up 
      /if $combat=="TRUE" { 
         /attack off 
         /return 
      } 
   } 
   /face fast nopredict 
   /if n $target(distance)>$FastRange { 
      /sendkey down up 
      /attack off 
   } 
   /if n $target(distance)<=$FastRange { 
         /if $Combatstatus=="1" { 
            /if $EnrageVar=="0" { 
               /attack on 
            } 
         } 
      /sendkey up up 
      /return 
   } 
   /goto :fastmoveloop 
/return 

Sub Event_Offrage 
   /if $target()=="TRUE" { 
         /varset EnrageVar 0 
         /attack 
      } 
   } 
/return 
On a side note: My wish list for this macro is to get it to auto go behind. And if I get agro, to turn off attack, FD, wait 3 seconds, stand up . Thewn go back to what it was doing. But thats a later project. :) For now just hoping to add the /attack off command in the right spot.

PS: Grimjack, I still can't get your movebehind.mac to work right. Regardless of what I do it still goes chaotic running around in circles.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

movebehind

Post by grimjack » Mon Jun 09, 2003 3:29 am

This is my current movebehind script I use.

Code: Select all

#define RangeMin v50
#define RangeMax v51
#define FastRange v52

Change where it callse rogue to the name of your script.

Sub Main
   /varset RangeMin $p0
   /varset RangeMax $p1
   /varset FastRange $p2
   /attack off  
   /if $target()==FALSE { 
      /attack off
      /sendkey up up
      /macro newone $RangeMin $RangeMax $FastRange
   } 
   /if n $distance($calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10))<3 /goto :noneed
   /sendkey down up
   :gotopointloop 
   /if $combat=="TRUE" /attack off
   /if $target()==FALSE { 
      /attack off
      /sendkey up up
      /macro newone $RangeMin $RangeMax $FastRange
   } 
   /face fast loc $calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10) 
   /if n $distance($calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10))>1 /goto :gotopointloop 
   /sendkey up up 
   /face fast nopredict
:noneed
/attack on
/macro rogue $RangeMin $RangeMax $FastRange
/return

Losingteam
a lesser mummy
a lesser mummy
Posts: 75
Joined: Wed May 21, 2003 8:52 pm
Location: Chicago,Illinois

Post by Losingteam » Mon Jun 09, 2003 3:32 am

Alright. I'll give the movebehind macro another shot. Still dont know how to get it to not turn on auto attack when the mob dies. Right now it is running fine, mob dies, macro ends, auto attack turns on. I guess I can live with turning autoattack off manually. But still think it would be a quick fix to update the macro to stop that.

Losingteam
a lesser mummy
a lesser mummy
Posts: 75
Joined: Wed May 21, 2003 8:52 pm
Location: Chicago,Illinois

Post by Losingteam » Mon Jun 09, 2003 3:35 am

OK, was reading through the movebehind macro and came across.

Code: Select all

/macro newone $RangeMin $RangeMax $FastRange
Do I need to have a macro called newone? Cause I dont. I was confused by this line.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Mon Jun 09, 2003 3:41 am

Losingteam wrote:OK, was reading through the movebehind macro and came across.

Code: Select all

/macro newone $RangeMin $RangeMax $FastRange
Do I need to have a macro called newone? Cause I dont. I was confused by this line.
No you set that to the melee macro you use. Basicly when you call this one it will do it's thing then restart the normal melee macro you use.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Your attack problem.

Post by grimjack » Mon Jun 09, 2003 3:44 am

/if "$target(id)"!="$a(8,3)" /endmacro

should be

/if "$target(id)"!="$a(8,3)" {
/attack off
/endmacro
}

That is if you want it to end the macro when you lose a target and have attack off. I'm not real sure why you would want to end the macro though. The script is already designed to turn off attack and wait till attack is turned back on to do anything else when target is lost. I would just do this myself.

/if "$target()"=="FALSE"{
/attack off
/return
}

This would keep the macro running(waiting for you to target somthing and hit attack again) but turn off attack when your target is lost.

Thanks
GrimJack

DreamKing
a lesser mummy
a lesser mummy
Posts: 79
Joined: Tue Jun 10, 2003 12:29 am

Post by DreamKing » Tue Jun 10, 2003 12:41 am

I'm also took rogue.mac and have worked to modify it for a Monk. However, I'm fairly new at macro scripting so it's a slow process. I do have one question though since I am a pulling monk. When I throw a star at a mob it immediately seems to run at the mob and go into attack mode. Which was a rather unpleasant surprise the first time it happened. I'm guessing this has to do with CombatCheck thinking you've engaged the mob. Would you have any suggestions on how to make it work with pulling in mind so that it disregards throwing damage and waits for attack to be explicitly stated via attack key?

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Tue Jun 10, 2003 6:14 am

DreamKing wrote:I'm also took rogue.mac and have worked to modify it for a Monk. However, I'm fairly new at macro scripting so it's a slow process. I do have one question though since I am a pulling monk. When I throw a star at a mob it immediately seems to run at the mob and go into attack mode. Which was a rather unpleasant surprise the first time it happened. I'm guessing this has to do with CombatCheck thinking you've engaged the mob. Would you have any suggestions on how to make it work with pulling in mind so that it disregards throwing damage and waits for attack to be explicitly stated via attack key?
Unfortunatly $combat does not know if the combat is ranged or melee. I guess I could make it check on combat 4 or 5 times before turning on melee mode. Maybe somthing like this.
Add at the top

Code: Select all

#define CmbtCount v63
and replace the Combatcheck sub with this.

Code: Select all

Sub Combatcheck
   /if $EnrageVar=="1" {
      /if $target()=="TRUE" {
         /return
      } else {
         /varset EnrageVar 0
         /varset Combatstatus 0
      }
   }
   /if $target()=="FALSE" {
      /varset Combatstatus 0
      /varset CmbtCount 0
      /if $combat=="TRUE" {
         /attack off
      }
      /return
   }
   /if $target()=="TRUE" {
      /if $combat=="TRUE" {
          /if n $CmbtCount>10 {
             /varset Combatstatus 1
          }
          /if n $CmbtCount<=40 /varadd $CmbtCount 1
         /return
      }
       /delay 2
       /varset CmbtCount 0
   } 
You can play with this number.

Code: Select all

         /if n $CmbtCount>10

I'm at work so I can't test it. What it should do is make sure combat=true 10 times in a row before going into melee mode. With a ranged I would think it would only be true for a few seconds.

DreamKing
a lesser mummy
a lesser mummy
Posts: 79
Joined: Tue Jun 10, 2003 12:29 am

Post by DreamKing » Wed Jun 11, 2003 2:50 am

Thanks, I'll try that out. You may want to add stun check to your macro as well. It probably doesn't happen to rogues very often and only leads to a bit of spam but if you like things clean...


Ok, pasted it in. As soon as I target a mob I run to it. Too tired to look at it right now though.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Wed Jun 11, 2003 3:41 am

DreamKing wrote: Ok, pasted it in. As soon as I target a mob I run to it. Too tired to look at it right now though.
hmm. I did not test the code I posted. It was more of an idea to point you in a direction that might help than anything. It's not somthing I have a problem with so I don't plan on spending a ton of time with it. Without $combat knowing the difference between melee and ranged there isn't a lot of real good solutions for this. Another option is to rewrite the code that checks for combat so that it looks for melee messages instead of checking $combat.