Modify the targets so that they outline 3 NPCs in the zone you're testing in. There's no fight code in here, so don't worry about dying. It simply targets the NPCs, and then orders them in an array based on their level.
Ideas I want to do but would like for others to do so that I can be lazy:
- Have a 'RunAway' variable. Weight it based on the number in the list. Say the if RunAway => 1 then /call RunRunRun where RunRunRun does it's best to get you the hell outta dodge. Then we can work on a mathimatical formula for the variable RunAway. Say, each full blue on you counts as .5, each even con as .9, and each greenie as .2. Yellows and higher are worth 1. Really want to make it smart? Factor health into it. If I'm at half I want to run from a full blue.
- Smarten up the hate. This would be easy, I just wanted to keep my code clean. Say, if it's a caster then add .5 to the level. Then it attacks a 10 caster before a 10 melee, but will still go after that 11 brute.
Anyway, as I said I'm still working on a hunter script - using a lot of Fippys concepts in it (that one he did was incredible, just reading through it made this language make sense to me). Let me know if there are any questions / suggestions and please, if you use this then at least PM me so that I can see what you did with it. Enjoy :).
Code: Select all
|
| HateList.mac
|
| By Nerfy
| Status: Proof of concept
|
| This just demos a hatelist array. Keeps meanest mob in
| top position. Idealy you could keep casting mob in top
| position, or the main mob you're hunting. This way you
| can keep a list of mobs to track down - and if you get
| bashed in route you won't go all the way to the greenie
| before taking on the guy that can actually deal damage.
#define HateListLen v21
| Main Subroutine
Sub Main
| Init
/call CleanUpScreen
/varset HateListLen 0
| Pick 3 different guys, add each to the hate list
/call GetTarget1
/call GetTarget2
/call GetTarget3
| Display Hate List
/call DisplayHateList
|Clean Up
/call CleanUpScreen
/return
Sub GetTarget1
| Target Me
/press F1
| Target MOB
/target npc Vox
| Tell what we did
/echo GT1: $target(name)
| If we found something, add it to the list
/if $target(name)!=$char(name) /call AddToHateList $target(id)
/return
Sub GetTarget2
/press F1
/target npc Priest
/echo GT2: $target(name)
/if $target(name)!=$char(name) /call AddToHateList $target(id)
/return
Sub GetTarget3
/press F1
/target npc Goblin
/echo GT3: $target(name)
/if $target(name)!=$char(name) /call AddToHateList $target(id)
/return
Sub DisplayHateList
| Spit out your hate list to the screen
/echo
/echo ListLen: $HateListLen
/echo ---------------------
/for v95 1 to $HateListLen
/target id $a(0,$v95)
/echo $v95 ID: $a(0,$v95)
/echo $v95 LV: $target(level)
/echo $v95 NM: $target(name)
/echo ---------------------
/next v95
/echo
/return
Sub AddToHateList
| v90 - Hold ID
| v91 - Hold Lvl
| v92 - Current HateList Level
| v93 - Swap ID
| v95 - For Loop Var
| Set the new ID into the hold var
/varset v90 $p0
/echo Adding $v90 to HateList
| Get his level into v91
/target id $v90
/varset v91 $target(level)
| If he's not the first, make sure he's put into the right place.
| We want to order out hate list in order of strongest mob
/if $HateListLen>1 {
/for v95 1 to $HateListLen
| Check the level of the current mob
/target id $a(0,$HateListLen)
/varset v92 $target(level)
/if $v92<$v91 { | New guy is stronger, time to reorder
/varset v93 $a(0,$v95) | Store old one to Swap ID
/varset a(0,$v95) $v90 | Put stronger guy in list
/varset v90 $v93 | Put old one into Hold ID
/varset v91 $v92 | Old level into Hold Lvl
}
/next v95
| Add whats left in Hold ID to the list
/varcalc HateListLen $HateListLen+1
/varset a(0,$HateListLen) $v90
} else {
/varcalc HateListLen $HateListLen+1
/varset a(0,$HateListLen) $p0
}
/return
Sub CleanUpScreen
/sendkey up ctrl
/sendkey up shift
/sendkey up alt
/press esc
/press esc
/press esc
/sit off
/delay 2
/return



