Moderator: MacroQuest Developers
<Label item ="Container_Label">
<ScreenID>Container_Label</ScreenID>
<Font>1</Font>
<RelativePosition>true</RelativePosition>
<Location>
<X>2</X>
<Y>4</Y>
</Location>
<Size>
<CX>88</CX>
<CY>32</CY>
</Size>
<Text>Container Name Here</Text>
<TextColor>
<R>255</R>
<G>255</G>
<B>255</B>
</TextColor>
<NoWrap>false</NoWrap>
<AlignCenter>true</AlignCenter>
<AlignRight>false</AlignRight>
</Label>
Code: Select all
<DrawTemplate>WDT_RoundedNoTitle</DrawTemplate>
<Style_Titlebar>false</Style_Titlebar>
just skimming through posts, maybe try "official" NPC names, not "clean" ones.orb wrote:Tried that with no luck, doesn't respond to "crag" or "crap spider" or "a crag spider"

Code: Select all
#define TargetNum v57
#define TargetArr v58
#define TargetDist v59
Code: Select all
sub GetTarget
|setup the variable for the for loop
/varcalc TargetNum $MobArraySize -1
:Aquire
|set distance huge so that everything is always closer than it.
/varset TargetDist 9999990
/for v1 0 to $TargetNum |being the loop
/target nopcnear $KSRadius npc "$a(2,$v1)"
|If target is closer than current distance change the variables to the current target.
/if n $target(distance)<$TargetDist {
/varset TargetDist $target(distance)
/varset TargetArr $v1
}
|/echo "Closest is $TargetDist "
/next v1
|target the closest target
/target nopcnear $KSRadius npc "$a(2,$TargetArr)"
/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
/echo "Distance to target is $target(distance)"
|the line below is for the maximum distance the target is allowed to be uncomment to use, and change the 900 to suit.
|/if n $target(distance)>900 /goto :Aquire
/if n $target(distance)<180 /call stunIT
/varset HasTarget 1
/return 