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
/returnThe 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.


