Update Rogue-Assist.mac

Got a cool macro idea? Wanna request a macro? Here is the place for you!

Moderator: MacroQuest Developers

seph_yaro
a lesser mummy
a lesser mummy
Posts: 72
Joined: Sat Jul 26, 2003 1:12 pm

Update Rogue-Assist.mac

Post by seph_yaro » Mon Jan 26, 2004 3:26 am

With the newest zip, rogue-assist.mac does not work. I am not sure why, myself, except perhaps it has something to do with a bug someone mentioned in another forum, something about combat not returning the proper TRUE/FALSE tag.

Anyway, here's the code-

Code: Select all

|rogue-assist.mac 
|Rogue Melee assist macro. 
|version 3 
#Turbo 72 
#Event Enraged "has become ENRAGED" 
#Event Offrage "is no longer enraged" 

Sub Main 
   /declare RangeMin global 
   /declare RangeMax global 
   /declare FastRange global 
   /declare Combatstatus global 
   /declare CastTimer timer 
   /declare EnrageVar global 
   /declare DoHeal global 
   /declare HealItem global 
   /declare DoDisarm global 
|-------------------------------------- 
|Edit this to change autoheal 
   /varset DoHeal 0 
   /varset HealItem "Brigand's Chestguard" 
|Edit this to chang auto disarm 
   /varset DoDisarm 1 
|--------------------------------------- 
   /varset RangeMin @Param0 
   /varset RangeMax @Param1 
   /varset FastRange @Param2 
   /varset Combatstatus 0 
   /varset EnrageVar 0 
   :Mainloop 
   /call Combatcheck 
   /if @Combatstatus=="1" /call RangeSub 
   /if @Combatstatus=="1" /call Checkbehind 
   /if @Combatstatus=="1" /call Evadeit 
   /if @Combatstatus=="1" /call Disarmit 
   /if @Combatstatus=="1" /call Checkbehind 
   /if @Combatstatus=="0" /call Healthcheck 
   /doevents 
   /goto :Mainloop 
/return 


Sub Healthcheck 
   /if n @DoHeal==0 /return 
   /if $char(casting)=="TRUE" /return 
   /if $char(ismoving)=="TRUE" /return 
   /if n $char(hp,pct)<90 { 
      /if $combat!="TRUE" { 
         /if $target()=="FALSE" { 
            /delay 10s 
            /cast item "@HealItem" 
         } 
      } 
   } 
/return 



Sub Checkbehind 
   /if n $distance($calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10))<8 { 
      /if @Combatstatus=="1" /call Backstabit 
   } 
/return 

Sub Disarmit 
   /if n @DoDisarm==0 /return 
   /if n $char(ability,"Disarm")!=-2 { 
         /doability "Disarm" 
   }    
/return 

Sub Evadeit 
   /if n $char(ability,"Hide")!=-2 { 
      /if @Combatstatus=="1" { 
         /attack off 
         /doability "Hide" 
         /if @EnrageVar!="1" /attack 
      } 
   }    
/return 


Sub Backstabit 
   /if n $char(ability,"Backstab")!=-2 { 
      /if $target()=="TRUE" { 
         /face nolook fast 
         /delay 2 
         /doability "Backstab" 
      } 
   } 
/return 

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 
   /stand 
   /face nolook fast 
   /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 
      } 
   } 
   /stand 
   /face nolook fast
   /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

bob_the_builder
a hill giant
a hill giant
Posts: 275
Joined: Tue Jul 22, 2003 1:22 pm

Post by bob_the_builder » Mon Jan 26, 2004 12:28 pm

Code: Select all

/if $combat=="TRUE"
Correct, as of 1/17 zip combat is backwards

/echo $combat

Should show TRUE when not in combat. with recent 1/17 zip

Bob

seph_yaro
a lesser mummy
a lesser mummy
Posts: 72
Joined: Sat Jul 26, 2003 1:12 pm

Post by seph_yaro » Mon Jan 26, 2004 7:10 pm

I've managed to get this semi-working.
It will disarm, but will not evade or backstab.

Any clue why?

Gumby
a ghoul
a ghoul
Posts: 99
Joined: Sat Jan 24, 2004 5:27 pm

Post by Gumby » Wed Jan 28, 2004 7:05 pm

seph_yaro wrote:I've managed to get this semi-working.
It will disarm, but will not evade or backstab.

Any clue why?
Evade:

Original:

Code: Select all

Sub Evadeit 
   /if n $char(ability,"Hide")!=-2 { 
      /if @Combatstatus=="1" { 
         /attack off 
         /doability "Hide" 
         /if @EnrageVar!="1" /attack 
      } 
   }    
/return
Try this instead:

Code: Select all

Sub Evadeit 
   /if n $char(ability,"Hide")!=-2 { 
      /if n @Combatstatus==1 { 
         /attack off 
         /doability "Hide" 
         /if @EnrageVar!="1" /attack 
      } 
   }    
/return
Probably should get a little fancier (/if "$char(ismoving)"=="FALSE" for example on the hide call, blew evade in too many times without it in my scripts) but the original comparison looked busted (either remove the quotes and numeric it, or put quotes around both tho numeric imo more clear), should work now.

Backstabs the same issue. Original code:

Code: Select all

Sub Checkbehind 
   /if n $distance($calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10))<8 { 
      /if @Combatstatus=="1" /call Backstabit 
   } 
/return 
Don't make make any comparison for it though. The return on $char(ability,"backstab") won't ever change values no matter what you do... busted at least currently, no idea if it ever worked before. Simply /doability backstab and be done with it.

Assuming your Checkbehind math is good (and I'm not debugging it if it ain't :), simply:

Code: Select all

Sub Checkbehind 
   /if n $distance($calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10))<8 { 
      /if n @Combatstatus==1 /doability backstab
   } 
/return 
G

seph_yaro
a lesser mummy
a lesser mummy
Posts: 72
Joined: Sat Jul 26, 2003 1:12 pm

Post by seph_yaro » Thu Jan 29, 2004 6:17 am

Thanks, will test this when I get up and play in 8 or so hours from now.


It's not *my* script, I only use it. I think Grimjack wrote it, but he quit, and isn't updating anymore :(

seph_yaro
a lesser mummy
a lesser mummy
Posts: 72
Joined: Sat Jul 26, 2003 1:12 pm

Post by seph_yaro » Tue Feb 17, 2004 12:23 pm

*bump*


The combat portions of this script now appear to work correctly (See top post, original script), however, when you don't have a target, you s;owly walk backwards, this also happens when you target yourself, and when you have a target, say a nother group member, it follows them and tries to attack them.

Can anyone fix this? I simply odn't have the skill myself :(

MrSmallie
a hill giant
a hill giant
Posts: 167
Joined: Fri Oct 11, 2002 11:18 am

Post by MrSmallie » Tue Feb 17, 2004 1:17 pm

It shouldn't do anything like that if autoattack is off.
/if @Combatstatus=="0" /call Healthcheck

You could add in a check for /if $target(type)!="NPC" or you could just hit your autoattack key if you're going to change targets.
Me
[img]http://home.comcast.net/~mrsmallie/ches.JPG[/img]

phatlewtsomfg
decaying skeleton
decaying skeleton
Posts: 4
Joined: Sun Sep 12, 2004 8:00 pm

Post by phatlewtsomfg » Sun Sep 12, 2004 8:21 pm

*bump* need a rogue and monk auto follow macro for kiting, i have bad wrists its hard to do kite groups, if someone could PM me or post here some good macro's to follow mobs and use bs/hide sneak after fight ect.. thanks