Page 1 of 1

AutoBeastlord Macro with Rebuffs

Posted: Wed May 19, 2004 7:31 am
by screwball
This macro is working good right now but I'm still making adjustments here and there to the discs and spellcast rebuffing. I'm going to add pet rebuffing also soon.

Code: Select all

|AutoBeastlord 5-19-2004 
|---------------------------------------------------------------------- 
| By Screwball. 
| Original AutoRogue by Jay. 
| Credits to GrimJack for the getbehind and moveto logic from GenBot. 
| 
| Usage: /macro bst.mac Assist HpPct AnchorBit Follow 
| 
| Examples: 
|     Assist tank at 95% 
|       /macro bst.mac Happytank 95 0    (or leave the zero off) 
| 
|     Assist tank at 95%, set anchor at current loc 
|       /macro bst.mac Happytank 95 1 
| 
|     Same as above but moveto/follow a target between fights 
|       /macro bst.mac Happytank 95 2 Stationarycleric 
| 
| DON'T FORGET TO VIEW/MODIFY YOUR CUSTOM.INC FILE!!! 
| 
|
#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#*#"
#Event FEROC "#*#The ferocity fades.#*#"
#Event SV "#*#Your spiritual vigor fades.#*#"
#Event DOMIN "#*#The dominion fades.#*#"
#Event IOS "#*#Your power fades.#*#"
#Event STR "#*#Your Furious Strength fades.#*#"
#Event HASTE "#*#Your speed returns to normal.#*#"
#Event TALIS "#*#Your hit points fade.#*#"
#Event FREN "#*#Your frenzy fades.#*#"
#Event STA "#*#Your stamina fades.#*#"
#Event DEX "#*#Your dexterity fades.#*#"
#Event SLAINBY "#*#You have been slain by#*# "
#Event Exp "#*#You gain party exp#*#"

#include spellcast.inc 

Sub Main    
    /declare bAttackTarget bool outer 
    /declare AnchorX float outer 
    /declare AnchorY float outer 
    /declare fXLoc float outer 
    /declare fYLoc float outer 
    /declare iSetAnchor int outer 
    /declare sFollowTarget string outer 

    /declare iAssistHealthPct int local 
    /declare iTargetId int local 
    /declare iTargetIdTmp int local    
    /declare sAssistName string local 
    /declare sTargetName string local 
    
    /varset iTargetIdTmp 0 
    
    /echo AutoBeastlord Started. 

    /if (${Defined[Param0]}) { 
       /varset sAssistName ${Param0}              
    } else { 
        /echo Error:  The name of your assist is not optional. 
        /echo Usage:  /macro bst.mac AssistName <AssistHpPct> <AnchorFlag> <sFollowTarget> 
    } 
        
    /if (${Defined[Param1]}) { 
        /varset iAssistHealthPct ${Param1}        
    } else /varset iAssistHealthPct 90 
    
    /if (${Defined[Param2]}) { 
       /varset iSetAnchor ${Param2}              
       /if (${iSetAnchor}==2) { 
           /if (${Defined[Param3]}) { 
              /varset sFollowTarget ${Param3} 
           } else /varset sFollowTarget ${sAssistName} 
         } 
   } else /varset iSetAnchor 0 
    
    #include custom.inc 

    /echo ${sAssistName} is main assist. 
    /echo Will start combat when MA target is at ${iAssistHealthPct}%.     
    /assist off 
    /attack off 
        
    /if (${iSetAnchor}==1) { 
        /varset AnchorX ${Me.X} 
        /varset AnchorY ${Me.Y} 
        /echo Created anchor at Loc: ${AnchorY}, ${AnchorX}. 
    } 
    
    /if (${iSetAnchor}==2) { 
        /target ${sFollowTarget} 
        /delay 5 
        /if (!${Target.ID}) /varset sFollowTarget ${sAssistName} 
        /echo Created MoveToTarget: ${sFollowTarget}. 
    }       
        
    /if (${bUseSpecial}) { 
        /call CheckRegenEnd 
        /echo Discipline/Beastial Fury Usage Enabled. 
        /echo Your current endurance is ${Me.Endurance}/${Me.MaxEndurance}. 
        /echo Regen endurance percent:  ${iRegenEndPct}. 
    }     
    /echo Waiting for ${sAssistName} to select a new target... 
    
:Wait 
    /delay 1    

    /doevents 
    
    /call CheckRegenEnd 
    /call CheckAnchor 

    /assist ${sAssistName} 
    /delay 4 
    
    /if (!${Target.ID}) /goto :Wait 
    /if (!${Target.Type.Equal["NPC"]}) /goto :Wait 
    /if (${Target.CleanName.Equal[${Me.Name}]}) /goto :Wait 
    
    /if (${iTargetIdTmp}!=${Target.PctHPs}) /echo ${Target.CleanName} targeted at ${Target.PctHPs} %hp, distance ${Target.
Distance}. 
    
    /varset iTargetIdTmp ${Target.PctHPs} 

    /if (${Target.PctHPs}<=${iAssistHealthPct} && ${Target.Distance}<${iEngageDistance}) /goto :Attack 

    /goto :Wait 

:Attack 
    /echo Fighting ${Target.CleanName} | ${Target.Level} ${Target.Class.Name}. 
    /varset sTargetName ${Target.CleanName} 
    /varset iTargetId ${Target.ID} 
    /varset bAttackTarget 1 
    
    /call CheckGM 
    /call MoveTo 
    /call GetBehind 
    /call cast "Feral Swipe" activate
    /call cast "Frenzy of Spirit" activate
    /face fast
    /pet attack 

:AttackLoop 
    /assist ${sAssistName} 
    
    /doevents 

    /if (!${Target.ID}) /goto :AttackEnd 
    /if (${Target.ID}!=${iTargetId}) /goto :AttackEnd 

    /call GetBehind 
    /call CheckMeleeRange 

    /if (${bAttackTarget}) { 
        /if (${Target.Distance}<${Target.MaxRangeTo} && ${Me.AbilityReady["kick"]}) /doability "kick" 

        /attack on        
        } 
    } 
    
    /doevents        

    /if (!${bAttackTarget}) /Attack off 
    /if (!${bAttackTarget}) /Attack on        

    /goto :AttackLoop 

:AttackEnd 
    /echo Combat with ${sTargetName} has ended. 
    /keypress forward 
    /keypress back 
    /varset iTargetIdTmp 0 
    /varset bDiscActive 0 

    /varset bAttackTarget 0 
    /attack off
    /pet hold
    /pet back off
    /keypress home 

    /echo Waiting for ${sAssistName} to select a new target. 
    
    /call CheckRegenEnd 
    /call CheckGM 
    
    /goto :Wait 

/endmacro 

Sub CheckMeleeRange 
   /if (!${Target.ID}) /return 

    /face fast 
    
    /if (${Target.Distance}>${Target.MaxRangeTo}*2) /call MoveTo 
    /if (${Target.Distance}>${Target.MaxRangeTo}) /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 

    }    
/return 

Sub GetBehind 
    /declare iCount int local 
    
    /varset iCount 0 
    /varset fXLoc ${Me.X} 
    /varset fYLoc ${Me.Y} 

    /if (!${Target.ID}) /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 
    /if (${Target.Distance}>${Target.MaxRangeTo}*2) /call MoveTo 

    /keypress forward hold 

:gobehindloop 
    /delay 1 
    /call CheckGM 
    
    /if (!${Target.ID}) { 
       /keypress forward 
       /goto :noneed 
    } 
    
    /if (${iCount}>1) { 
        /if (${fXLoc}==${Me.X} && ${fYLoc}==${Me.Y}) { 
              /keypress forward 
              /goto :noneed 
        } 

        /varset fXLoc ${Me.X} 
        /varset fYLoc ${Me.Y} 
        /varset iCount 0 
    } 
    
    /varcalc iCount ${iCount}+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 CheckAtkSpecial 
   /call CheckRegenEnd 

   /if (${bUseSpecial} && !${bDiscActive} && !${bRegenEnd} && ${Target.PctHPs}<${iAttackDiscPct}) { 
       /disc Beastial Fury
       /varset bDiscActive 1 
   } 
/return

:WaitForBackstabRange 
      /if (${Target.Distance}<${Target.MaxRangeTo}) { 
         /doability "kick" 
      } else { 
         /call CheckMeleeRange 
         /goto :WaitForBackstabRange 
      } 
    } 
/return 
        
Sub CheckRegenEnd 
   /if (!${bRegenEnd} && ${Me.PctEndurance}<${iRegenEndPct}) { 
      /varset bRegenEnd 1 
      /echo Regen endurance to full. 
   } 
    
   /if (${bRegenEnd}) { 
       /if (${Me.Endurance}==${Me.MaxEndurance}) { 
           /varset bRegenEnd 0 
           /echo Endurance regenerated. 
      } 
   } 
    
/return    

Sub CheckAnchor 
   /call CheckGM 
    
    /if (${iSetAnchor}==1) /if (${Math.Distance[${AnchorY},${AnchorX}]}>12) /call MoveToAnchor 
    
    /if (${iSetAnchor}==2) { 
        /target ${sFollowTarget} 
        /delay 4 
        /if (${Target.Distance}>${Target.MaxRangeTo} && ${Target.ID} && ${Target.CleanName.NotEqual[${Me.CleanName}]}) /

call MoveTo 
    }      
/return 

Sub CheckGM 
   /if (${Spawn[gm].ID}) { 
      /echo Waiting on GM to leave zone. 
      /keypress forward 
      /keypress esc 
      /attack off
      /pet hold
      /pet back off 
       /delay 4 
:gmcheck 
      /if (${Spawn[gm].ID}) { 
           /delay 10 
            /goto :gmcheck 
         } else /return 
   } 
/return 

Sub MoveTo 
    /declare iCount int local 
    
    /varset iCount 0 
    /varset fXLoc ${Me.X} 
    /varset fYLoc ${Me.Y} 

    /if (!${Target.ID}) { 
       /keypress forward 
       /return 
    } 
    
    /if (${Target.Distance}<${Target.MaxRangeTo}) { 
       /keypress forward 
       /return 
    } 
    
    /echo Moving to Target: ${Target.CleanName}. 

:fastmoveloop 
   /delay 1 
   /doevents 
    
    /if (!${Target.ID}) { 
        /keypress forward 
        /return 
    } 
    
    /face fast 

    /if (${Target.Distance}>${Target.MaxRangeTo}) /keypress forward hold 

    /if (${Target.Distance}<${Target.MaxRangeTo}) { 
        /keypress forward 
        /return 
    } 
    
    /if (${iCount}>2) { 
        /call Detectobst 
        /face fast 
        /varset iCount 0 
    } 
    
    /if (${Target.Distance}>${Math.Calc[${Target.MaxRangeTo}*2]}) /varcalc iCount ${iCount}+1 
    /goto :fastmoveloop 
/return 


Sub MoveToAnchor 
    /declare iCount int local 

    /varset fXLoc ${Me.X} 
    /varset fYLoc ${Me.Y} 
    /varset iCount 0 

    /echo Moving to Anchor at Loc: ${AnchorY}, ${AnchorX}. 

:AnchorMoveLoop  
    /delay 1 
    /doevents 
    /face nolook loc ${AnchorY},${AnchorX} 
    
    /if (${Math.Distance[${AnchorY},${AnchorX}]}>12) { 
       /keypress forward hold 
   } else { 
       /keypress forward 
        /return 
    } 

    /if (${iCount}>2) { 
        /call Detectobst 
        /face nolook loc ${AnchorY},${AnchorX} 
        /varset iCount 0 
    } 
    
    /varcalc iCount ${iCount}+1 
    /goto :AnchorMoveLoop 
/return 

Sub Detectobst 
    /delay 2 
    /if (${fXLoc}==${Me.X}) /if (${fYLoc}==${Me.Y}) /call Hitobst 
    /varset fXLoc ${Me.X} 
    /varset fYLoc ${Me.Y} 
/return 

Sub Hitobst 
    /keypress forward 
    /keypress back hold 
    
    /if (${Math.Rand[2]}) {    
        /delay 2s    
        /keypress back 
        /keypress right hold 
        /delay 8 
        /keypress right 
        
        /if (${bUseJump}) { 
           /keypress forward hold 
           /delay 8 
           /keypress jump 
        } 
    } else { 
        /delay 2s 
        /keypress back 
        /keypress left hold 
        /delay 8 
        /keypress left 
        
        /if (${bUseJump}) { 
           /keypress forward hold 
           /delay 8 
           /keypress jump 
        } 
    } 
    /delay 10 
    /keypress forward hold 
/return 

| ----- Events called by /DoEvents ----- 

Sub Event_FEROC
/keypress tab

/call Cast "Ferocity"
/keypress tab
/return 



Sub Event_DOMIN
   
/call Cast "Spiritual Dominion"
/return    



Sub Event_SV 
   
/call Cast "Spiritual Vigor"
/return 



Sub Event_IOS

/keypress tab
/call Cast "Infusion of Spirit"

/keypress tab
/return 



Sub Event_STR

/keypress tab
/call Cast "Furious Strength"
/keypress tab
/return 



Sub Event_TALIS
/keypress tab
/call Cast "Talisman of Kragg"
/keypress tab
/return



Sub Event_FREN
   
/call Cast "Frenzy"
/return

 


Sub Event_STA

/keypress tab
/call Cast "Stamina"
/keypress tab
/return




Sub Event_DEX

/keypress tab
/call Cast "Dexterity"
/keypress tab
/return

Sub Event_HASTE

/keypress tab  
/call Cast "Celerity"
/keypress tab
/return



Sub Event_Enraged 
    /varset bAttackTarget 0 
    /attack off
    /pet hold
    /pet back off
/return 

Sub Event_Offrage 
    /varset bAttackTarget 1 
    /attack on
    /pet attack 
/return 

Sub Event_Zonechange 
   /keypress up 
   /endmacro 
/return 

Sub Event_Slainby 
    /keypress up 
    /endmacro 
/return
[[Custom.inc included here.]]

Code: Select all

| custom.inc 
| Example include file for AutoBeastlord 

/declare bDiscActive bool outer       | Flag prevents more than 1 offensive disc per fight 
/declare bRegenEnd bool outer         | 1 = On (regen endurance to 100%), 0 = off 
/declare bUseSpecial bool outer       | Use disciplines, 1 = True, 0 = False 
/declare bUseStrike bool outer        | Use strike technique, 1 = True, 0 = False 
/declare bUseJump bool outer          | Adds a jump when in collision detection loop.  0 = off 
/declare iAttackDiscPct int outer    | Use Frenzy or Rage disc when Target.PctHps < this, 0 = off  
/declare iEngageDistance int outer   | How close the mob must be to engage 
/declare iRegenEndPct int outer      | Regen endurance to full when it gets low via $), 0 = off

| <<< Custom Vars:  Modify these according to your taste. >>> 

/varset bDiscActive 1 
/varset bRegenEnd 0             
/varset bUseSpecial 1 
/varset bUseStrike 1 
/varset bUseJump 1 
/varcalc iAttackDiscPct ${iAssistHealthPct}-10  
/varset iEngageDistance 300       
/varset iRegenEndPct 20
[[Spellcast.inc included here.]]

Code: Select all

| 
| SpellCast.inc 
| 
| Last Modified: 5/14/2004 9:30pm 
| This will cast a spell reliably for you... 
| 
| Usage: 
|       /call Cast "spellname|itemname|AA#|AAskillname" [item|activate|gem#] [nocheck|dismount|nodismount] 
| 
| If no dismount or nodismount is provided it defaults to nodismount. 
| 
| This would essentially: /cast "Death Peace" 
| example: /call Cast "Death Peace" 
| 
| This would essentially: Check for the spell in your spell slots, if not there mem it to spell 
|                         gem slot 7 and then /cast "Death Peace" 
| example: /call Cast "Death Peace" gem7 
| 
| This would essentially: /cast item "White Rope Bridle" 
| example: /call Cast "White Rope Bridle" item 
| 
| This would essentially: /alt activate 169 
| example: /call Cast "169" activate 
|  or... 
| example: /call Cast "Divine Arbitration" activate 
| 
| This would dismount if your target was lost or dies mid-cast, cast Burn and mem it to spell 
| slot 3 if it wasn't already memmed: 
| example: /call Cast "Burn" gem3 dismount 
| 
| This would not dismount but would move you back and forth if your target was lost or dies mid-cast, cast Burn and mem 
| it to spell slot 3 if it wasn't already memmed: 
| example: /call Cast "Burn" gem3 nodismount 
| 
| 'nocheck' is the default for the "loss of target/target dying" value.  If nocheck is specified (Or nothing was specified) 
| no target checking will be performed and spellcast.inc should act like the spellcast.inc of the past. 
| 
| It will return the following values: 
| CAST_SUCCESS 
| CAST_UNKNOWNSPELL 
| CAST_OUTOFMANA 
| CAST_OUTOFRANGE 
| CAST_CANNOTSEE 
| CAST_STUNNED 
| CAST_RESISTED 
| CAST_TOOK2LONG 
| CAST_ABILITYNOTREADY 
| CAST_IMMUNESLOW 
| CAST_LOSTTARGET 
| 
| New Vars Modification 
| Plazmic's no globals needed version 
| 
| Oct 09, 2003 - Updated to work with new vars and $char(casting) -gf 
| Oct 11, 2003 - switched some logic, removed defines -gf 
| Oct 15, 2003 - Item support added by -EqMule 
| XXX xx, xxxx - Modified to add automeming of spells. -Goofmester1 
| Dec 26, 2003 - fd fail 1 added -m0nk 
| Jan 01, 2004 - timeout(5s) added to stop "dead-time" -m0nk 
| Jan 01, 2004 - switchd fdfail to a standing check. -m0nk 
| Jan 01, 2004 - added silence checking as a stun check -m0nk 
| Feb 17, 2004 - added AA activate capabilities -ml2517 
| Apr 11, 2004 - Updated for new Parm system -ml2517 
| Apr 12, 2004 - Will spit out a different message on immune to slows. -ml2517 
| Apr 16, 2004 - Removed /sendkeys and replaced with /keypress. -ml2517 
| Apr 17, 2004 - Various code enhancements. -Wassup 
| Apr 20, 2004 - Updated all of the /if's to have parenthesis. -ml2517 
| Apr 25, 2004 - Updated to new variable system. -ml2517 
| Apr 29, 2004 - Fixed Item problem -ml2517 
| Apr 29, 2004 - Changed the alt ability to use AltAbilityReady instead of an event. -ml2517 
| May 02, 2004 - Added the ability to specify a gem slot to mem spells to. -ml2517 
| May 10, 2004 - Updated for new event system. 
| May 12, 2004 - Added suggestions for loss of target and stun handling change. -ml2517 
| May 13, 2004 - Activate now accepts AA skill by name or number. -ml2517 
| May 14, 2004 - Added the nocheck value, it is the default. This bypasses the target checking code. -ml2517 
| 

#event Fizzle "#*#Your spell fizzles#*#" 
#event Interrupt "#*#Your casting has been interrupted#*#" 
#event Interrupt "#*#Your spell is interrupted.#*#" 
#event Recover "#*#You haven't recovered yet...#*#" 
#event Recover "#*#Spell recovery time not yet met.#*#" 
#event Resisted "#*#Your target resisted the #*#" 
#event OutOfMana "#*#Insufficient Mana to cast this spell!#*#" 
#event OutOfRange "#*#Your target is out of range, get closer!#*#" 
#event NoLOS "#*#You cannot see your target.#*#" 
#event Stunned "#*#You cannot cast while stunned#*#" 
#event Stunned "#*#You *CANNOT* cast spells, you have been silenced!#*#" 
#event Standing "#*#You must be standing to cast a spell#*#" 
#event Standing "#*#has fallen to the ground.#*#" 
#event Collapse "#*#Your gate is too unstable, and collapses.#*#" 
#event ImmuneSlow "#*#Your target is immune to changes in its attack speed.#*#" 


Sub Cast(SpellName,ItemFlag,DismountFlag) 
   /declare HaveTarget int local 0 
   /declare CastBarTime timer local 
   /declare CastCurrLocY float local 0 
   /declare CastCurrLocX float local 0 
   /varset CastCurrLocY ${Me.Y} 
   /varset CastCurrLocX ${Me.X} 
   /if (${Target.ID}>0) /varset HaveTarget 1 
   /if (!${Defined[CastGiveUpTime]}) /declare CastGiveUpTime timer local 
   /if (!${Defined[ItemFlag]}) /declare ItemFlag string local 
   /if (!${Defined[DismountFlag]}) { 
       /declare DismountFlag string local nocheck 
       /if (${ItemFlag.Find["dismount"]}) /varset DismountFlag ${ItemFlag} 
   } 
   /if (!${Me.Standing} && !${Me.Mount.ID}>0) /stand 
   /if (${Me.Moving}) { 
       /keypress forward 
       /keypress back 
       /delay 8 
   } else { 
       /delay 4 
   } 
   /if (${ItemFlag.Equal["Item"]} || ${ItemFlag.Equal["Activate"]}) /goto :StartCast 

   /if (!${Me.Gem["${SpellName}"]}) { 
       /if (${ItemFlag.Find[gem]}) { 
           /if (${Int[${ItemFlag.Right[1]}]}>0 && ${Int[${ItemFlag.Right[1]}]}<9) { 
               /memspell ${ItemFlag.Right[1]} "${SpellName}" 
               /delay 5s 
           } else { 
               /goto :GenericMem 
           } 
       } else {        
           :GenericMem 
           /memspell 5 "${SpellName}" 
           /delay 5s 
       } 

   } 
   :StartCast 
      /varset CastGiveUpTime 5s 
   :CastNow 
      /if (${ItemFlag.Equal["Item"]}) { 
         /call ClearReturnValue 
         /cast item "${SpellName}" 
      } else /if (${ItemFlag.Equal["Activate"]}) { 
         /call ClearReturnValue 
         /if (!${Me.AltAbilityReady[${SpellName}]}) /return CAST_ABILITYNOTREADY 
         /alt activate ${AltAbility[${SpellName}].ID} 
         /varset CastBarTime ${Me.Casting.CastTime} 
      } else { 
         /if (!${Me.Gem["${SpellName}"]}) /return CAST_UNKNOWNSPELL 
         /call ClearReturnValue 
         /if (!${Me.SpellReady["${SpellName}"]}) { 
            /if (${CastGiveUpTime}==0) /return CAST_TOOK2LONG 
            /delay 1 
            /goto :CastNow 
         } 
         /cast "${SpellName}" 
         /varset CastBarTime ${Math.Calc[${Me.Casting.CastTime}*10]} 
      } 
   :WaitCast 
      /if (${Me.Casting.ID}) { 
         /if ((!${Target.ID}>0 || ${Target.Type.Equal[CORPSE]}) && !${DismountFlag.Find[nocheck]} && ${HaveTarget}==1) { 
             /if (${Me.Mount.ID}>0) { 
                 /if (${DismountFlag.Equal[dismount]}) { 
                     /dismount 
                 } else { 
                     /if (!${ItemFlag.Equal["Item"]}) { 
                         /if (${CastBarTime}<7) { 
                             :Interrupt 
                             /keypress FORWARD hold 
                             /delay 6 
                             /keypress FORWARD 
                             /keypress BACK hold 
                             /delay 8 
                             /keypress BACK 
                         } else { 
                             :HoldForSpell 
                             /delay 1 
                             /if (${CastBarTime}<7) /goto :Interrupt 
                             /goto :HoldForSpell 
                         } 
                     } else { 
                         /keypress FORWARD hold 
                         :Forward 
                         /delay 1 
                         /if (${Math.Distance[${CastCurrLocY},${CastCurrLocX}]}<6) /goto :Forward 
                         /keypress FORWARD 
                         /keypress BACK hold 
                         :Backward 
                         /delay 1 
                         /if (${Math.Distance[${CastCurrLocY},${CastCurrLocX}]}>4) /goto :Backward 
                         /keypress BACK 
                         /if (!${Me.Casting.ID}>0) /goto :DuckTime 
                     } 
                 } 
             } 
             :DuckTime 
             /keypress FORWARD 
             /keypress BACK 
             /if (!${Me.Ducking}) /keypress DUCK 
             /delay 1 
             /if (${Me.Ducking}) /keypress DUCK 
             /return CAST_LOSTTARGET 
         } 
         /delay 1 
         /goto :WaitCast 
      } 
   /delay 1 
   /doevents Fizzle 
   /doevents Interrupt 
   /doevents Interrupt 
   /doevents Recover 
   /doevents Standing 
   /doevents OutOfRange 
   /doevents OutOfMana 
   /doevents NoLOS 
   /doevents Resisted 
   /doevents ImmuneSlow 
   /doevents Stunned 
   /doevents Collapse 
   /if (${Macro.Return.Equal["CAST_RESTART"]}) /goto :StartCast 
   /if (!${Macro.Return.Equal["NULL"]}) /return ${Macro.Return} 
/return CAST_SUCCESS 

Sub ClearReturnValue 
/return NULL 

Sub Event_Fizzle 
/return CAST_RESTART 

Sub Event_Interrupt 
/return CAST_RESTART 

Sub Event_Recover 
   /delay 5 
/return CAST_RESTART 

Sub Event_Standing 
   /stand 
/return CAST_RESTART 

Sub Event_Collapse 
/return CAST_RESTART 

Sub Event_OutOfMana 
/return CAST_OUTOFMANA 

Sub Event_OutOfRange 
/return CAST_OUTOFRANGE 

Sub Event_NoLOS 
/return CAST_CANNOTSEE 

Sub Event_Stunned 
   /delay 2s !${Me.Stunned} 
/return CAST_RESTART 

Sub Event_Resisted 
/return CAST_RESISTED 

Sub Event_ImmuneSlow 
/return CAST_IMMUNESLOW
HOPE YOU LIKE IT!

error

Posted: Sat Jun 05, 2004 5:02 pm
by the_horror
it has an erro when I try to run:

starts but when it comes time to assist the movebehind part errors out. any suggestions

Posted: Sun Jun 06, 2004 3:09 pm
by zertful
This is a great adaptation. I've been using it since you posted it in the macro request forums. Many thanks screwball for taking the time to create this and post it on the forums.

As far as your problems the_horror, it's most likely due to the 3 or 4 word wraps that are posted in that code block. They're pretty easy to see if you just read the code... I would post mine but it's slightly modified and from an older version of screwballs script.

One question, how would I go about adding something that would pause the melee portion of the macro if I am trying to cast a spell on a mob, it's almost always interrupted as it is.

Zertful

thanks

Posted: Sun Jun 06, 2004 3:53 pm
by the_horror
Being lazy agian but yeah read it found 2 wraps fixed them and works like a chap agian.

Posted: Mon Jun 07, 2004 8:09 am
by wolf5
Nice macro.
Still learning and I'm using this one as a learning macro and trying to modify it to be more "natural" so that it doesn't seem all to obvious that I'm botting when I'm playing in groups being semiafk.

That means not being so "aggressive" on the movebehind part, and maybe not be 100% behind the mob but maybe within a certain degree of behind.

To get behind when the mob suddenly turns 180degrees a more natural way for me at least would be to strafe around to the back. So I'll try to macro that.

One way I figure on doing stuff more natural are to create a set of predefined movements to random from and combine. Ie a set of typical movements towards a close mob (during fight) and a set of movements to be more casual when moving towards a out-of-sight mob.

I think maybe making this a generic INC for movement would be super. :smile:

When I get that to work I can add it to this post as a mod of your macro.


-Wolf5

Posted: Mon Jun 07, 2004 3:26 pm
by Drumstix42
I took out all the move to and move behind stuff.

Mostly because if your in a group, the mob will move back and forth a lot between tanks, and getting behind it makes you move around way too much.

I used the MoveUtils plugin just to stick to the mob. And if the Assist changes target it'll make sure to /stick off and have a check to see if the mob is or isn't above 90% on changing target. Then a slew of my own little changes :roll:

Posted: Mon Jun 07, 2004 11:47 pm
by Powah_SK
Drumstix,

Would you mind posting the code for the changes you made? I just started using it tonight and while I really like it (a BIG thank you to the original author), the move-behind is also causing me fits. I find that in fighting indoors, often my Beastlord will try and get behind a mob when its back is to the wall, causing the beastlord to run directly into the wall in a frenzy. I would love to just have him stick to the mob as you're doing.

I was pretty familiar with how to code using ver.2 of Macros, but when looking at ver.3, I get confused. I'm not really familiar with the concept of plug-ins, but I'm going to try and get some reading done in the morning on here. Would you mind sharing the changes you made plus that plugin?

Thanks!

Posted: Tue Jun 08, 2004 11:24 am
by zertful
I'm also interested in finding a good use for the moveutils, I've got the plugin compiled and setup, but I'm not sure of the best way to implement it with the script and keep the events happy. (I haven't really programmed any of the 3.0 macros yet)

On a site note here is another great parms based beastlord macro: http://macroquest2.com/phpBB2/viewtopic ... =beastlord

If anyone is interested in converting some of this stuff into screwballs macro I would be happy to help however I can.

Zert

Posted: Tue Jun 08, 2004 3:11 pm
by Drumstix42
Well my suggestion is first get in the plugin working and such.

The way I have code setup now works 'pretty' well. Just sometimes teh assist my change targets, and the loop won't finish through and you'll stick to that target and usually you'll get a littel screwed up and have to stop the macro.

I'm personall looking in to just coding a personalized seperate moveutil (cause I love the one now how it is) and just renaming it. This way I can code it to check HP percentages and really coincide with the macro. I'd say hey, go fully plugin, but I haven't work enough with that syntax yet, and don't think I'm ready to tackle it.

I may or may not post my code. It's nothing really I did. Just commented out the /call 's on the Getbehind code and for the MoveTo code I just replaced it with like /stick 12. And basically, not the best way, through a whole lot of /stick off in places I saw fit. Not rocket science ;)

Posted: Sun Oct 24, 2004 11:57 pm
by JP5
I'm trying to make this macro work for a friend. I've fixed all the error messages (as said before they were caused by wrap-around). I put the #includes at the top, added /pet attack in the attack loop.

He says it doesn't move to the target at all, and doesn't make the pet attack.

So, has anyone experienced similar problems with moving and macro in general after fixing wrap-arounds?