EvenLessSpam
Active member
- Joined
- Oct 31, 2005
- RedCents
- 91¢
Name:
SafetyCheck.inc
Description:
A simple include to use for all those AFK macroes. Will check for players within specified distance (default 500) as well as GM's. It will return OK if everything checks out fine, GM if a GM is detected and PC if a non-excluded players is in range.
Changes:
2006-08-11
Syntax:
Examples:
Advanced:
Simple:
SafetyCheck.inc
SafetyCheck.inc
Description:
A simple include to use for all those AFK macroes. Will check for players within specified distance (default 500) as well as GM's. It will return OK if everything checks out fine, GM if a GM is detected and PC if a non-excluded players is in range.
Changes:
2006-08-11
- Beta 1.
Untested.
- Fixed a copy/paste error in the "All features" example.
- Fixed a missing parenthisis set in an /if.
- Updated macro to use alert lists instead of arrays (Thanks to Peter Waren for the idea).
- Moved this out of beta stage

- Changed Radius a bit so -1 will be zonewide player checking, and made that the default Radius.
- Added it as a zipped attachment to this post.
Syntax:
Rich (BB code):
/call SafetyCheck [int CheckRadius] [int AlertList]
Advanced:
Rich (BB code):
#Include SafetyCheck.inc
Sub Main
|--------------------------------------------------------------------------|
|- First clear the alert list. Using alert list #1 -|
|--------------------------------------------------------------------------|
/alert clear 1
|--------------------------------------------------------------------------|
| Then populate the alert list. Still using alert list #1 ;) -|
|--------------------------------------------------------------------------|
/alert add 1 pc "ThisOneIsOkay"
/alert add 1 pc "ThisOneCanAlsoBeAroundMe"
|--------------------------------------------------------------------------|
| Do the SafetyCheck with a radius of 500 and excluding players on alert -|
| list #1 -|
|--------------------------------------------------------------------------|
/call SafetyCheck 500 1
/if (${Macro.Return.NotEqual[OK]}) {
/popup There's someone near who isn't welcome...
/if (${Macro.Return.Equal[GM]}) {
/popup OMG! It's a GM. Time to bail...
/quit
/endmacro
} else /if (${Macro.Return.Equal[PC]}) {
/popup Pesky players, they're everywhere...
/say Beat it! This is my camp.
}
}
/return
Rich (BB code):
#Include SafetyCheck.inc
Sub Main
/call SafetyCheck
/if (${Macro.Return.NotEqual[OK]}) /endmacro
/return
Rich (BB code):
|**
* SafetyCheck.inc - by EvenLessSpam
*
* Version: 1.0.0
*
* Changes:
* 0.0.1
* - Beta 1. Untested.
*
* 0.1.0
* - Changed the player exclusion list from array based to alert list based.
* thanks to Peter Waren of MMOBugs for the idea.
*
* 0.1.0
* - Changed the player exclusion list from array based to alert list based.
* thanks to Peter Waren of MMOBugs for the idea.
*
* 1.0.0
* - Moved this out of beta stage :)
* - Changed Radius a bit so -1 will be zonewide player checking, and made that the default Radius.
**|
Sub SafetyCheck(int Radius, int Exclude)
/declare i int local 0
/declare c int local 0
/if (!${Defined[Radius]}) /declare Radius int local -1
/declare SafeSearch string local pc ${If[${Radius} > -1,radius ${Radius} zradius 50,]} notid ${Me.ID}
/if (${Defined[Exclude]}) /varset SafeSearch ${SafeSearch} noalert ${Exclude}
/if (${SpawnCount[${SafeSearch}]} || ${SpawnCount[gm]}) {
/if (${SpawnCount[gm]}) {
/return GM
} else {
/for i 1 to ${SpawnCount[${SafeSearch}]}
/if (${Group.Member[${NearestSpawn[${i}, ${SafeSearch}]}]}) /goto :Continue
/return PC
:Continue
/next i
}
}
/return OK
Last edited:


