/* * massmsg.tek * * Author: Brian Weiss - 2001 * Last modified: 4/22/02 * * Script to demonstrate sending throttled private msgs to a certain user * class. I wrote this because everyone seems to love pounding the crap out * of servers by doing things like sending a whois request for each and every * user returned by /gusers. In almost all cases /wallop and /announce should * be used in place of anything like this. However, there are some situations * where this script would be useful. Such as sending a private msg to all * moderators not joined to a specific channel, asking them to please join it. * All this gains you, as opposed to using /wallop, is that the moderators * that are already joined to the specified channel would not see the msg. * This is just one example of a possible use for this script, and it isn't * even a good one. I really don't see any reason to do something like this, * but since people insist, it might as well be done in a way that is easier * on the servers. * * THIS SCRIPT WAS WRITTEN PRIMARILY AS A DEMONSTRATION FOR OTHER SCRIPTERS. * IF YOU DO NOT UNDERSTAND EXACTLY WHAT THIS DOES, DO NOT LOAD IT. */ /*** CONFIG SECTION ***/ /* * DELAY is in seconds and SILENT is boolean and determines whether or not * you see the msgs being echo'd to your screen. */ assign MASSMSG.DELAY 10 assign MASSMSG.SILENT 0 /*** END CONFIG SECTION ***/ /* * /MASSMSG * Queries /gusers and begins sending desired text to each user that matches * the criteria. If you wish to make the user meet a specific criteria other * than user class, see the massmsg.checkuser() function at the bottom of this * script. */ alias massmsg (ulevel, text) { if (text && ulevel == [*] ^^ rmatch($tolower($ulevel) -l* -u* -m* -a* -e*)) { ^assign MASSMSG.TEXT $text @ delarray(massmsg) ^on ^831 "*" { xecho -b Found $numitems(massmsg) users. input "Should we begin messaging these users? " { if (tolower($left(1 $0)) == [y]) { _massmsg }{ xecho -b Mass-msg aborted. } ^on 831 -"*" ^on 832 -"*" } } ^on ^832 "*" { @ setitem(massmsg $numitems(massmsg) $0) } }{ xecho -b Usage: /massmsg <*|-l|-u|-m|-a|-e> } } alias startmassmsg _massmsg alias stopmassmsg (void) { ^timer -del 666 xecho -b Mass-msg halted! You can begin again with /startmassmsg } alias _massmsg (void) { if (numitems(massmsg) && MASSMSG.TEXT) { @ :user = getitem(massmsg 0) if (massmsg.checkuser($user)) { if (MASSMSG.SILENT) { ^msg $user $MASSMSG.TEXT }{ msg $user $MASSMSG.TEXT } @ delitem(massmsg 0) }{ @ delitem(massmsg 0) } ^timer -ref 666 $MASSMSG.DELAY _massmsg } } /* * This is where you can make sure the user matches certain criteria. For * example, you might want to parse a whois response for this user and msg * them only if they are in certain channels, have a specific linespeed, * whatever. In order for the msg to be sent to the user, this must return * a value that /if will see as TRUE. This means pretty much anything other * than "0". If "0" is returned the user will be skipped and removed from * the list of users to msg. */ alias massmsg.checkuser (nick, void) { return 1 } /* EOF */