Scan through different targets possible?

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

Moderator: MacroQuest Developers

spudgun
orc pawn
orc pawn
Posts: 17
Joined: Wed Mar 12, 2003 12:13 am

Scan through different targets possible?

Post by spudgun » Wed Mar 12, 2003 12:20 am

I haven't wrote a script for anything yet and this might be a tough one to jump into. So, before i attempt it is this possible:

Nuking mobs in cluster once seperately. some may have a similar name and some may occupy the same area space.

Ohmz
Developer
Developer
Posts: 97
Joined: Tue Feb 04, 2003 12:54 pm

How to:

Post by Ohmz » Wed Mar 12, 2003 1:47 am

<target npc>
/echo $target(name)
<write the name down>
<repeat this until you have the spawn name of each npc>


add this to your code:
/varset a(1,1) a_spawn_name00
/varset a(1,2) a_spawn_name01
/varset a(1,3) a_spawn_name02
...
/varset v99 3 | need a number to represent the number of creatures in your array

then:
/for v1 1 to $v99
/target id $id($a(1,$v1))
/next v1

is a sample of how to access/target each creature in that array. I may have left out somthing simple here as I just typed this code w/o testing it at all, but thats the general idea behind the best way to do it.

spudgun
orc pawn
orc pawn
Posts: 17
Joined: Wed Mar 12, 2003 12:13 am

Post by spudgun » Wed Mar 12, 2003 1:53 am

So i need to discover the ID name of each mob. Ok, so if its a total of 34 mobs that may or may not be in this cluster of mobs how can i make sure it only tries to nuke all the closest mobs or the mobs ive pulled as opposed to trying to nuke all 34 mobs until it hits the ones it can reach.

I appreciate your fast help on this steadily slowing board

Ohmz
Developer
Developer
Posts: 97
Joined: Tue Feb 04, 2003 12:54 pm

Distance

Post by Ohmz » Wed Mar 12, 2003 3:48 am

Tons of ways to do that.. use $distance

/varset v88 $id($a(1,$v1))
/if n $v88!=0 /if n $distance(blah)<VALUE
{
/target id $v88
}

or somthing like that :-)

Jay
a lesser mummy
a lesser mummy
Posts: 59
Joined: Tue Jan 28, 2003 11:37 am

Post by Jay » Wed Mar 12, 2003 4:48 pm

How would I find the closest mob from anouther mob? I.E. find the mob that is closest to target (anouther mob)?

Jay

Ohmz
Developer
Developer
Posts: 97
Joined: Tue Feb 04, 2003 12:54 pm

Use alerts

Post by Ohmz » Wed Mar 12, 2003 9:37 pm

/target nearalert 2 alert 1

targets the alert 1 nearest alert 2.