Changing Current rogue.mac to a monk.mac

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

Moderator: MacroQuest Developers

s0meth1ng
orc pawn
orc pawn
Posts: 28
Joined: Sun Feb 22, 2004 7:00 am

Changing Current rogue.mac to a monk.mac

Post by s0meth1ng » Thu Apr 22, 2004 5:15 am

Well i have Check this Rogue macro out it from what i read and i looked through the macro. and it looks awsome, which is shown on this page...

http://macroquest2.com/phpBB2/viewtopic.php?t=6038

Great job on making the macro, Cunning

Well now to try and make it a monk macro :twisted:

Here is the Current macro that the Rogue macro has, seems to be split up into 2 parts here thay are...

custom.inc

Code: Select all

| custom.inc 
| Example include file for AutoRogue 2.0g 

/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 $char(hp,pct) <= this, 0 = off 
/declare escapepct global        | Use escape ability when $char(hp,pct) <= this, 0 = off 
/declare healpausepct global     | If nimble/escape triggered, wait till $char(hp,pct) > this, 100+ = off 
/declare attackdiscpct global    | Use duelist or deadly disc when $target(hp,pct) > this, 100+ = 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 maxendurance global     | Stores max endurance (use $char(endurance,cur) when your bar is full for value) 
/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 maxendurance 5900 
/varset strikedisc "Assass" 
/varset hiderefresh 75 
/varset usejump 1 
 
rogue.mac

Code: Select all

|AutoRogue 2.0g 4-22-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.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) 

#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.0g 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 @maxendurance." 
        /echo "Regen endurance percent:  @regenendpct." 
    } 
    
    /echo "Waiting for @assistname to select a new target..." 
    
:Wait 
    /delay 1    
    /assist @assistname 

   /doevents 
    
    /call SneakHide 
    /call CheckRegenEnd 
     /call CheckAnchor 
    
    /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 && ${Target.Pet}==0) /goto :Attack 

    /goto :Wait 

:Attack 
   /call CheckGM 

    /echo Fighting ${Target.CleanName} | ${Target.Level} ${Target.Class.Name}. 
    /varset targetname ${Target.CleanName} 
    /varset targetid ${Target.ID} 
    /varset attacktarget 1 
    
    /face nolook fast 

   /call CheckGM 
   /call MoveTo 

:AttackLoop 
    /delay 1 
    /assist @assistname 

    /doevents 
    
    /if (${Target.ID}==0) /goto :AttackEnd 
    /if (${Target.ID}!=@targetid) /goto :AttackEnd 
    
    /face nolook fast 
    
    /if (@attacktarget==1 && ${Target.ID}==@targetid) { 
       
      /call GetBehind 
        
        /if (@strikeflag==0) { 
           /call CheckStrikeSpecial 
         /varset strikeflag 1 
      } 
       
        /if (${Target.Distance}<${Target.MaxRange} && ${Me.AbilityReady["Backstab"]}>0) /doability "Backstab" 

        /attack on 
        /if (${Me.Sneaking}==1) /doability "Sneak" 

        /if (@strikeflag==1) /call CheckDefSpecial 
        /if (@strikeflag==1) /call CheckAtkSpecial 
        
        /if (${Me.AbilityReady["Hide"]}>0) { 
           /attack off 
           /delay 4 
           /doability "Hide" 
        } 
    } 

    /doevents        

    /if (@attacktarget==0) /Attack off 
    /if (@attacktarget==1) /Attack on 
    
    /face nolook fast 
    
    /if (${Target.Distance}>${Math.Calc[${Target.MaxRange}*2.5]}) { 
       /echo woah 
       /call MoveTo 
    } 
    
    /if (${Target.Distance}>${Target.MaxRange}) { 
       /keypress forward 
       /keypress forward hold |If target is farther then MaxRange move forward 
    } 
    
    /if (${Target.Distance}<8) { 
       /keypress back 
       /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 nolook fast 
    
    /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 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 
    /if (${Target.ID}==0) /goto :noneed 

    /varset countdown 0 
    /varset MyXLoc ${Me.Y} 
    /varset MyYLoc ${Me.X} 

   /if (${Math.Distance[${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.Degrees}]}*10]},${Math.Calc[${Target.X}+${Math.Sin[${Target.Heading.Degrees}]}*10]}]}<3) /goto :noneed 
    
   /keypress forward 
   /keypress forward hold 

:gobehindloop 
    /delay 1 
   /call CheckGM 
    /if (${Target.ID}==0) /goto :noneed 
    
    /if (${Target.Distance}<=${Target.MaxRange}) { 
        /if (@countdown>20) { 
            /if (@MyXLoc==${Me.X} && @MyYLoc==${Me.Y}) /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.Degrees}]}*10]},${Math.Calc[${Target.X}+${Math.Sin[${Target.Heading.Degrees}]}*10]} 
    } 
    
    /if (${Target.Distance}>${Math.Calc[${Target.MaxRange}*2.5]}) { 
       /call MoveTo 
       /goto :gobehindloop 
    } 
    
    /if (${Math.Distance[${Math.Calc[${Target.Y}-${Math.Cos[${Target.Heading.Degrees}]}*10]},${Math.Calc[${Target.X}+${Math.Sin[${Target.Heading.Degrees}]}*10]}]}>1) /goto :gobehindloop 

:noneed 
   /keypress forward 
   /face nolook fast 

/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 
   /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}/@maxendurance*100]}<@regenendpct) { 
      /varset regenend 1 
      /echo "Regen endurance to full." 
   } 
    
   /if (@regenend==1) { 
      /if (${Me.Endurance}==@maxendurance) { 
         /varset regenend 0 
         /echo "Endurance regenerated." 
      } 
   } 
    
   /if (${Me.Endurance}>@maxendurance) /varset maxendurance ${Me.Endurance} 
/return          

Sub CheckAnchor 
   /call CheckGM 
    
    /if (@setanchor==1) /if (${Math.Distance[@AnchorX,@AnchorY]}>6) /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 1 

    /if (${Target.ID}==0) { 
        /keypress forward 
        /return 
    } 
    
    /face nolook fast 

    /if (${Target.Distance}>${Target.MaxRange}) { 
        /keypress forward 
        /keypress forward hold 
    } else { 
       /keypress forward 
        /return 
    } 
    
    /if (@countdown>2) { 
        /call Detectobst 
        /face nolook fast 
        /varset countdown 0 
    } 
    
    /if (${Target.Distance}>${Math.Calc[${Target.MaxRange}*2.5]}) /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 

    /face nolook loc @AnchorX,@AnchorY 
    
    /if (${Math.Distance[@AnchorX,@AnchorY]}>6) { 
        /keypress forward 
        /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 
    /keypress back hold 
    
    /if (${Math.Rand[2]}) {    
        /delay 15    
        /keypress back 
        /keypress right 
        /keypress right hold 
        /delay @Param0 
        /keypress right 
        
        /if (@usejump==1) { 
           /keypress forward 
           /keypress forward hold 
           /delay @param0 
           /keypress jump 
        } 
    } else { 
        /delay 15 
        /keypress back 
        /keypress left 
        /keypress left hold 
        /delay @Param0 
        /keypress left 
        
        /if (@usejump==1) { 
           /keypress forward 
           /keypress forward hold 
           /delay @param0 
           /keypress jump 
        } 
    } 
    /delay 10 
    /keypress forward 
    /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 
Going to work on it as much as posiable to make it a monk macro, if anyone can assist me on this please do so, its going to take some time but i know it will be well worth it in the end 8)

s0meth1ng
orc pawn
orc pawn
Posts: 28
Joined: Sun Feb 22, 2004 7:00 am

Post by s0meth1ng » Thu Apr 22, 2004 6:13 pm

ok just updated to the new mq2data going to work on put monk abilitys disc and other junk.