my bot macro broken! fix it ... free BEER!!

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

azwildfire
Contributing Member
Contributing Member
Posts: 72
Joined: Fri Jul 05, 2002 5:12 am
Location: Phoenix arizona
Contact:

my bot macro broken! fix it ... free BEER!!

Post by azwildfire » Sun Jan 12, 2003 4:05 am

Hi! this script does most everything i want it to do. it follows and attacks flawlessly so far... but what i want it to do , is after i say follow and we get to the camp, when i say sit, i want it to remember where it sat as a "Home" point... so after it is done fighitng, or whatever it was fighting is dead , it goes back to the home point... and when tell it to follow, and tell it to sit somewhere else, remebers a new home point co ordinates.... i hope this makes sense... kinda late hehe

your help is much appriciated. any other general code clean up is welcome as well...
p.s. this is for a shaman who slows and then dots and sends in pet... then if it has mana goes and melees :D

Code: Select all

#include SpellSub.mac


#event AssistAF "Assist blah  blah" 
#event Follow "Follow blah blah"
#event Sit "Sit here blah blah"


Sub Main 

/varset v30 $p0 
/varset v31 $char(y)
/varset v41 $char(x)
/echo Assist macro running...

:Start 
/doevents 
/goto :Start 

/return 

sub CombatAF 
  /if "$target()"!="FALSE" /if "$target(type)"!="NPC" /return 
  /if "$target()"=="FALSE" /return

/g Assisting ... Fighting %t. 
|/g %s is level $target(level).
/echo %s is level $target(level). 
/varset v0 $target(name) 
/varset v1 $target(id) 
/stand


 /pet attack
 /if n $char(mana,pct)>50 /call Mana
 /if n $char(mana,pct)<25 /goto :EndAF
:Run 
 /doevents
 /face fast nopredict 
 /sendkey down up
 /if n $target(distance)>15 /goto :Run
 /sendkey up up
 /attack on
 /pet attack

 /if n $target(distance)<15 /goto :CloserAF
:CloserAF
/doevents
/face fast nopredict 
  /if "$target()"!="FALSE" /if "$target(type)"!="NPC" /goto :EndAF 
  /if "$target()"=="FALSE" /goto :EndAF  
|  /if "$target(id)"!="$v1" /goto :EndAF
  /if n $target(distance)<9 /press down
  /if n $target(distance)>13 /press up
  /doability kick
  /doability "sense heading"
  /if n $target(distance)>14 /goto :Run 
  /goto :CloserAF 

:EndAF 
 /doevents 
 /attack off
  /face loc $v31, $v41
  /if $distance($v31,$v41)>5 /sendkey down up /goto :EndAF
  /sendkey up up
  /sendkey up down
  /sit
 
  /return


sub Mana
 /call SpellSub 5 6
 /g %t should be slowed... I hope!
  /if "$target()"!="FALSE" /if "$target(type)"!="NPC" /return 
  /if "$target()"=="FALSE" /return  
|  /if "$target(id)"!="$v1" /return
 /call SpellSub 6 6
 /g %t shold be sick now too... I hope!
 /return

sub Event_AssistAF 

   /assist $v30 
   /echo assisting $v30 
   /delay 2
   /face fast nopredict
   
   /call CombatAF 
   /return 

sub Event_Follow
    /target $v30
    /pet follow me   
    /stand
:Loop
     
      /if n $target(distance)>60 /sendkey down up
      /if n $target(distance)<40 /sendkey up up
      /face fast
      /doevents
    /goto :Loop

sub Event_Sit
  
  /varset v31 $char(y)
  /varset v41 $char(x)
  /press esc
  :Sit
  
  /doevents
  /face loc $v31, $v41
  /if $distance($v31,$v41)>5 /sendkey down up /goto :Sit
  /sendkey up up
  /sit
  /return

[/code]