------------------------------------------------------
This macro plays the rogue for you. Great for two-boxing or carpal tunnel sufferers.
Features:
1. Sneak/Hide on load and between fights.
2. Set an anchor to return to between fights or follow a target (or group member).
3. Waits for mob health percentage to reach a value you specify before attacking.
4. Movement/Auto-attack/evade/backstab/discipline usage handled automatically.
5. Uses GenBot's getbehind code for moving behind a mob.
6. Stops discipline usage and refreshes endurance when you get low.
7. Stops attack on enrage, resuming when enrage is over.
8. Clutch nimble/escape based on your health pct.
9. GM detection for combat/movement loops.
Future Plans:
1. Fix collision detection in getbehind code.
2. Clickable item activation (based on buff timers).
3. Smart tank switching (for when group members change).
4. Request buffs from group members based on class/level/expy (lol, fun stuff).
PM me or reply here if you have any questions/comments/suggestions/bug reports/etc.
custom.inc
Code: Select all
| custom.inc
| Example include file for AutoRogue 2.0j
/declare sneakhide global | Sneak Hide between kills; 1 = Yes, 0 = No
/declare engagedistance global | How close the mob must be to engage, 0 = Infinite (note no collision detection)
/declare doabilityhide global | Set to your hide doability button
/declare usespecial global | Use disciplines, 1 = True, 0 = False
/declare discactive global | Flag prevents more than 1 offensive disc per fight
/declare nimblepct global | Use nimble disc when Me.PctHps < this, 0 = off
/declare escapepct global | Use escape ability when Me.PctHps < this, 0 = off
/declare healpausepct global | If nimble/escape triggered, wait till Me.PctHps > this, 100+ = off
/declare attackdiscpct global | Use duelist or deadly disc when Target.PctHps < this, 0 = off
/declare regenend global | 1 = On (regen endurance to 100%), 0 = off
/declare regenendpct global | Regen endurance to full when it gets low via $), 0 = off
/declare strikedisc global | Name of your best "strike" discipline (e.g. Assassin, Kyv, Ancient), 0 = off
/declare hiderefresh global | Based on hastened stealth aa, set between 75-105
/declare usejump global | Adds a jump when in collision detection loop. 0 = off
| <<< Custom Vars: Modify these according to your taste. >>>
/varset sneakhide 1
/varset engagedistance 300
/varset doabilityhide 1
/varset usespecial 1
/varset discactive 0
/varset nimblepct 35
/varset escapepct 20
/varset healpausepct 70
/varset attackdiscpct ${Math.Calc[@assisthealth-10]}
/varset regenend 0
/varset regenendpct 20
/varset strikedisc "Assass"
/varset hiderefresh 75
/varset usejump 1
Code: Select all
|AutoRogue 2.0j 4-25-2004
|----------------------------------------------------------------------
| Original AutoRogue by Jay.
| Credits to GrimJack for the getbehind and moveto logic from GenBot.
|
| Usage: /macro rogue.mac Assist HpPct AnchorBit Follow
|
| Examples:
| Assist tank at 95%
| /macro rogue.mac Happytank 95 0 (or leave the zero off)
|
| Assist tank at 95%, set anchor at current loc
| /macro rogue.mac Happytank 95 1
|
| Same as above but moveto/follow a target between fights
| /macro rogue.mac Happytank 95 2 Stationarycleric
|
| DON'T FORGET TO VIEW/MODIFY YOUR CUSTOM.INC FILE!!!
|
| Version History
| 2.0j - Getbehind working...again...
| 2.0i - Fixed the weird running in circles on anchor.
| Fixed the crazy wobble that getbehind would do in certain instances.
| Changed all /face nolook fast calls back to /face fast. Wasn't a good idea.
| Tweaked melee distance on chase.
| 2.0h - Bugfixes in GetBehind and the zonechange event.
| 2.0g - MQParm phase 2 conversion.
| 2.0f - Added GM detection (script will pause when gm in zone, resume after)
| 2.0e - Chase range improved!
| 2.0d - Fixed target moveto on engage. Set @strikedisc to 0 also available as option.
| 2.0c - Added delays to address crashing issue.
| 2.0b - Bugfixes (hopefully). The setanchor param is changed too (read above).
| 2.0a - Added follow distance and replaced depreciated /sendkey's.
| 2.0 - Added rogue offensive and defensive discipline usage option.
| Lots of code fixes/optimizations. Options in custom.inc.
| 1.9 - Added move to anchor and move to/follow target
| options between fights. Fixed sneak/hide after fight.
| Other minor code cleanup.
| 1.8 - Cleaned up some of the code, tossed the xp stuff
| and fixed events, evade and getbehind.
| 1.7 - Base code (Jay's script)
#turbo 40
#Event Enraged "has become ENRAGED"
#Event Offrage "is no longer enraged"
#Event Slainby "You have been slain by"
#Event Zonechange "You have entered"
Sub Main
/zapvars
/declare assisthealth global
/declare countdown global
/declare setanchor global
/declare AnchorX global
/declare AnchorY global
/declare MyXLoc global
/declare MyYLoc global
/declare targetname global
/declare targetid global
/declare assistname global
/declare attacktarget global
/declare tempvar global
/declare followtarget global
/declare strikeflag global
/varset tempvar 0
/varset strikeflag 0
/echo "AutoRogue v. 2.0j Started."
/if (${Defined[Param0]}) {
/varset assistname @Param0 | Your assist.
} else {
/zapvars
/echo "Error: The name of your assist is not optional."
/echo "Usage: /macro rogue.mac AssistName <AssistHpPct> <AnchorFlag> <FollowTarget>"
}
/if (${Defined[Param1]}) {
/varset assisthealth @Param1 | Wait until mob is below this health trigger.
} else {
/varset assisthealth 90
}
/if (${Defined[Param2]}) {
/varset setanchor @Param2 | Anchor Flag: 0 = none, 1 = stationary anchor, 2 = follow target
/if (@setanchor==2) {
/if (${Defined[Param3]}) {
/varset followtarget @Param3 | Moveto/follow this target if setanchor=2
} else {
/varset followtarget @assistname
}
}
} else {
/varset setanchor 0
}
#include custom.inc
/echo "@assistname is main assist."
/echo "Will start combat when MA target is at @assisthealth%."
/assist off
/attack off
/if (@setanchor==1) {
/varset AnchorX ${Me.Y}
/varset AnchorY ${Me.X}
/echo "Created anchor at Loc: @AnchorX,@AnchorY."
}
/if (@setanchor==2) {
/target @followtarget
/if (${Target.ID}==0) /varset followtarget @assistname
/echo "Created MoveToTarget: @followtarget."
}
/if (@sneakhide==1) /echo "SneakHide Enabled."
/if (@usespecial==1) {
/call CheckRegenEnd
/echo "Discipline/Escape Usage Enabled."
/echo "Your current endurance is ${Me.Endurance}/${Me.MaxEndurance}."
/echo "Regen endurance percent: @regenendpct."
}
/echo "Waiting for @assistname to select a new target..."
:Wait
/delay 1
/doevents
/call SneakHide
/call CheckRegenEnd
/call CheckAnchor
/assist @assistname
/delay 4
/if (${Target.ID}==0) /goto :Wait
/if (${Target.Type.Equal["NPC"]}==0) /goto :Wait
/if (${Target.CleanName.Equal[${Me.Name}]}==1) /goto :Wait
/if (@tempvar!=${Target.PctHPs}) /echo ${Target.CleanName} targeted at ${Target.PctHPs}% at a distance of ${Target.Distance}.
/varset tempvar ${Target.PctHPs}
/if (${Target.PctHPs}<=@assisthealth && ${Target.Distance}<@engagedistance) /goto :Attack
/goto :Wait
:Attack
/echo Fighting ${Target.CleanName} | ${Target.Level} ${Target.Class.Name}.
/varset targetname ${Target.CleanName}
/varset targetid ${Target.ID}
/varset attacktarget 1
/call CheckGM
/call MoveTo
/face fast
:AttackLoop
/delay 1
/doevents
/assist @assistname
/delay 4
/if (${Target.ID}==0) /goto :AttackEnd
/if (${Target.ID}!=@targetid) /goto :AttackEnd
/call CheckMeleeRange
/call GetBehind
/if (@attacktarget==1) {
/if (@strikeflag==0) /call CheckStrikeSpecial
/if (${Target.Distance}<${Target.MaxRange} && ${Me.AbilityReady["Backstab"]}>0) /doability "Backstab"
/attack on
/if (${Me.Sneaking}) /doability "Sneak"
/if (@strikeflag==1) /call CheckAtkSpecial
/if (${Me.AbilityReady["Hide"]}>0) {
/attack off
/delay 4
/doability "Hide"
}
}
/if (@attacktarget==0) /Attack off
/if (@attacktarget==1) /Attack on
/call CheckDefSpecial
/doevents
/goto :AttackLoop
:AttackEnd
/echo "Combat with @targetname has ended."
/keypress forward
/keypress back
/varset tempvar 0
/varset discactive 0
/varset strikeflag 0
/varset attacktarget 0
/attack off
/echo "Waiting for @assistname to select a new target..."
/call SneakHide
/call CheckRegenEnd
/call CheckGM
/goto :Wait
/endmacro
Sub CheckMeleeRange
/face fast
/if (${Target.Distance}>${Target.MaxRange}) /keypress forward hold |If target is farther then MaxRange move forward
/if (${Target.Distance}<8) /keypress back hold |If target is closer then 8 move back
/if (${Target.Distance}<10) /keypress forward |If target is closer then 10 stop moving forward
/if (${Target.Distance}>9) /keypress back |If target is farther then 9 stop moving back
/face fast
/return
Sub SneakHide
/delay 4
/if (@sneakhide==1) {
:WaitForSneak
/if (${Me.Sneaking}==1) {
/goto :WaitForHide
} else {
/doability "Sneak"
/delay 4
/goto :WaitForSneak
}
:WaitForHide
/delay 4
/if (${Me.AbilityReady["Hide"]}==1) /doability "Hide"
}
/return
Sub GetBehind
/varset countdown 0
/varset MyXLoc ${Me.X}
/varset MyYLoc ${Me.Y}
/if (${Target.ID}==0) /goto :noneed
/if (${Math.Distance[${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.DegreesCCW}]}*10]},${Math.Calc[${Target.X}-${Math.Sin[${Target.Heading.DegreesCCW}]}*10]}]}<5) /goto :noneed
/keypress forward hold
:gobehindloop
/delay 1
/call CheckGM
/if (${Target.ID}==0) {
/keypress forward
/goto :noneed
}
/if (@countdown>1) {
/if (@MyXLoc==${Me.X} && @MyYLoc==${Me.Y}) {
/keypress forward
/goto :noneed
}
/varset MyXLoc ${Me.X}
/varset MyYLoc ${Me.Y}
/varset countdown 0
}
/varadd countdown 1
/doevents
/face nolook fast loc ${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.DegreesCCW}]}*10]},${Math.Calc[${Target.X}-${Math.Sin[${Target.Heading.DegreesCCW}]}*10]}
/if (${Math.Distance[${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.DegreesCCW}]}*10]},${Math.Calc[${Target.X}-${Math.Sin[${Target.Heading.DegreesCCW}]}*10]}]}>3) /goto :gobehindloop
/keypress forward
/face fast
:noneed
/return
Sub CheckDefSpecial
/if (@usespecial==1) {
/if (${Me.PctHPs}<@nimblepct) {
/if (${Me.PctHPs}<@escapepct) {
/echo "Escaping."
/attack off
/varset attacktarget 0
/delay 2
/alt activate 102 | escape aa
/call SneakHide
/goto :EscapedWaitHeal
} else {
/echo "Nimble."
/delay 2
/disc nimble
/attack off
/varset attacktarget 0
/delay 5
/doability "Hide"
/goto :NimbleWaitHeal
}
}
}
:EscapedWaitHeal
/if (${Me.PctHPs}>@healpausepct) {
/varset attacktarget 1
/return
}
/delay 10
/goto :EscapedWaitHeal
:NimbleWaitHeal
/if (${Me.PctHPs}>@healpausepct) {
/varset attacktarget 1
/return
}
/delay @hiderefresh
/doability "hide"
/goto :NimbleWaitHeal
/return
Sub CheckAtkSpecial
/call CheckRegenEnd
/if (@usespecial==1 && @discactive==0 && @regenend==0 && ${Target.PctHPs}<@attackdiscpct) {
/disc duelist
/delay 4
/disc deadly
/varset discactive 1
}
/return
Sub CheckStrikeSpecial
/varset strikeflag 1
/call CheckRegenEnd
/if (@regenend==0) {
/delay 2
/disc @strikedisc
:WaitForBackstabRange
/delay 2
/if (${Target.Distance}<${Target.MaxRange}) {
/doability "Backstab"
} else {
/call MoveTo
/call GetBehind
/goto :WaitForBackstabRange
}
}
/return
Sub CheckRegenEnd
/if (@regenend==0 && ${Math.Calc[${Me.Endurance}/${Me.MaxEndurance}*100]}<@regenendpct) {
/varset regenend 1
/echo "Regen endurance to full."
}
/if (@regenend==1) {
/if (${Me.Endurance}==${Me.MaxEndurance}) {
/varset regenend 0
/echo "Endurance regenerated."
}
}
/return
Sub CheckAnchor
/call CheckGM
/if (@setanchor==1) /if (${Math.Distance[@AnchorX,@AnchorY]}>12) /call MoveToAnchor
/if (@setanchor==2) {
/target @followtarget
/delay 4
/if (${Target.Distance}>${Target.MaxRange} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.CleanName}]}) /call MoveTo
}
/return
Sub CheckGM
:gmcheck
/if (${Spawn[gm].ID}>0) {
/echo "Waiting on GM to leave zone."
/delay 10
/goto :gmcheck
}
/return
Sub MoveTo
/varset countdown 0
/varset MyXLoc ${Me.X}
/varset MyYLoc ${Me.Y}
/if (${Target.ID}==0 || ${Target.Distance}<${Target.MaxRange}) {
/keypress forward
/return
}
/echo "Moving to Target: ${Target.CleanName}"
:fastmoveloop
/delay 3
/doevents
/if (${Target.ID}==0) {
/keypress forward
/return
}
/face fast
/if (${Target.Distance}>${Target.MaxRange}) {
/keypress forward hold
} else {
/keypress forward
/return
}
/if (@countdown>2) {
/call Detectobst
/face fast
/varset countdown 0
}
/if (${Target.Distance}>${Math.Calc[${Target.MaxRange}*2]}) /varadd countdown 1
/goto :fastmoveloop
/return
Sub MoveToAnchor
/varset MyXLoc ${Me.X}
/varset MyYLoc ${Me.Y}
/varset countdown 0
/echo "Moving to Anchor at Loc: @AnchorX,@AnchorY."
:AnchorMoveLoop
/delay 1
/doevents
/face nolook loc @AnchorX,@AnchorY
/if (${Math.Distance[@AnchorX,@AnchorY]}>12) {
/keypress forward hold
} else {
/keypress forward
/return
}
/if (@countdown>2) {
/call Detectobst
/face nolook loc @AnchorX,@AnchorY
/varset countdown 0
}
/varadd countdown 1
/goto :AnchorMoveLoop
/return
Sub Detectobst
/delay 2
/if (@MyXLoc==${Me.X}) /if (@MyYLoc==${Me.Y}) /call Hitobst 5
/varset MyXLoc ${Me.X}
/varset MyYLoc ${Me.Y}
/return
Sub Hitobst
/keypress forward
/keypress back hold
/if (${Math.Rand[2]}) {
/delay 2s
/keypress back
/keypress right hold
/delay @Param0
/keypress right
/if (@usejump==1) {
/keypress forward hold
/delay @param0
/keypress jump
}
} else {
/delay 2s
/keypress back
/keypress left hold
/delay @Param0
/keypress left
/if (@usejump==1) {
/keypress forward hold
/delay @param0
/keypress jump
}
}
/delay 10
/keypress forward hold
/return
| ----- Events called by /DoEvents -----
Sub Event_Enraged
/varset attacktarget 0
/attack off
/return
Sub Event_Offrage
/varset attacktarget 1
/attack on
/return
Sub Event_Zonechange
/keypress up
/endmacro
/return
Sub Event_Slainby
/keypress up
/endmacro
/return


