AutoFight macro request

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

Moderator: MacroQuest Developers

loadingpleasewait
a snow griffon
a snow griffon
Posts: 332
Joined: Sat Sep 14, 2002 8:46 am

AutoFight macro request

Post by loadingpleasewait » Tue Oct 07, 2003 10:07 am

Ok, I have made a few macros in my time, but at most, they were sloppy. However, I did manage to stumble my way through the macro language.

Now, call me stupid (dont really call me stupid), but I cant seem to get the new language to do what I want it to do. So, here I am requesting a macro.

MACRO REQUEST:

Autofight that engages when attack is turned on.
When engaged, faces the mob
When engaged, does apropriate class fight skills, e.g. Kick, slam, bash, etc. etc.
Pauses macro if casting until cast is done, to avoid un needed spam from the attempted class fight skill (cant kick while casting..)
Has a toggle to auto taunt, e.g. /macro fight.mac taunt (makes it auto taunt)
Has a toggle to auto follow the target when attack is engaged
Has a toggle to do auto archery e.g. /macro fight.mac Arch
Will display Experience and AAxp gained from battle.


I think thats about it.

Thanks.. :D
LOADING PLEASE WAIT...

mackster
a ghoul
a ghoul
Posts: 95
Joined: Mon Sep 09, 2002 3:02 pm

Post by mackster » Tue Oct 07, 2003 11:10 am

Shamelessly stolen from Grimjack's hunter.mac, this faces the mob, makes sure you're in melee range, follows a running mob and executes special attacks (in this case Eagle Strike, simply change that portion in quotes to whatever you want it to do).

Code: Select all

sub Main 
   /if $target()=="FALSE" { 
      /varset HasTarget 0 
      /return 
   } 
   /attack on 
   :combatloop 
   /face fast nopredict 
   /call Eaglestrike 
   /if n $target(distance)>13 { 
      /sendkey down up 
      /goto :combatloop 
   } 
   /if n $target(distance)<=13 /sendkey up up 
   /face fast nopredict 
   /if n $target(id)==0 /varset TargetDead 1 
   /if n @TargetDead!=1 /goto :combatloop 
   /delay 1s 
   /target corpse @MobToHunt 
   /delay 2s 
/return 


Sub Eaglestrike
   /if n $char(ability,"Eagle Strike")!=-3 { 
      /if $target()=="TRUE" { 
         /face fast nopredict 
         /doability "Eagle strike" 
      } 
   } 
/return
This could be a start to build into what you want by taking snippets of code from other macros.

honduras
orc pawn
orc pawn
Posts: 14
Joined: Sat Aug 30, 2003 5:22 pm

Post by honduras » Sun Oct 12, 2003 3:27 am

melee MT with casting capability
with auto attack once in close range
and end attack or macro automatically during enraged or when lost target.

Code: Select all


#Event Loading "You have been slain by a" 
#Event See "You can't see your target"
|#Event Darkness "Your Festering Darkness spell has worn off" |change to whatever u want to recast if it wears off automatically
#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 "You target resisted the " 
#event OutOfMana "Insufficient Mana to cast this spell!" 
#event OutOfRange "Your target is out of range, get closer!" 
#event Stunned "You cannot cast while stunned" 
#event Standing "You must be standing to cast a spell" 
#event Collapse "Your gate is too unstable, and collapses." 
#event target "you must first select a target  for this spell"
#turbo

Sub Main
/declare mytimer timer
/varset mytimer 3s
/if "$target()"=="TRUE" /if n $target(distance)>=20 /attack on
   :Loop
      /if n $target(distance)>=20 /sendkey down up
      /if n $target(distance)>=18 /sendkey down up
      /if n $target(distance)<=10 /sendkey up up
      /if n $target(distance)<=8 /sendkey up up
      /if "$target()"=="TRUE" /if n $target(distance)>=20 /attack on
      /face fast
      /face look
      /doevents
      /if $char(ability,"Disarm")>0 /if n $target(distance)<=15 /doability "Disarm"
      /if $char(ability,"Bash")>0 /if n $target(distance)<=15 /if n $v30==0 /doability "Bash"
      /if $char(ability,"taunt")>0 /if n $target(distance)<=15 /if n $v30==0 /doability "taunt"
      /if @mytimer==0 /if n $char(gem,"Zevfeer's Bite")!=-2 /call castspell
      /if "$target()"=="TRUE" /goto :Loop
      /face look
       /attack off
      /endmacro keep keys


     
sub castspell
/echo Zevfeer's bite inc  |auto cast spell 
/doevent flush
/sendkey up up
/delay 5
/call cast "Zevfeer's Bite" |change to your whatever spell you like this spell will be auto cast
/varset mytimer 62s
/return

Sub Event_Enraged
  /varset v30 1
  /attack off
  /echo Atk off
  /sendkey down up
  /sendkey up up
  /face
  /return


Sub Event_See
/press down
/face fast
/press down
/return

Sub Event_Offrage
   /attack on
   /return

Sub Event_Gain 
   /attack off
   /endmacro keep keys

Sub Event_Loading
   /endmacro keep keys 



Sub Event_Darkness
/echo Festering Darkness
/doevents flush
/sendkey up up
/delay 5
/sendkey up up
/call cast "Festering Darkness"
/return


Sub Cast(SpellName) 
  /if n $char(gem,"@SpellName")==0 /return CAST_UNKNOWNSPELL 
  :StartCast 
  /if n $char(gem,"@SpellName")<0 /call WaitForRefresh "@SpellName" 
  /cast "@SpellName" 

|  :WaitCast 
|     /call ClearReturnValue 
|     /doevents Fizzle 
|     /doevents Interrupt 
|     /doevents Recover 
|     /doevents Standing 
|     /doevents OutOfRange 
|     /doevents OutOfMana 
|     /doevents Resisted 
 |    /if n $return==CAST_RESTART /goto :StartCast 
|     /if n $return>=CAST_RESTART /return $return 

 | /if "$char(casting)"=="TRUE" /goto :WaitCast 

/return CAST_SUCCESS 

Sub WaitForRefresh(SpellName) 
|   :LoopWaitForRefresh 
|      /delay 0 
|  /if n $char(gem,"@SpellName")<0 /goto :LoopWaitForRefresh 
/return 

Sub ClearReturnValue 
/return CAST_SUCCESS 

Sub Event_Fizzle 
/return CAST_RESTART 

Sub Event_Interrupt 
/return CAST_RESTART 

Sub Event_Recover 
   /delay 5 
/return 

Sub Event_Standing 
   /stand 
/return CAST_RESTART 

Sub Event_Collapse 
/return CAST_RESTART 

Sub Event_OutOfMana 
/return CAST_OUTOFMANA 

Sub Event_Select
/endmacro keep keys

Sub Event_OutOfRange 
/return CAST_OUTOFRANGE 

Sub Event_Stunned 
/return CAST_STUNNED 

Sub Event_Resisted 
/return CAST_RESISTED
Sub Event_Stunned 
   /varset CastStatus CAST_STUNNED 
/return 

Sub Event_Resisted 
   /varset CastStatus CAST_RESISTED 
/return 

to solve the spam problem

in macroquest.ini in :* /release

add this line

Code: Select all


[Filter Names]
Filter1=You can't use that command while casting...


this will get rid of the spam[/code]