Rogue.mac - updated Jay 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

User avatar
ap50
a snow griffon
a snow griffon
Posts: 425
Joined: Sun Aug 18, 2002 2:29 pm

Rogue.mac - updated Jay script

Post by ap50 » Sat Oct 11, 2003 4:42 pm

Just modified to bring in line with new variables, and the nopredict change.

Code: Select all

Rogue Script
| Program by Jay
| Updated by AP50
|
| Version 1.07   5/MAR/2004
|
| Usage: /macro autorogue <Tank Name>
|
| Changes for 1.02
|   - Added Sneakhide option
|   - Added BehindTarget check during enrage
|   - Added enrage var
|   - Added documentation
|   - Changed, You will not evade when mob is below 20%
| Changes for 1.03
|   - Added target engage delay
|   - Added target range check before engage
|   - Checks to make sure target is not a pet first
|   - Added an assist in the attack loop
| Changes for 1.04
|   - Added death check
| Changes for 1.05
|   - Updated for use with new variable system
| Changes for 1.06
|   - Just fixing the nopredict change
| Changes for 1.07
|	- Changed distance check to use $target(maxrange)
|	-    - changed back, work in progress.
|	- Fixed Counter Clockwise /if "n" statement

#Event Enraged "has become ENRAGED"
#Event Offrage "is no longer enraged"
#Event Slainby "You have been slain by"

#include routines.mac
#turbo @turboamount

Sub main

| ----- Trigger Declares ---------------------
/Declare assisthealth global
/Declare evaderefresh global
/Declare turboamount global
/Declare sneakhide global
/Declare engagedistance global

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

/Varset assisthealth   96   | Wait until mob is below this health trigger.
/Varset evaderefresh   105   | How long it takes till evade refreshes.
/Varset turboamount   380   | Turbo Amount, Change at your own risk.
/Varset sneakhide   1   | Sneak Hide between kills; 1 = Yes, 0 = No
/Varset engagedistance   150   | How close mob must be to engage

| ----- Variables ----------------------------
/Declare evadetimer   timer
/Declare checktimer   timer
/declare targetname   global
/Declare targetid   global
/Declare tankname   global
/Declare attacktarget   global
/Declare tempvar   global | Simple tempvar
/Declare behindtarget   global | 1 = True, 0 = False
/Declare targetenrage   global | 1 = True, 0 = False
/Declare prekillxp   global | Exp prior to kill
/Declare postkillxp   global | Exp after kill
/Declare xpdiff      global | Difference in Exp pre/post kill
/Declare xptillding   global | Exp till next level
/Declare prekillaaxp   global | AA Exp prior to kill
/Declare postkillaaxp   global | AA Exp after kill
/Declare aaxpdiff   global | Difference in AA Exp pre/post kill
/Declare mobstillding   global | Approx number of kills of this mob type till next level
/Declare mobtypekilled   global | Number of this mob type killed
/Declare mobdetail   array2 | Mob details array


   /echo "Auto Rogue Version 1.07 Starting"
   /varset tankname @Param0
   /echo "@tankname is assist tank."
   /varset tempvar 0
   /if n @sneakhide==1 {
      /doability "Sneak"
      /doability "Hide"
   }
   /goto :Wait
   /goto :Attack
/return

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

   /if n "$target(hp,pct)"<=@assisthealth /if n "$target(distance,noprodict)<@engagedistance" /if n "$target(pet)==0" /goto :DoubleCheck
   /Attack off
   /DoEvents
/goto :Wait

:DoubleCheck
   /delay 10
   /if n "$target(hp,pct)"<=@assisthealth /if n "$target(distance)<@engagedistance" /if n "$target(pet)==0" /goto :Attack
/goto :Wait

:Attack
   /doability "Sneak"
   /echo Fighting $target(name,clean). It is a level $target(level) $target(race).
   /varset prekillxp $char(exp)
   /varset prekillaaxp $char(aa,exp)
   /varset mobdetail(8,0) "$target(name,clean)"
   /varset mobdetail(1,1) $target(level)
   /varset mobdetail(1,2) $target(name)
   /varset mobdetail(1,3) $target(id)
   /varset targetname $target(name)
   /varset targetid $target(id)
   /varset evadetimer @evaderefresh
   /varset attacktarget 1
   /varset behindtarget 0
   /varset targetenrage 0
   /face
   /sendkey down up
   /if n @attacktarget==1 /attack on
:AttackLoop
   /assist @tankname

   /if "$target()"=="FALSE" /goto :AttackEnd
   /if "$target(id)"!="@targetid" /goto :AttackEnd

   /if n @targetenrage==1 /varset attacktarget @behindtarget
   /if n @attacktarget==1 /if n $target(distance)<$target(maxrange) /doability backstab
   /if n @attacktarget==1 /Attack on
   /if n @attacktarget==0 /Attack off

   /face fast
/if n $target(distance)>18 /sendkey down up |If target is farther then 18 move forward 
/if n $target(distance)<8 /sendkey down down |If target is closer then 8 move back 
/if n $target(distance)<13 /sendkey up up |If target is closer then 10 stop moving forward 
/if n $target(distance)>10 /sendkey up down |If target is farther then 9 stop moving back 
   /face fast
   /doevents
   /if n $target(distance)<$target(maxrange) /if n $target(distance)>$target(maxrange)  /goto :rotate
/goto :AttackLoop

:rotate
  | ----- Clockwise Rotate 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
  | ----- Counter Clockwise Rotate Check -----
   /if n $char(heading)>=180 /if n $calc($char(heading)-180)<=$target(heading) /if n $char(heading)>$calc($target(heading)+22.5) /goto :bscounter
   /if n $char(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 "@targetname has died"
   /call event_exp
   /sendkey up up
   /sendkey up down
   /sendkey up ctrl
   /varset attacktarget 0
   /varset tempvar 0
   /varset evadetimer 0
   /attack off
   /echo "Waiting for @tankname to select a new target..."
   /delay 10
   /if n @sneakhide==1 {
      /doability "Sneak"
      /doability "Hide"
   }
/goto :Wait

: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 called by /DoEvents -----

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_Timer
   /if n @Param0==1 /goto :timerEvade
/return

| *** Event Subs ***

:timerEvade
   /if n "$target(hp,pct)">=30 {
      /sendkey up up
      /sendkey up down
      /attack off
      /delay 3
      /doability Hide
      /if n @attacktarget==1 /attack on
   }
   /varset evadetimer evaderefresh
/return

|#Exp Comparison Event
sub event_exp
/delay 1s

/varset postkillxp $char(exp)
/varset postkillaaxp $char(aa,exp)
/varcalc xpdiff @postkillxp-@prekillxp
/varcalc aaxpdiff @postkillaaxp-@prekillaaxp
/varcalc xptillding 100-$char(exp)
/varcalc mobstillding @xptillding/@xpdiff
  /if n @xpdiff>0 {
  /echo and you've gained @xpdiff% exp and @aaxpdiff% AA exp, bringing your total exp to $char(exp)% and your AA exp to $char(aa,exp)%!!
   |#Read npc.ini for any entries of last target. (comment from here to next !! area to stop INI saving)
   /if n $ini(npc.ini,"$zone","@mobdetail(8,0)")=="notfound" {
    /varset mobtypekilled 0
   } else {
    /varset mobtypekilled $ini(npc.ini,"$zone","@mobdetail(8,0)")
   }
   /varcalc mobtypekilled @mobtypekilled+1
   |#Save the data in npc.ini
   /ini npc.ini "$zone" "@mobdetail(8,0)" @mobtypekilled
   |!!
   /echo Don't forget, @xptillding% left till level, with only @mobstillding of these mobs to kill.
    |#display npc.ini data. (comment from here to next !! area to stop INI saving)
    /if n @mobtypekilled==1.00 {
     /echo This is your first kill of @mobdetail(8,0) in $zone.
    } else {
     /echo You've have killed @mobdetail(8,0) a total of $int(@mobtypekilled) times in $zone.
    }
    |!!
   /varset mobtypekilled 0
  } else {
|# Below handles when you don't get exp or just dinged
  /echo Exp remains at $char(exp)% and AA exp remains at $char(aa,exp)% after kill.
  }
/return
Last edited by ap50 on Fri Mar 05, 2004 8:46 am, edited 5 times in total.
[color=yellow][size=92][b]Just because you're paranoid, it doesn't mean everyone isn't out to get you![/b][/size][/color]

Epsilon
a lesser mummy
a lesser mummy
Posts: 61
Joined: Wed Apr 30, 2003 5:46 pm

Post by Epsilon » Sat Oct 11, 2003 4:58 pm

!!

best autorogue script ever !
i cried rivers when it stopped working for me :cry:

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

Is it possible to...

Post by TI994a » Mon Oct 13, 2003 12:31 pm

This is my favorite script! I love using this when 2 or 3-boxing my rogue.

That being said, I've gotten to where I really miss having the exp messages this macro puts out on my other chars.

Is it possible to extract and run just the xp reporting as it's own macro? If possible, it should also work whether or not the character ever targets the mob he/she just got xp from (sometimes I group with a char, and just sit them down, and I do all the killing, etc, and just let them leech xp from me).

serberus
a lesser mummy
a lesser mummy
Posts: 58
Joined: Tue Nov 19, 2002 5:04 am

exp track ripped

Post by serberus » Mon Oct 13, 2003 3:35 pm

Ripped out the exp tracking bit, only works like before, won't do it for your other char.

Code: Select all

Sub main

/Declare targetname global
/Declare targetid global
/Declare attacktarget global
/Declare tempvar global
/Declare prekillxp global
/Declare postkillxp global
/Declare xpdiff global
/Declare xptillding global
/Declare prekillaaxp global
/Declare postkillaaxp global
/Declare aaxpdiff global
/Declare mobstillding global
/Declare mobtypekilled global
/Declare mobdetail array2

/varset tempvar 0
/goto :Wait
/return

:Wait
/if "$target()"=="FALSE" {
/goto :Wait
}
/if "$target(type)"!="NPC" {
/goto :Wait
}
/if n @tempvar!="$target(hp,pct)" /echo $target(name,clean) Distance: $target(distance) Level: $target(level)
/varset tempvar "$target(hp,pct)"

/goto :Attack

:Attack
/varset prekillxp $char(exp)
/varset prekillaaxp $char(aa,exp)
/varset mobdetail(8,0) "$target(name,clean)"
/varset mobdetail(1,1) $target(level)
/varset mobdetail(1,2) $target(name)
/varset mobdetail(1,3) $target(id)
/varset targetname $target(name)
/varset targetid $target(id)

:AttackLoop
/if "$target()"=="FALSE" /goto :AttackEnd
/if "$target(id)"!="@targetid" /goto :AttackEnd
/goto :AttackLoop

:AttackEnd
/call event_exp
/varset tempvar 0
/goto :Wait

sub event_exp
/varset postkillxp $char(exp)
/varset postkillaaxp $char(aa,exp)
/varcalc xpdiff @postkillxp-@prekillxp
/varcalc aaxpdiff @postkillaaxp-@prekillaaxp
/varcalc xptillding 100-$char(exp)
/varcalc mobstillding @xptillding/@xpdiff
/if n @xpdiff>0 {
/echo Gain: Reg: @xpdiff% AA: @aaxpdiff% AA
/echo Total: Reg: $char(exp)% AA: $char(aa,exp)%!!
/if n $ini(npc.ini,"$zone","@mobdetail(8,0)")=="notfound" {
/varset mobtypekilled 0
} else {
/varset mobtypekilled $ini(npc.ini,"$zone","@mobdetail(8,0)")
}
/varcalc mobtypekilled @mobtypekilled+1
/ini npc.ini "$zone" "@mobdetail(8,0)" @mobtypekilled
/echo XP2Ding: @xptillding% Kills2Ding: @mobstillding
/if n @mobtypekilled==1.00 {
/echo First Kill: @mobdetail(8,0) - $zone.
} else {
/echo Kill Count: @mobdetail(8,0) ($int(@mobtypekilled)) - $zone.
}
/varset mobtypekilled 0
} else {
/echo Exp Unchanged: Reg $char(exp)% AA $char(aa,exp)%
}
/return

MacDad
decaying skeleton
decaying skeleton
Posts: 6
Joined: Mon Oct 20, 2003 3:48 pm

Example?

Post by MacDad » Mon Oct 20, 2003 3:51 pm

Can someone post an example of the commands you use for this and the results?

/macro rogue default <tankname> only assists and follows, but it doesn't position me behind the mob or in range. No BS, etc. Obviously I'm leaving commands out, but I could not discern which from the .mac.

Thanks much for the help.

Abby Normal

Usage

Post by Abby Normal » Tue Oct 21, 2003 12:03 am

From the top of the script:

Code: Select all

Usage: /macro autorogue <Tank Name>
Take out the word "default" and you will be ok.

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Tue Feb 17, 2004 1:35 pm

I noticed with this script, that with smaller mobs, sometimes the player will backup too far when trying to maneuver aroudn it and wont be close enough to hit it..although its popping up (you are too far from the mob..blah blah) the script doesnt correct itself to get closer? I've modified the distance code and it doesnt seem to help :P

Any idea on how to fix this at all? or do i just have to deal with it and just push up key myself once in a while hehe

THanks for any ideas/help

Draekz

oneoneone
a lesser mummy
a lesser mummy
Posts: 30
Joined: Mon Jan 26, 2004 5:52 am

Post by oneoneone » Wed Feb 18, 2004 5:34 am

Does this still work? Looks great.

kkmonte
orc pawn
orc pawn
Posts: 23
Joined: Sat Dec 14, 2002 2:52 pm

Post by kkmonte » Sun Feb 29, 2004 10:58 pm

Yea this script works awesome.. except for when mob has a small hitbox. I also tried modifying these lines.

/face fast
/if n $target(distance)>18 /sendkey down up |If target is farther then 18 move forward
/if n $target(distance)<8 /sendkey down down |If target is closer then 8 move back
/if n $target(distance)<13 /sendkey up up |If target is closer then 10 stop moving forward
/if n $target(distance)>10 /sendkey up down |If target is farther then 9 stop moving back


I tried changing them to :

/face fast
/if n $target(distance)>18 /sendkey down up |If target is farther then 18 move forward
/if n $target(distance)<5 /sendkey down down |If target is closer then 8 move back
/if n $target(distance)<8 /sendkey up up |If target is closer then 10 stop moving forward
/if n $target(distance)>9 /sendkey up down |If target is farther then 9 stop moving back

and it seemed to work a little but not really.. some mobs it just would be out of range alot.. anyone have any ideas?

Thx
kkmonte

GD
a snow griffon
a snow griffon
Posts: 353
Joined: Sat Jun 29, 2002 11:57 pm

Post by GD » Mon Mar 01, 2004 12:09 am

use $target(maxrange) to get a variable max range?
Opinions are like assholes, everyone has one, but most of them stink.

oneoneone
a lesser mummy
a lesser mummy
Posts: 30
Joined: Mon Jan 26, 2004 5:52 am

Post by oneoneone » Mon Mar 01, 2004 2:47 am

works amazingly well

Ahroun
orc pawn
orc pawn
Posts: 10
Joined: Wed Feb 18, 2004 10:56 pm

Post by Ahroun » Fri Mar 05, 2004 3:50 am

Unless i screwed something up the evade dose not work, can some one look at this i dont see why its not.

vzfef
decaying skeleton
decaying skeleton
Posts: 5
Joined: Mon Mar 01, 2004 4:30 am

Post by vzfef » Fri Mar 05, 2004 5:54 am

Shouldn't that be

Code: Select all

| ----- Counter Clockwise Rotate Check -----
   /if n $char(heading)>=180 /if n $calc($char(heading)-180)<=$target(heading) /if [color=red]n[/color] $char(heading)>$calc($target(heading)+22.5) /goto :bscounter 

OnyxSkyDV
a lesser mummy
a lesser mummy
Posts: 46
Joined: Wed Sep 18, 2002 1:02 pm

Using this to @box Necro and Rogue

Post by OnyxSkyDV » Mon Mar 08, 2004 3:35 pm

I tried this out, with me on my necro and the rogue assisting the pet, and the fight went perfectly, but after the fight the roge stood there staring at the mob's body as opposed to following the pet back to the original guard spot (fearkiting).

Any idea why that is the case? (Am I wrong in assuming it should follow the pet which I set as the tank to assist?)

Thanks!

User avatar
ap50
a snow griffon
a snow griffon
Posts: 425
Joined: Sun Aug 18, 2002 2:29 pm

Post by ap50 » Mon Mar 08, 2004 5:37 pm

There is no anchor set in place for this macro, but just take a look at some of the other macro's if you wish it to do so.
[color=yellow][size=92][b]Just because you're paranoid, it doesn't mean everyone isn't out to get you![/b][/size][/color]