Need help with a command to check for PC's within 20 feet.

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

skysurf
a lesser mummy
a lesser mummy
Posts: 52
Joined: Fri Aug 15, 2003 1:54 am

Need help with a command to check for PC's within 20 feet.

Post by skysurf » Mon Dec 08, 2003 3:33 pm

I can't seem to figure out the best way to write a command that would trigger something if any PC's were within 20 feet of me.


Thanks in advance :)

Sky

nimblefoot
a lesser mummy
a lesser mummy
Posts: 33
Joined: Sun Jun 29, 2003 11:50 am

Post by nimblefoot » Mon Dec 08, 2003 4:38 pm

It's not the best way, but for a temporary fix do a /w in conjunction with an event check. Post your code and I can insert it for you if you need help.

NotSoCSharp
a ghoul
a ghoul
Posts: 85
Joined: Sat Oct 25, 2003 10:48 am

Post by NotSoCSharp » Mon Dec 08, 2003 4:52 pm

Try this:

Code: Select all

/target pc radius 20
/if $target()=="TRUE" {
   /echo "There is a PC within 20 of me!!!"
}


EqMule
Developer
Developer
Posts: 2697
Joined: Fri Jan 03, 2003 9:57 pm
Contact:

Post by EqMule » Mon Dec 08, 2003 5:55 pm

Code: Select all

/if n $searchspawn(pc,loc:$char(x):$char(y),radius:20)!=0 /call someaction
My status o/
If you like MQ2 and would like to contribute, please do. My goal is 25 donations per month.
So far I've received Image donations for this month's patches.

Bitcoin: 1Aq8ackjQ4f7AUvbUL7BE6oPfT8PmNP4Zq
Krono: PM me.
I can always use characters for testing, PM me if you can donate one.

User avatar
Undies
a ghoul
a ghoul
Posts: 94
Joined: Mon Oct 20, 2003 9:12 pm

Post by Undies » Mon Dec 08, 2003 10:42 pm

Except $searchspawn appears to be bugged in the December 06 2003 15:58:18 zip release, so don't bust a gut over that one ATM Skysurf.