Modified hunter macro problems

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

Moderator: MacroQuest Developers

Random
decaying skeleton
decaying skeleton
Posts: 5
Joined: Sun Jul 20, 2003 3:31 pm

Modified hunter macro problems

Post by Random » Fri Aug 22, 2003 7:58 pm

Code: Select all

| Palahunter script
| A.K.A. "Why the fuck won't this work?"
|
|
|

#define MyXLOC v40 
#define MyYLOC v41 
#define KSRadius v42 
#define NotSee v43 
#define TooFar v44 
#define MyTarget v45 
#define TargetDead v46 
#define HasTarget v47 
#define ObstCount v49 
#define LootSlot v50 
#define CheckLoot v51 
#define LootTotal v52 
#define MobArraySize v53 
#define DefKeep v56 

| Buff defines
|___________________
#define AuraFade v59
#define PiousFade v60
#define HasteFade v62

| Camp and return defines
|_____________________
#define XCampLoc v63
#define YCampLoc v64
#define AtCamp v65
#define NeedRest v67

| Rest Defines
|_________________
#define Rested v66

#event xPious "hands stop glowing."
#event xHaste "The blessing ends."
#event xAura "Your protection fades." 

Sub Main 
    /zapvars 
    /press esc 
    /press esc 
    /press alt 
    /press shift 
    /press ctrl 
    /varset LootSlot 0 
    /varset CheckLoot 0 
    /varset a(1,0) "skin" 
    /varset a(1,1) "silk" 
| Add as many of these  as you want but make sure you 
| increase LootTotal 
    /varset a(2,0) "wolf"  
    /varset a(2,1) "spider" 
| Add as many of these as you want but make sure you 
| increase MobArraySize 
    /varset LootTotal 2 
    /varset KSRadius 60  
    /varset ObstCount 0 
    /varset MobArraySize 1 
| Camp locs. You fuck these up and you'll have a real problem...
    /varset XCampLoc 2336.35
    /varset YCampLoc 1210.10
   
   :Start 
    /doevents
    /if "$char(state)"=="SIT" { 
        /sit off 
    }
    /call GMAlert  
    /call HowsItGoing
    /call GetTarget 
    /if $HasTarget=="1" {
        /call PullIt 
    }
    /goto :Start 
    
/return 

|%%%%%%%%%%%%%%%%%%%%%%%%%|
| GMs make me shit myself |
|_________________________|
sub GMAlert 
    /alert add 1 pc GM 
    /target alert 1 
    /if $target()!=FALSE { 
        /endmacro 
        /unload 
        /q 
    } 
    
/return 


|%%%%%%%%%%%%%%%%%%|
| Need hp or mana? |
|__________________|
sub HowsItGoing
    /if n $char(hp,pct)<=50 {
        /call CampReturn
    }
    /if n $char(mana,pct)<=60 {
        /call CampReturn
    }

/return
|%%%%%%%%%%%%%%%%%%%%%%%%%%|
| Getting a target to kill |
|__________________________|
sub GetTarget 
   :Aquire 
    /target nopcnear $KSRadius npc "$a(2,$rand($MobArraySize))" 
    /varset MyTarget $target(id) 
    /varset TargetDead 0 
    /if n $target(id)==0 /goto :Aquire 
    /if $target()=="FALSE" /goto :Aquire 
    /if n "$target(hp,pct)"<="99" /goto :Aquire 
    /varset HasTarget 1 
    
/return 




|%%%%%%%%%%%%%%%%%|
| Pulling to camp |
|_________________|
Sub PullIt
    /cast 2
    :waiting
    /if n $target(distance)<=40 {
       /call CombatSub
    } else {
    /goto :waiting
    }

/return



|%%%%%%%%%%%%%%%%%%%%%%%|
| LET THE KEELING BEGIN |
|_______________________|
sub CombatSub 
    /if $target()=="FALSE" { 
        /varset HasTarget 0 
        /return 
    } 
    /attack on 
   :combatloop  
    /face fast nopredict 
    /doevents 
    /if n $target(distance)>20 { 
        /sendkey down up 
        /goto :combatloop 
    } 
  | If I'm low, must heal self!
  |_____________________
    /if n $char(hp,pct)<=50 {
        /target myself
        /cast 3
        /press esc
    }
    /if n $target(distance)<=20 /sendkey up up 
    /face fast nopredict 
    /if n $target(id)==0 /varset TargetDead 1 
    /if n $TargetDead!=1 /goto :combatloop 
    /delay 1s 
    
/return 



|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|
| Low on health or mana? Back to camp! |
|______________________________________|
sub RunCamp
   :runloop
   /face $1210.10,2336.35
   /echo $distance(1210.10,2336.35)
   /if n $distance(1210.10,2336.35)>=20 {
        /sendkey up up
   }
   /if n $distance(1210.10,2336.35)<=20 {
        /call CampReturn
   } else {
   /goto :runloop
   }

/return



sub CampReturn 
   | If we didnt make it home we dont want to rest 
   /if $AtCamp=="TRUE" {
        /call Resting
   } else {
        /call RunCamp

/return




|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|
| Medding, buffing, healing, and so on |
|______________________________________|
sub Resting
       :restloop
       /doevents
    | Rebuffin!
    |______________________
       /if $PiousFade=="TRUE" {
          /cast 6
          /varset PiousFade "FALSE"
          /delay 10s
          /goto :restloop
       }
       /if $AuraFade=="TRUE" {
          /cast 7
          /varset AuraFade "FALSE"
          /delay 10s
          /goto :restloop
       }
       /if $HasteFade=="TRUE" {
          /cast 5
          /varset HasteFade "FALSE"
          /delay 10s
          /goto :restloop
       } 
    | Healing!
    |_______________________
       /if n $char(hp,pct)<=50 {
          /target myself
          /cast 1
          /delay 10s
          /goto :restloop
       } 
    | Gotta sit down if we wanna regen at a decent speed
    |______________________________________
       /if "$char(state)"=="STAND" { 
          /sit on 
       }
       /if n $char(mana,pct)>60 { 
          /varset NeedRest FALSE
       } else {
       /goto :restloop
       }

/return

|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|
| OH NO, BUFFS HAVE FADED, WHAT DO WE DO |
|________________________________________|
sub Event_xPious 
    /varset PiousFade TRUE
 
/return 



sub Event_xAura
    /varset AuraFade TRUE

/return



sub Event_xHaste
    /varset HasteFade TRUE

/return
It's basically the hunter macro modified for a high level paladin.

The macro pulls and kills fine, however there are some problems.

1) I can't figure out how to retarget the mob after I heal myself in combat. The best solution I could come up with was to hit esc after the heal so when I got hit the next round it would automatically target the attacker and continue. The problem is for some reason this messes up the combat loop.

After healing myself once, the combat loop just stops until the mob dies, meaning I don't chase the mob down if its runnnig, and if I get below 50% hp again, I don't heal myself.

2) The macro totally disregards resting and running to camp. I'm not sure if I messed up the comparison or what but even if I'm oom and at 5% health, it will still pull another mob rather than going back and sitting down (and healing) like it should be.

Any help would be greatly appreciated.

User avatar
blueninja
a grimling bloodguard
a grimling bloodguard
Posts: 541
Joined: Thu Aug 28, 2003 7:03 am
Location: Göteborg, Sweden

Post by blueninja » Thu Sep 25, 2003 12:50 pm

Here's what I do in my self heal routine to get the target back:

Code: Select all

   /varset l0 $target(id) | Save id of current target to local var 0
   /target id "$char(id)" | target self
...
 /cast heal etc
...

   /target id $l0             | Retarget
[/code]

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Resting and returning to camp.

Post by grimjack » Thu Sep 25, 2003 1:15 pm

Code: Select all

sub RunCamp
   :runloop
   /face [color=red]$[/color]1210.10,2336.35
   /echo $distance(1210.10,2336.35)
   /if n $distance(1210.10,2336.35)>=20 {
        /sendkey up up
   }
   /if n $distance(1210.10,2336.35)<=20 {
        /call CampReturn
   } else {
   /goto :runloop
   }

/return
I see a $ that should not be there. Also /sendkey up up should be /sendkey down up and I believe you are missing a /sendkey up up to stop running.

Code: Select all

sub RunCamp
   :runloop
   /face 1210.10,2336.35
   /echo $distance(1210.10,2336.35)
   /if n $distance(1210.10,2336.35)>=20 {
        /sendkey [color=red]down[/color] up
   }
   /if n $distance(1210.10,2336.35)<=20 {
        [color=red]/sendkey up up[/color]
        [color=red]/varset AtCamp TRUE[/color]
        [color=red]/return[/color]
   } else {
   /goto :runloop
   }

/return
I need sleep or I would look into the rest of your problems. Good luck.

Thanks
GrimJack
When they come to me, they're in trouble, or they want some. I bust people out of prison, hunt down vampires, fight alien gods -- All the fun jobs people are too squeamish or too polite to do themselves.

Call me a mercenary. Call me an assassin. Call me a villain. I am all that and more.

My name's John Gaunt, but out on the streets of Cynosure, I am called...
GrimJack