Converting a macro

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

DreamKing
a lesser mummy
a lesser mummy
Posts: 79
Joined: Tue Jun 10, 2003 12:29 am

Converting a macro

Post by DreamKing » Wed Oct 15, 2003 7:13 pm

I have an old attack macro I modifed from grimjack's rogue.mac and having a few issues converting it since the recent MQ changes. Does anyone see obvious mistakes? It works for about 5 seconds then it just stops.

Code: Select all

|/macro rogue.mac [minimum distance to mob] [maximum distance to mob] [distance at which to move fast] 

#Turbo 72

#Event Enraged "has become ENRAGED" 
#Event Offrage "is no longer enraged" 

Sub Main 
/declare CastTimer timer
/declare RangeMin global
/declare RangeMax global
/declare FastRange global
/declare Combatstatus global
/declare EnrageVar global

   /varset RangeMin @Param0 
   /varset RangeMax @Param1 
   /varset FastRange @Param2 
   /varset Combatstatus 0 
   /varset EnrageVar 0 

   :Mainloop 
      /call Combatcheck 
      /if @Combatstatus=="1" /call RangeSub 
      /if @Combatstatus=="1" /call Checkbehind 
      /if @Combatstatus=="1" /call Bonkit 
      /if @Combatstatus=="1" /call Checkbehind 
      /doevents 
      /goto :Mainloop 
   /return 
   

   Sub Checkbehind 
      /if n $distance($calc($target(y)-$cos($target(heading))*10),$calc($target(x)-$sin($target(heading))*10))<8 { 
      } 
   /return 
   
   
   Sub Bonkit
    /if n $char(ability,"Eagle Strike")>0 /doability "Eagle Strike" 
    /if n @CastTimer>0 /return 
    /press 9
    /varset CastTimer 9s 
    /return 
   
   
   Sub Combatcheck 
      /if @EnrageVar=="1" { 
         /if $target()=="TRUE" { 
            /return 
         } else { 
            /varset EnrageVar 0 
            /varset Combatstatus 0 
         } 
      } 
      /if $target()=="FALSE" { 
         /varset Combatstatus 0 
         /if $combat=="TRUE" { 
            /attack off 
         } 
         /return 
      } 
      /if $target()=="TRUE" { 
         /if $combat=="TRUE" { 
            /varset Combatstatus 1 
            /return 
         } 
      } 
   /varset Combatstatus 0 
   /return 
   
   Sub Rangesub 
      /face fast nopredict 
      /if n $target(distance)>=@FastRange /call Fastmove 
      /if n $target(distance)>@RangeMax { 
         /press up 
      } 
      /if n $target(distance)<@RangeMin { 
         /press down 
      } 
   /return 
   
   
   Sub Event_Enraged 
      /if $target()=="TRUE" { 
         /varset EnrageVar 1 
         /attack off 
      } 
   /return 
   
   Sub Fastmove 
      :fastmoveloop 
      /if $target()=="FALSE" { 
         /varset Combatstatus 0 
         /sendkey up up 
         /if $combat=="TRUE" { 
            /attack off 
            /return 
         } 
      } 
      /face fast nopredict 
      /if n $target(distance)>@FastRange { 
         /sendkey down up 
         /attack off 
      } 
      /if n $target(distance)<=@FastRange { 
            /if $Combatstatus=="1" { 
               /if @EnrageVar=="0" { 
                  /attack on 
               } 
            } 
         /sendkey up up 
         /return 
      } 
      /goto :fastmoveloop 
   /return 
   
   
   Sub Event_Offrage 
      /if $target()=="TRUE" { 
            /varset EnrageVar 0 
            /attack 
         } 
      } 
/return