PC Alerts?

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

Moderator: MacroQuest Developers

pablo
decaying skeleton
decaying skeleton
Posts: 3
Joined: Fri Dec 06, 2002 10:26 pm

PC Alerts?

Post by pablo » Fri Dec 06, 2002 11:25 pm

Hi,

I have been trying to think of a way to know when any player is near, hopefully without having to target them. Just like evaluating $alert(x) for npc's while fighting.

The trouble I've had with an alert list for pc's is I need a spawn name. So if I want everyone, I use an alert for players with 'a e i o or u' in their name, (or all 26 alphas perchance). So then I'm always on it and it's always true.

The output of a /who does not look very conducive to parsing and dynamic management, so thats out AFAIK.

Only way I can think of is hairy - find my id, then do a /target pc notid $myID and get a distance. Sucks because I would like to keep my target selected.

I did find this thread which is sorta similar but different in that I am concerned about any pc at all:

http://macroquest2.com/phpBB2/viewtopic.php?t=1206

I've looked through the chages in recent versions, readmes, examples, search results, etc, is this something that still needs to get developed? Seems to be akin to the responsible macroing(tm) ideal, e.g. I couldn't think of running w/o $gm, though I know it's not foolproof.

Thank you for reading.

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Sat Dec 07, 2002 12:32 am

Salutations,

Code: Select all

:loop
/varset v0 $target(id)
/target nopcnear 75 id $target(id)
/if n $target(id)!=$v0 {
 /target id $v0
 /echo There is a pc within 75 clicks of us...
}
/goto :loop
that work for yaz?

pablo
decaying skeleton
decaying skeleton
Posts: 3
Joined: Fri Dec 06, 2002 10:26 pm

PC alerts

Post by pablo » Sat Dec 07, 2002 3:30 pm

R12,

For your gift of code, a fruit basket.

Image

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Sat Dec 07, 2002 10:44 pm

Salutations,
you're welcome...

drako
orc pawn
orc pawn
Posts: 17
Joined: Mon Dec 09, 2002 12:09 am

Post by drako » Mon Dec 09, 2002 12:12 am

i was asking the same thing in irc, but maybe not sure how you would do it just asking (i know nothing about macros) but maybe for example:

i play on a pvp server, and if you all dont know people can attack you if they are with in 4 lvls lower then you or 4 lvls higher then you, including your lvl. and maybe you can take this macro so it will only echo the msg if the person is within your lvl range. would be very useful but maybe instead of 75, prolly 200 but that is easy to changeto a persons prefence.

Thanks

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Mon Dec 09, 2002 1:45 am

Salutations,

Code: Select all

:loop
/varset v0 $target(id)
/target nopcnear 75 id $target(id)
/if n $target(id)!=$v0 {
 /if n $target(level)>=$calc($char(level)-4) /if n $target(level)<=$calc($charlevel)+4) /echo $target(name) is within 75 clicks of you... watch out...
 /target id $v0
}
/goto :loop
How about that?

drako
orc pawn
orc pawn
Posts: 17
Joined: Mon Dec 09, 2002 12:09 am

Post by drako » Mon Dec 09, 2002 7:09 pm

awesome, ill try it out right now hehe will help for thoes times im not paying much attion to people in the zone