Getting $alert(1) name without /target alert 1 (possible?)

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

Moderator: MacroQuest Developers

lifewolf
a ghoul
a ghoul
Posts: 143
Joined: Fri Oct 18, 2002 6:29 pm

Getting $alert(1) name without /target alert 1 (possible?)

Post by lifewolf » Sat Oct 26, 2002 8:06 pm

Been looking around and asked a fiew people and the answer has evaded me. Keep in mind that im typing this example out with syntax errors as they occur.

Say i have an NPC on my alert list. Something like /alert add 1 npc "Bloodtribe Ancient"

Now, I can run a macro to tell me if the NPC is up. It would look something like this.

Code: Select all

Sub Main
    /if $alert(1)==1 /target alert 1
    /echo --$target(name)-- is up! -- Far: $target(distance) --
    /return
Now, this works. It checks to see if "Bloodtribe Ancient" (or the first actually spawned NPC on your first alert list) is up, targets it, and echos [MacroQuest] --Bloodtribe Ancient-- is up! -- Far: <DISTANCE_AWAY> --

But..
Say im in the middle of killing 3 mobs or quading 4 or something where i dont want to be disturbed, except for the echo
'/target alert 1' would screw lots of things up given one of those situations. What I can do to slightly remedy this is edit the script.

Code: Select all

Sub Main
    /if $alert(1)==1 {
          /varset $v1 $target(name)
          /target alert 1
          /varset $v2 $target(name)
          /target "$v1"
         /echo --$v2-- is up! -- Far: $distance($v2) --
    }
    /return
But... Still... Changing my target when im busy healing myself or something may not be the best idea. I would like to take out the '/target alert 1' line but still make the script function. I was hoping something such as '/echo $alert(1).name' would be avail but cant find anything similar as of yet. The new script would resemble:

Code: Select all

Sub Main
    /if $alert(1)==1 {
         /varset v1 $alert(1).name
         /echo --$v1-- is up! -- Far: $distance($v1) --
    }
    /return
Would appreciate any help. I RTFM'd but a 'subtle' notice to do so again would work, pending my 'reading comprehension' skill was too low the first time.

Im also looking into making a very nice named pop script.. One that incorporates the SEQ filters.conf listings... Im not sure how abused that would be, though, when 5 people using MQ are in SK and Quill spawns and they all form an asterisk running to him =/. AC too for that matter..

/ponder

Thoughts?