• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

SafetyCheck.inc - Player/GM checker..

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
  • Beta 1.
    Untested.
2006-08-12
  • Fixed a copy/paste error in the "All features" example.
2006-12-14
  • Fixed a missing parenthisis set in an /if.
  • Updated macro to use alert lists instead of arrays (Thanks to Peter Waren for the idea).
2007-02-14
  • 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]
Examples:
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
Simple:
Rich (BB code):
#Include SafetyCheck.inc
Sub Main
    /call SafetyCheck
    /if (${Macro.Return.NotEqual[OK]}) /endmacro
/return
SafetyCheck.inc
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:
someoneorsomething said:
So thats how you do it. GJ ELS. i racked my brain on this for a good hour yesterday.
I've still been too lazy to actually test it (busy with other stuff), does this mean you've used it and confirmed it working? :)
 
This is pretty similiar to what I created, one other thing I inlcuded in mine you may like is the use of a custom notification subroutine.

/call SafetyCheck <radius> <alertlist> <notification sub>

This way folks can customize thier reactions for the script they are using.
 
I have been searching for this for so long now!!! Man you get a red cent!

Admin, if there are others like me, can we sticky this? Or make it easier to find, like right out in the open? In all my searching I never found it, it was pointed out to me by another member.

N
 
Copy and paste it into notepad
click on save as
change it from Save as type: "text document" to all files
type the name you want used like
blahblah.inc

(for macro's use .mac)

Macro's do not need to be compiled, it is read by MQ as plain text.
 
SafetyCheck.inc - Player/GM checker..

Users who are viewing this thread

Back
Top
Cart