home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1998-07-12 | 102.0 KB | 3,357 lines
#Kent Sorensen 07/11 modified to print out disclaimer about the unsupported language features #Also removed the LC lagcheck becuse Snak doesn't support event handlers yet... # # ########################################################################## # # PurePak - The sequel to TextBox # # A -+ TEXT +- production # # ########################################################################## # # Author: Crypt Keeper [ckeeper@axiom.access.one.net] (CKeeper on IRC) # Version 2.07 # # This script requires at least ircII2.2.9 (Unix) or a fully ircII compatible # client. It has only been tested under Unix with ircII2.2.9 and ircII2.8.2. # # If you edit this file, you must edit it with a Unix text editor or use # utilities like dos2unix/unix2dos to convert it to DOS to edit and then # back to Unix. If it is edited in a DOS text editor it will be corrupted. # # All stolen code is labelled. If it isn't labelled as stolen code, then it # is mine. If you take my code, please give me credit. # # PurePak version 2.07 IRC script # Copyright (C) 1995 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 1, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # ########################################################################## # ^set novice off ^set exec_protection off ^set input_protection off @ PPVERS = [2.07] # ---------------------------------------------------------------------------- # Sets and key bindings # ---------------------------------------------------------------------------- # See if we're on an EPIC client EVAL ^if (match(*EPIC* $status_user)) {@ PP.EPIC = 1} EVAL ^set input_prompt [PurePak] version $PPVERS loading... ^set tab on ^set tab_max 6 ^set send_ignore_msg off ^set clock_24hour off ^set clock on ^set status_away (away) ^set user_information [PurePak] ^set status_user [Lag ??] [PurePak] * ^set status_query [Query: %Q] ^set status_notify [Activity: %F] ^set status_oper * ^set status_overwrite (overtype) ^set status_window ^^^^^^^^ ^set status_mode (+%+) ^set status_mail [Mail: %M] ^set status_server via %S ^set channel_name_width 10 ^set debug 0 ^set help_window off ^set help_prompt on ^set hold_mode_max 0 ^set input_aliases off ^set insert_mode on ^set lastlog 16384 ^set lastlog_level all ^set scroll on ^set scroll_lines 1 ^set shell_limit 0 ^set status_hold_lines (%B) ^set command_mode off ^set double_status_line off ^set suppress_server_motd off ^set show_end_of_msgs off ^set beep_when_away 0 EVAL ^set client_information [PurePak] v$PPVERS by Crypt Keeper ^set status_hold -- ENTER -- ^set beep_max 2 ^set warn_of_ignores on ^set verbose_ctcp off ^set indent on ^set auto_whowas off ^set full_status_line on ^set continued_line ^set hide_private_channels off ^set show_away_once on ^set history 120 ^set auto_unmark_away off ^set beep_on_msg NONE ^set show_channel_names on ^set show_numerics off ^set max_recursions 210 ^set log off ^set logfile irc.log ^set input_protection off ^set dcc_block_size 1024 ^set no_ctcp_flood on ^EVAL ^if ([$mail] == [0]) {^set mail 1} ^EVAL ^set load_path ~/purepak:./purepak:~:$load_path ^set hold_mode off ^set notify_on_termination off ^set show_who_hopcount off ^set flood_warning off ^set flood_rate 1 ^set flood_after 4 ^set flood_users 4 ^EVAL ^set status_format %T %*%@%N%#%Q%S%H%B%A%C%+%I%O%F %W%>%U%M%X%Y%Z bind ^X meta2 bind ^\ switch_channels bind ^Q quote_character bind ^I parse_command ^tk.getmsg 1 $tk.msglist bind ^R parse_command ^tk.getmsg -1 $tk.msglist bind ^X^X parse_command tk.delnick bind ^S toggle_stop_screen bind ^[ meta1 bind meta1-[ meta2 bind meta1-O meta2 bind meta2-^@ scroll_end bind meta2-A backward_history bind meta2-B forward_history bind meta2-C forward_character bind meta2-D backward_character bind meta2-5 parse_command ^s_up bind meta2-6 parse_command ^s_dn bind meta2-1 parse_command ^s_end bind meta2-7 parse_command ^s_end bind ^X^A scroll_backward bind ^X^B scroll_forward bind ^B self_insert bind ^_ self_insert bind ^V self_insert bind ^A self_insert bind ^O self_insert bind ^W next_window bind ^Z stop_irc bind ^U erase_line alias s_up { ^bind ~ nothing ^type ^U^X^A^U ^timer 1 ^bind ~ self_insert } alias s_dn { ^bind ~ nothing ^type ^U^X^B^U ^timer 1 ^bind ~ self_insert } alias s_end { ^bind ~ nothing ^type ^[[^@ ^timer 1 ^bind ~ self_insert } # File that settings are saved to @ PP.SAVEFILE = [purepak.sav] on ^dcc_raw * {} # ---------------------------------------------------------------------------- # Tab key message history (originally from the ircII tabkey script) # ---------------------------------------------------------------------------- alias tk.addmsg { @ tk.matched = rmatch($0 $^\1-) if (tk.matched) { @ tk.msglist = [$(0-${tk.matched-1}) $(${tk.matched+1}-)] } { @ tk.msglist = [$(0-${tk.msgmax-1})] } @ tk.msgcnt = 0 ^assign -tk.matched } alias tk.getmsg { @ tk.msgcnt = tk.msgcnt + [$0] if ( #tk.msglist < tk.msgcnt ) {@ tk.msgcnt = 1} if (tk.msgcnt <= 0) {@ tk.msgcnt = #tk.msglist} @ tk.junk = K ## [msg] type ^U$tk.junk $^^{[$($tk.msgcnt)]} } alias tk.delnick { if (tk.msgcnt == 0) { echo *** Nickname: $word(0 $tk.msglist) removed. @ tk.msglist = [$notword(1 $tk.msglist)] } { echo *** Nickname: $word(${tk.msgcnt-1} $tk.msglist) removed. @ tk.msglist = [$notword($tk.msgcnt $tk.msglist)] } type ^U } alias notword { if ([$0]>0) { if (([$0]>1)&&([$0] < rmatch($~ $1-))) {@ nw.sep = [ ]} {@ nw.sep = []} @ function_return = [$(1-${[$0]-1})] ## [$nw.sep] ## [$(${[$0]+1}-)] } {@ function_return = [$1-]} } alias minnot { @ noticecnt = 0 ^assign -lastnoter ^assign -ntemp } # ---------------------------------------------------------------------------- # Miscellaneous functions and aliases, mostly internal # ---------------------------------------------------------------------------- # Lame aliases for buggy clients alias say { quote PRIVMSG $C :$* echo <${N}> $* } alias sendto { if (ischannel($0)) {^if ([$0] == C) {/echo <${N}> $1-} {/echo -> $0 <${N}> $1-}} {/echo -> [$0] $1-} ^quote PRIVMSG $0 :$1- } # /me alias that echoes to the right window (some clients don't) alias me { xecho -LEVEL CRAP -WINDOW $winnum() * $N $* quote PRIVMSG $C :ACTION $* } # Repeats $1 $0 times alias repeatcmd { @ RCOUNT = 0 while (RCOUNT < [$0]) { @ RCOUNT = RCOUNT + 1 $1- } ^assign -RCOUNT } alias nickonly {@ FUNCTION_RETURN = left($index(! $0) $0)} alias safestr {@ FUNCTION_RETURN = strip(\;\$ $*)} # Returns 1 if you have ops on $0, 0 if you don't. We use an alias instead # of ischanop() since ischanop doesn't always return a correct result on # older clients, and if ischanop were to say that you are not opped when you # really are, your protection stuff wouldn't go off. alias gotops { @ FUNCTION_RETURN = 0 if ([$0] == C) {^if (P == [@]) {@ FUNCTION_RETURN = 1}} {^if (ischanop($N $0)) {@ FUNCTION_RETURN = 1}} } # Returns a random letter/number string @ PP.RC = [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789a] alias randcrap { @ RC = 1 while (RC < [$0]) { @ RC = RC + 1 @ RS = mid($rand(62) 1 $PP.RC)##RS } @ RS = mid($rand(25) 1 $PP.RC)##RS @ FUNCTION_RETURN = RS ^assign -RS ^assign -RC } # Returns true if a string contains letters alias isalpha { if (rmatch($0 *a* *b* *c* *d* *e* *f* *g* *h* *i* *j* *k* *l* *m* *n* *o* *p* *q* *r* *s* *t* *u* *v* *w* *x* *y* *z*)) {@ FUNCTION_RETURN = 1} {@ FUNCTION_RETURN = 0} } # delword <word> <list> (output returned in NLIST) # recursive alias that deletes a word from a list alias delword { if ([$1] != [$0]) {^assign NLIST $1 $NLIST} if ([$2]) {^delword $0 $2-} } # Check is user is friended/shitted # ispal/isshit <n!u@h> <#channel> alias ispal { @ FUNCTION_RETURN = 0 foreach PP.FRIENDS XZ { if (match($decode($XZ) $1)) { if (rmatch($0 $PP.FRIENDS[$XZ])) {@ FUNCTION_RETURN = 1} } } ^assign -XZ } alias isshit { @ FUNCTION_RETURN = 0 foreach PP.ENEMIES XZ { if (match($decode($XZ) $1)) { if (rmatch($0 $PP.ENEMIES[$XZ])) {@ FUNCTION_RETURN = 1} } } ^assign -XZ } # The pager for long displays, such as in help. # We do it like this so it doesn't use the old $"-MORE-" method # which is outdated and causes problems on newer clients. alias pp.pauseset { @ ECCTR = 0 ^alias echo { @ EC[$ECCTR] = [$*] @ ECCTR = ECCTR + 1 } } alias pp.pauseend { ^alias -echo @ ECTR = 0 ^pp.doechos } alias pp.doechos { @ LCTR = 0 while ((ECTR < ECCTR)&&(LCTR < PP.SET.NUMLINES)) { @ LCTR = LCTR + 1 echo $EC[$ECTR] ^assign -EC[$ECTR] @ ECTR = ECTR + 1 } if ((LCTR >= PP.SET.NUMLINES)&&(ECTR < ECCTR)) {^input "** Press ENTER to continue **" ^pp.doechos} { ^assign -LCTR ^assign -ECTR ^assign -ECCTR foreach EC AA {^assign -EC[$AA]} } } # ---------------------------------------------------------------------------- # Default settings if purepak.sav doesn't exist # ---------------------------------------------------------------------------- # Letters in main settings variable (PP.SET): (this variable is about full) # I - Auto-ignore on msg/notice/ctcp floods # F - Flood filtering # A - Ascii art kicker # N - Nick flood protection # E - Use enemies list # L - Use friends list # O - Let everyone know when you are set away # G - Log messages and important stuff while away # W - Send notices and/or warnings to people # J - Auto rejoin on kick # M - Mass deop/kick protection # K - Channel key flash protection # B - Ban protection # X - Ignore CTCP PING # Y - Ignore CTCP VERSION # Z - Ignore CTCP FINGER # S - Automatic deop on server ops # H - Write awaylog to a file (PP.SET.ALFILE) # C - Clonebot mass-join protection # Q - Beep on private messages # P - Auto-unload help # V - Desynched user notification @ PP.SET = [CGFENLOWJMKBZPV] # Response to mass deop/kick (0 = deop, 1 = kick) @ PP.SET.MASSRESP = 0 # Auto-ignoring - number of seconds to autoignore @ PP.SET.IGSECS = 30 # Short kill notice displays @ PP.SET.SHORTKILLS = 1 # Server notice settings @ PP.SET.NOTELEVELS = [KUFNMC] # Nick flood protection sensitivity @ PP.SET.NFSENS = 3 # Length of the first word in a message for it to be a junkflood @ PP.SET.JFLEN = 200 # Away log file @ PP.SET.ALFILE = [away.log] # Exec commands to do various things @ PP.SET.FINGERCMD = [finger] @ PP.SET.LSCMD = [ls -l] @ PP.SET.LSWCMD = [ls -xp] @ PP.SET.RMCMD = [rm -f] @ PP.SET.MAILCMD = [mail] @ PP.SET.UUECMD = [uuencode] @ PP.SET.CATCMD = [cat] @ PP.SET.PSCMD = [ps -uxw] @ PP.SET.KILLCMD = [kill -KILL] @ PP.SET.UNGZCMD = [gunzip -c] @ PP.SET.UNZCMD = [uncompress -c] @ PP.SET.MKNODCMD = [mknod] @ PP.SET.NSLOOKCMD = [host] # Counter variable for awaylog @ PP.AWAYLCTR = 0 # Minutes of idle-time to be set auto-away (0 disables) @ PP.SET.AUTOAWAY = 0 # Clonebot mass-join sensitivity (number that must join in a 4 second span @ PP.SET.CPSENS = 3 # NSLOOKUP on join for IP addresses @ PP.SET.LOOKJOIN = 1 # Counter for clonebot mass-join detector @ PP.CPCTR = 0 # Number of lines of output before a pause on help, playback, etc. @ PP.SET.NUMLINES = 22 # Scripts we should auto-load: # K = Kicks, X = DCC, B = Bots, S = Silly, W = War @ PP.SET.AUTOLOAD = [XBS] # This is set to 1 after the first motd is seen @ PP.SEENMOTD = 0 # Msg/notice formats @ PP.SET.MRFORMAT = encode([N!U] M) @ PP.SET.NRFORMAT = encode(-N- M) @ PP.SET.MSFORMAT = encode(-> [N] M) @ PP.SET.NSFORMAT = encode(-> -N- M) # Channel protection @ PP.SET.CHANPROT = 1 # Show people as they signoff in splits @ PP.SET.SHOWSPLITTERS = 0 # Suppress startup messages @ PP.SET.NOSTARTUP = 0 # Insert random ?'s into bans @ PP.SET.FUNKYBANS = 1 # Beep on netsplits @ PP.SET.BSP = 1 # Allow CTCP PAGE @ PP.SET.CTCPPAGE = 1 # Print time every 10 minutes @ PP.SET.TP = 0 # Nick to match public @ PP.SET.PMATCH = [.] # Msg/notice format settings to look like other scripts @ PP.MR.DEFAULT = encode([N!U] M) @ PP.MS.DEFAULT = encode(-> [N] M) @ PP.NR.DEFAULT = encode(-N- M) @ PP.NS.DEFAULT = encode(-> -N- M) @ PP.MR.IRCII = encode(*N* M) @ PP.MS.IRCII = encode(-> *N* M) @ PP.NR.IRCII = encode(-N- M) @ PP.NS.IRCII = encode(-> -N- M) @ PP.MR.TEXTBOX = encode(*N* M) @ PP.MS.TEXTBOX = encode(-> *N* M) @ PP.NR.TEXTBOX = encode(-N- M) @ PP.NS.TEXTBOX = encode(-> -N- M) @ PP.MR.LICE = encode([N!U] M) @ PP.MS.LICE = encode([*N*] M) @ PP.NR.LICE = encode(-N!U- M) @ PP.NS.LICE = encode([-N-] M) @ PP.MR.PHOENIX = encode([N:U] M) @ PP.MS.PHOENIX = encode(<-[N]-> M) @ PP.NR.PHOENIX = encode(-N- M) @ PP.NS.PHOENIX = encode(-> -N- M) # ---------------------------------------------------------------------------- # /pp alias to set script options # ---------------------------------------------------------------------------- # Other script parts (the pp-*.irc scripts) can add to this array and have # their settings under /pp @ PP.SETCHECKS.M = [^pp.set.m] alias pp.set.bstatus {^if ([$0]) {@ FUNCTION_RETURN = [ON ]} {@ FUNCTION_RETURN = [OFF]}} alias pp.set.tstatus {^if (index($0 $PP.SET) >= 0) {@ FUNCTION_RETURN = [ON ]} {@ FUNCTION_RETURN = [OFF]}} alias pp.set.changetoggle { if ([$1]) { if ([$1] == [OFF]) {@ PP.SET = strip($0 $PP.SET)} {^if (index($0 $PP.SET) < 0) {@ PP.SET = [$0]##PP.SET}} } } alias pp.set.setupctcp { if (index(X $PP.SET) < 0) {^on raw_irc - "% PRIVMSG % :**PING**"} {^on ^raw_irc "% PRIVMSG % :**PING**" {}} if (index(Y $PP.SET) < 0) {^on raw_irc - "% PRIVMSG % :**VER**"} {^on ^raw_irc "% PRIVMSG % :**VER**" {}} if (index(Z $PP.SET) < 0) {^on raw_irc - "% PRIVMSG % :**FINGER**"} {^on ^raw_irc "% PRIVMSG % :**FINGER**" {}} } alias pp.set.onoff {^if ([$0]) {@ FUNCTION_RETURN = [ON]} {@ FUNCTION_RETURN = [OFF]}} alias status { ^pp.pauseset echo -- Current PurePak settings: echo -- =========================================================================== echo -- Automatic flood ignoring (AIGnore) : $pp.set.tstatus(I) echo -- Filtering of known floods (FFILTer) : $pp.set.tstatus(F) echo -- ASCII art kicker (ARTKick) : $pp.set.tstatus(A) echo -- Kicking on kick flood (NFProt) : $pp.set.tstatus(N) echo -- Use of enemies list (ENEMies) : $pp.set.tstatus(E) echo -- Use of friends list (FRIends) : $pp.set.tstatus(L) echo -- Public announcement of away status (AWAYNotices) : $pp.set.tstatus(O) echo -- Logging of msgs/events while away (AWAYLogging) : $pp.set.tstatus(G) echo -- Logging to an away log file (AWAYWriting) : $pp.set.tstatus(H) echo -- Name of away log file (AFILE) : ${PP.SET.ALFILE} echo -- General miscellaneous warnings/notices (NOTIces) : $pp.set.tstatus(W) echo -- Automatic rejoining on kick (KREJoin) : $pp.set.tstatus(J) echo -- Mass deop/kick protection (MASSProt) : $pp.set.tstatus(M) if (PP.SET.MASSRESP) { echo -- Action taken on mass deop/kick (MASSAction) : KICK } { echo -- Action taken on mass deop/kick (MASSAction) : DEOP } echo -- Channel protection (CHANprot) : $pp.set.onoff($PP.SET.CHANPROT) echo -- Automatic removal of server ops (SERVOP) : $pp.set.tstatus(S) echo -- Channel key flash protection (KEYProt) : $pp.set.tstatus(K) echo -- Ban defense (BANDefense) : $pp.set.tstatus(B) echo -- Ignoring of CTCP PINGs (PING) : $pp.set.tstatus(X) echo -- Ignoring of CTCP FINGERs (FINGer) : $pp.set.tstatus(Z) echo -- Ignoring of CTCP VERSIONs (VERsion) : $pp.set.tstatus(Y) echo -- Seconds to auto-ignore flooders (IGTime) : ${PP.SET.IGSECS} echo -- Nick flood protection sensitivity (NFSens) : ${PP.SET.NFSENS} echo -- Length of first word for a msg to be junkflood (JFLEN) : ${PP.SET.JFLEN} echo -- Desynched user notification (DESynchnote) : $pp.set.tstatus(V) echo -- Beeping on private messages (MSGBeep) : $pp.set.tstatus(Q) if (PP.SET.AUTOAWAY) { echo -- Minutes of idle time before being set away (AUTOAway) : ${PP.SET.AUTOAWAY} } { echo -- Minutes of idle time before being set away (AUTOAway) : OFF } echo -- NS lookup of IP adresses on join : $pp.set.onoff($PP.SET.LOOKJOIN) echo -- Clonebot mass-join protection (CLONEProt) : $pp.set.tstatus(C) echo -- Clonebot mass-join protection sensitivity (CLONESens) : ${PP.SET.CPSENS} if (suppress_server_motd == [ON]) { echo -- Server motd display at startup (MOTD) : OFF } { echo -- Server motd display at startup (MOTD) : ON } echo -- Show users who join/signoff in splits (SHOWSPLITters) : $pp.set.onoff($PP.SET.SHOWSPLITTERS) echo -- Number of rows on this display (ROWS) : ${PP.SET.NUMLINES + 2} echo -- Auto-loading of pp-bots.irc (LOADBots) : $pp.set.sload(B) echo -- Auto-loading of pp-xdcc.irc (LOADXdcc) : $pp.set.sload(X) echo -- Auto-loading of pp-silly.irc (LOADSilly) : $pp.set.sload(S) echo -- Auto-loading of pp-war.irc (LOADWar) : $pp.set.sload(W) echo -- Auto-loading of pp-kicks.irc (LOADKicks) : $pp.set.sload(K) echo -- Suppression of script startup screens : $pp.set.onoff($PP.SET.NOSTARTUP) echo -- Insert random ?'s into bans (FUNkybans) : $pp.set.onoff($PP.SET.FUNKYBANS) echo -- Beep on netsplits (BEEPSPLIT) : $pp.set.onoff($PP.SET.BSP) echo -- CTCP PAGE (PAGE) : $pp.set.onoff($PP.SET.CTCPPAGE) echo -- Print time every 10 minutes (TPRINT) : $pp.set.onoff($PP.SET.TP) echo -- String to match and highlight in public (PMATCH) : ${PP.SET.PMATCH} echo -- =========================================================================== ^pp.pauseend } alias pp.set.sload { if ([$1]) { if ([$1] == [ON]) { if (index($0 $PP.SET.AUTOLOAD) < 0) {@ PP.SET.AUTOLOAD = PP.SET.AUTOLOAD##[$0]} pp.autoload } {@ PP.SET.AUTOLOAD = strip($0 $PP.SET.AUTOLOAD)} } {^if (index($0 $PP.SET.AUTOLOAD) >= 0) {@ FUNCTION_RETURN = [ON]} {@ FUNCTION_RETURN = [OFF]}} } alias pp.autoload { if ((index(K $PP.SET.AUTOLOAD) >= 0)&&(!(PP.KICKS))) {/load pp-kicks.irc} if ((index(B $PP.SET.AUTOLOAD) >= 0)&&(!(PP.BOTS))) {/load pp-bots.irc} if ((index(S $PP.SET.AUTOLOAD) >= 0)&&(!(PP.SILLY))) {/load pp-silly.irc} if ((index(X $PP.SET.AUTOLOAD) >= 0)&&(!(PP.DCC))) {/load pp-dcc.irc} if ((index(W $PP.SET.AUTOLOAD) >= 0)&&(!(PP.WAR))) {/load pp-war.irc} } alias pp.set.setmformat { echo *** Special characters in msg/notice outgoing display formats: echo *** N = Nickname of person you are sending to echo *** M = Text of the message you are sending echo *** T = Current time echo *** Special characters in msg/notice incoming display formats: echo *** N = Nickname of the person who sent the msg/notice echo *** U = User@host of sender echo *** M = Text of message echo *** T = Current time echo *** ^V,^B,^O,^_ control characters can also be used echo *** echo *** You may enter new formats for any of these, or press enter for no echo *** change. echo *** echo *** Current incoming message format is: $decode($PP.SET.MRFORMAT) ^input "New incoming message format or enter for no change >>" if (1) { if ([$0]) {@ PP.SET.MRFORMAT = encode($*)} echo *** Current outgoing message format is: $decode($PP.SET.MSFORMAT) ^input "New outgoing message format or enter for no change >>" if (1) { if ([$0]) {@ PP.SET.MSFORMAT = encode($*)} echo *** Current incoming notice format is: $decode($PP.SET.NRFORMAT) ^input "New incoming notice format or enter for no chaange >>" if (1) { if ([$0]) {@ PP.SET.NRFORMAT = encode($*)} echo *** Current outgoing notice format is: $decode($PP.SET.NSFORMAT) ^input "New outgoing notice format or enter for no change >>" if (1) { if ([$0]) {@ PP.SET.NSFORMAT = encode($*)} echo *** echo *** Message formats are now set to: echo *** Incoming message: $decode($PP.SET.MRFORMAT) echo *** Outgoing message: $decode($PP.SET.MSFORMAT) echo *** Incoming notice: $decode($PP.SET.NRFORMAT) echo *** Outgoing notice: $decode($PP.SET.NSFORMAT) echo *** echo *** If you have made changes, you must save with /sve for your changes echo *** to become permanent. } } } } } # *** Main script settings: # AIGnore = Automatic flood ignoring # FFILTer = Filtering of known floods # ARTKick = ASCII art kicker # NFProt = Kicking on nick flood # ENEMies = Use of enemies list # FRIends = Use of friends list # AWAYNotices = Public announcement of away status # AWAYLogging = Logging of msgs/events while away # AWAYWriting = Logging to an away log file # AFILE = Name of away log file # NOTIces = General warnings/notices # KREJoin = Automatic rejoining on kick # MASSProt = Mass deop/kick protection # MASSAction = Action taken on mass deop/kick # SERVOP = Automatic removal of server ops # KEYProt = Channel key flash protection # BANDefense = Ban defense # PING = Ignoring of CTCP PING # FINGer = Ignoring of CTCP FINGER # VERsion = Ignoring of CTCP VERSION # IGTime = Seconds to auto-ignore flooders # NFSens = Sensitivity of nick flood protection (higher values more sensitive) # JFLEN = First word length for a message to be a junkflood # *CMD = Correspond with PP.SET.*CMD above # MSGBeep = Beep on private messages # AUTOAway = Minutes of idle-time to be automaticly set away # CLONEProt = Clonebot mass-join protection # CLONESens = Sensitivity of clonebot mass-join protection (lower values more sensitive) # ROWS = Number of rows on display # LOADBots = Auto load pp-bots.irc # LOADWar = Auto load pp-war.irc # LOADSilly = Auto load pp-silly.irc # LOADKicks = Auto load pp-kicks.irc # LOADDcc = Auto load pp-dcc.irc # HELPUnload = Auto unloading of help # DESynchnote = Desynched user notification # WRITEMETHOD = /sve write method # MOTD = Server motd display at startup # MFORMAT = Msg/notice format settings # CHANprot = Channel protection # SHOWSPLITters = Show users who join/signoff in splits # LOOKJoin = NS lookup of IP adresses on join # NOSTARTUP = Suppression of startup screens # FUNkybans = Insert random ?'s into bans # BEEPSPLIT = Beep on netsplits # PAGE = CTCP PAGE # TPRINT = Print time every 10 minutes # PMATCH = String to match and highlight publicly alias pp.set.m { if (rmatch($0 LOADK* LOADB* LOADW* LOADS* LOADD*)) { if (match($1 ON OFF)) { if (match(LOADB* $0)) {/pp.set.sload B $1} if (match(LOADW* $0)) {/pp.set.sload W $1} if (match(LOADS* $0)) {/pp.set.sload S $1} if (match(LOADK* $0)) {/pp.set.sload K $1} if (match(LOADD* $0)) {/pp.set.sload X $1} } if (match(LOADB* $0)) {/echo *** Auto-loading of pp-bots.irc is now $pp.set.sload(B)} if (match(LOADW* $0)) {/echo *** Auto-loading of pp-war.irc is now $pp.set.sload(W)} if (match(LOADS* $0)) {/echo *** Auto-loading of pp-silly.irc is now $pp.set.sload(S)} if (match(LOADK* $0)) {/echo *** Auto-loading of pp-kicks.irc is now $pp.set.sload(K)} if (match(LOADD* $0)) {/echo *** Auto-loading of pp-dcc.irc is now $pp.set.sload(X)} @ VU = 1 } if ([$0] == [PAGE]) { if (match($1 ON OFF)) { if ([$1] == [ON]) {@ PP.SET.CTCPPAGE = 1} {@ PP.SET.CTCPPAGE = 0} } echo *** CTCP PAGE response is now $pp.set.onoff($PP.SET.CTCPPAGE) @ VU = 1 } if ([$0] == [TPRINT]) { if (match($1 ON OFF)) { if ([$1] == [ON]) {@ PP.SET.TP = 1} {@ PP.SET.TP = 0} } echo *** Print time every 10 minutes is now $pp.set.onoff($PP.SET.TP) @ VU = 1 } if ([$0] == [BEEPSPLIT]) { if (match($1 ON OFF)) { if ([$1] == [ON]) {@ PP.SET.BSP = 1} {@ PP.SET.BSP = 0} } echo *** Beep on netsplits is now $pp.set.onoff($PP.SET.BSP) @ VU = 1 } if (match(LOOKJ* $0)) { if (match($1 ON OFF)) { if ([$1] == [ON]) {@ PP.SET.LOOKJOIN = 1} {@ PP.SET.LOOKJOIN = 0} } echo *** NS lookup of IP adresses on join is now $pp.set.onoff($PP.SET.LOOKJOIN) @ VU = 1 } if ([$0] == [NOSTARTUP]) { if (match($1 ON OFF)) { if ([$1] == [ON]) {@ PP.SET.NOSTARTUP = 1} {@ PP.SET.NOSTARTUP = 0} } echo *** Suppression of script startup screens is now $pp.set.onoff($PP.SET.NOSTARTUP) @ VU = 1 } if (match(FUN* $0)) { if (match($1 ON OFF)) { if ([$1] == [ON]) {@ PP.SET.FUNKYBANS = 1} {@ PP.SET.FUNKYBANS = 0} } echo *** Insert random ?'s into bans is now $pp.set.onoff($PP.SET.FUNKYBANS) @ VU = 1 } if (match(SHOWSPLIT* $0)) { if (match($1 ON OFF)) { if ([$1] == [ON]) {@ PP.SET.SHOWSPLITTERS = 1} {@ PP.SET.SHOWSPLITTERS = 0} } echo *** Showing of users who join/signoff in netsplits is now $pp.set.onoff($PP.SET.SHOWSPLITTERS) @ VU = 1 } if ([$0] == [MFORMAT]) { @ VU = 1 if ([$1]) { if (match($1 IRCII TEXTBOX PHOENIX LICE DEFAULT)) { @ PP.SET.MRFORMAT = PP.MR[$1] @ PP.SET.NRFORMAT = PP.NR[$1] @ PP.SET.MSFORMAT = PP.MS[$1] @ PP.SET.NSFORMAT = PP.NS[$1] echo *** Your msgs/notices now look like: $toupper($1) } {/echo *** /pp mformat [<ircii/textbox/phoenix/lice>]} } {^pp.set.setmformat} } if (match(CHAN* $0)) { if (match($1 ON OFF)) { if ([$1] == [ON]) {@ PP.SET.CHANPROT = 1} {@ PP.SET.CHANPROT = 0} } echo *** Channel protection is now $pp.set.onoff($PP.SET.CHANPROT) @ VU = 1 } if (match(DES* $0)) { ^pp.set.changetoggle V $1 echo *** Desynched user notification is now $pp.set.tstatus(V) @ VU = 1 } if (match(AIG* $0)) { ^pp.set.changetoggle I $1 echo *** Auto-ignoring on msg/notice/ctcp/nick floods is now $pp.set.tstatus(I) @ VU = 1 } if ([$0] == [MOTD]) { if (match($1 ON OFF)) { if ([$1] == [ON]) {^set suppress_server_motd OFF} {^set suppress_server_motd ON} } if (suppress_server_motd == [ON]) {/echo *** Server motd display at startup is now OFF} {/echo *** Server motd display at startup is now ON} @ VU = 1 } if (match(FFILT* $0)) { ^pp.set.changetoggle F $1 echo *** Filtering of known floods in msgs/notices/public messages is now $pp.set.tstatus(F) @ VU = 1 } if (match(ARTK* $0)) { ^pp.set.changetoggle A $1 echo *** ASCII art kicker is now $pp.set.tstatus(A) @ VU = 1 } if (match(HELPU* $0)) { ^pp.set.changetoggle P $1 echo *** Automatic unloading of help information is now $pp.set.tstatus(P) @ VU = 1 } if (match(NFP* $0)) { ^pp.set.changetoggle N $1 echo *** Kicking on nick flood is now $pp.set.tstatus(N) @ VU = 1 } if (match(ENEM* $0)) { ^pp.set.changetoggle E $1 echo *** Checking/use of enemies list is now $pp.set.tstatus(E) @ VU = 1 } if (match(FRI* $0)) { ^pp.set.changetoggle L $1 echo *** Checking/use of friends list is now $pp.set.tstatus(L) @ VU = 1 } if (match(AWAYN* $0)) { ^pp.set.changetoggle O $1 echo *** Public announcement of away status is now $pp.set.tstatus(O) @ VU = 1 } if (match(AWAYL* $0)) { ^pp.set.changetoggle G $1 echo *** Logging of messages and important events while away is now $pp.set.tstatus(G) @ VU = 1 } if (match(NOTI* $0)) { ^pp.set.changetoggle W $1 echo *** Sending of general warnings/notices is now $pp.set.tstatus(W) @ VU = 1 } if (match(KREJ* $0)) { ^pp.set.changetoggle J $1 echo *** Automatic rejoining on kick is now $pp.set.tstatus(J) @ VU = 1 } if (match(MASSP* $0)) { ^pp.set.changetoggle M $1 echo *** Mass deop/kick protection is now $pp.set.tstatus(M) @ VU = 1 } if (match(MASSA* $0)) { if (match($1 KICK DEOP)) { if ([$1] == [KICK]) {@ PP.SET.MASSRESP = 1} {@ PP.SET.MASSRESP = 0} } if (PP.SET.MASSRESP) {/echo *** Action taken on mass deop/kick is now KICK} {/echo *** Action taken on mass deop/kick is now DEOP} @ VU = 1 } if (match(KEYP* $0)) { ^pp.set.changetoggle K $1 echo *** Channel key flash protection is now $pp.set.tstatus(K) @ VU = 1 } if (([$0] == [SERVOP])||([$0] == [NHP])) { ^pp.set.changetoggle S $1 echo *** Automatic removal of server ops is now $pp.set.tstatus(S) @ VU = 1 } if (match(CLONEP* $0)) { ^pp.set.changetoggle C $1 echo *** Clonebot mass-join protection is now $pp.set.tstatus(C) @ VU = 1 } if (match(BAND* $0)) { ^pp.set.changetoggle B $1 echo *** Ban defense is now $pp.set.tstatus(B) @ VU = 1 } if ([$0] == [PING]) { ^pp.set.changetoggle X $1 echo *** Ignoring of CTCP PINGs is now $pp.set.tstatus(X) @ VU = 1 ^pp.set.setupctcp } if (match(FING* $0)) { ^pp.set.changetoggle Z $1 echo *** Ignoring of CTCP FINGERs is now $pp.set.tstatus(Z) @ VU = 1 ^pp.set.setupctcp } if (match(VER* $0)) { ^pp.set.changetoggle Y $1 echo *** Ignoring of CTCP VERSIONs is now $pp.set.tstatus(Y) @ VU = 1 ^pp.set.setupctcp } if ([$0] == [PMATCH]) { if ([$1]) { if ((PP.SET.PMATCH == [.])&&([$1] != [.])) {^pp.snm $strip(_-[] $N) $1} if ((PP.SET.PMATCH != [.])&&([$1] == [.])) {^pp.snm $PP.SET.PMATCH $strip(_-[] $N)} @ PP.SET.PMATCH = [$1] } echo *** String to match and highlight in public now set to ${PP.SET.PMATCH} @ VU = 1 } if (match(IGT* $0)) { if ([$1]) { if (!isalpha($1)) {@ PP.SET.IGSECS = [$1]} {/echo *** Must be a number (recommended value: 10-60)} } echo *** Number of seconds to auto-ignore flooders is now: ${PP.SET.IGSECS} @ VU = 1 } if (match(NFS* $0)) { if ([$1]) { if (!isalpha($1)) {@ PP.SET.NFSENS = [$1]} {/echo *** Must be a number (recommended value: 3)} } echo *** Nick flood protection sensitivity is now: ${PP.SET.NFSENS} if (PP.SET.NFSENS > 3) {/echo *** Warning: a setting of ${PP.SET.NFSENS} is very sensitive! (higher values more sensitive)} @ VU = 1 } if ([$0] == [ROWS]) { if ([$1]) { if (!isalpha($1)) {@ PP.SET.NUMLINES = [$1] - 2} {/echo *** Must be a number} } echo *** Number of rows on this display is now: ${PP.SET.NUMLINES + 2} @ VU = 1 } if (match(CLONES* $0)) { if ([$1]) { if (!isalpha($1)) {@ PP.SET.CPSENS = [$1]} {/echo *** Must be a number (recommended value: 3-5)} } echo *** Clonebot mass-join protection sensitivity is now: ${PP.SET.CPSENS} if (PP.SET.CPSENS < 3) {/echo *** Warning: a setting of ${PP.SET.CPSENS} is very sensitive! (lower values more sensitive)} @ VU = 1 } if ([$0] == [JFLEN]) { if ([$1]) { if (!isalpha($1)) {@ PP.SET.JFLEN = [$1]} {/echo *** Must be a number (recommended value: 200)} } echo *** First word length for a message to be a junkflood is now: ${PP.SET.JFLEN} @ VU = 1 } if (match(AUTOA* $0)) { if ([$1]) { if (!isalpha($1)) {@ PP.SET.AUTOAWAY = [$1]} { if ([$1] == [OFF]) {@ PP.SET.AUTOAWAY = 0} {/echo *** Must be a number or 'off' to turn off.} } } echo *** Minutes of idle-time before being set away (0=auto-away disabled): ${PP.SET.AUTOAWAY} @ VU = 1 } if (match(*CMD $0)) { foreach PP.SET AA { if ([$AA] == [$0]) { if ([$1]) {@ PP.SET[$AA] = [$1-]} echo *** $AA is now [${PP.SET[$AA]}] @ VU = 1 } } } if (match(MSGB* $0)) { if (match($1 ON OFF)) { ^pp.set.changetoggle Q $1 if ([$1] == [ON]) {^set beep_on_msg MSG} {^set beep_on_msg NONE} } echo *** Beeping on private messages is now $pp.set.tstatus(Q) @ VU = 1 } if (match(LOGF* $0)) { if ([$1]) {^set logfile $1} echo *** IRC logging is now sent to file ${LOGFILE} @ VU = 1 } if ([$0] == [LOG]) { if (match($1 ON OFF)) {^if ([$1] == [ON]) {^set log on} {^set log off}} echo *** Logging to $LOGFILE is now ${LOG} @ VU = 1 } if (match(AWAYW* $0)) { ^pp.set.changetoggle H $1 echo *** Away log writing to $PP.SET.ALFILE is now $pp.set.tstatus(H) @ VU = 1 } if ([$0] == [AFILE]) { if ([$1]) {@ PP.SET.ALFILE = [$1]} echo *** Away log file is now ${PP.SET.ALFILE} @ VU = 1 } } alias pp { if ([$0]) { @ VU = 0 foreach PP.SETCHECKS AA {^if (!VU) {$PP.SETCHECKS[$AA] $*}} if (!VU) {/echo *** No such variable: $0} ^assign -VU } {/echo *** /pp <variable> [<new setting>] (If new setting is left out, current setting is shown)} } # ---------------------------------------------------------------------------- # Command abbreviations # ---------------------------------------------------------------------------- alias w {/who $*} alias m {/msg $*} alias t {/topic $*} alias c {/mode $*} alias l { leave $0 if ([$1]) {/l $1-} } alias j { if (ischannel($1)) {/join $0} {/join $0 $1} if (ischannel($1)) {/j $1-} if (ischannel($2)) {/j $2-} } alias , {/whois $*} alias wi {/whois $*} alias ww {/whowas $*} alias n {/nick $*} alias k {/kick $*} alias o {/op $*} alias d {/deop $*} alias scan {/names $*} # ---------------------------------------------------------------------------- # Basic channel op command aliases # ---------------------------------------------------------------------------- # Here's all the recursive list processing aliases for the mass commands # pp.listm.<# at once> <mode> <#channel> <users> alias pp.listm.1 { //mode $1 $0 $2 if ([$3]) {^pp.listm.1 $0 $1 $3-} } alias pp.listm.2 { //mode $1 $0 $2 $3 if ([$4]) {^pp.listm.2 $0 $1 $4-} } alias pp.listm.3 { //mode $1 $0 $2 $3 $4 if ([$5]) {^pp.listm.3 $0 $1 $5-} } alias pp.listm.4 { //mode $1 $0 $2 $3 $4 $5 if ([$6]) {^pp.listm.4 $0 $1 $6-} } # pp.listk <#channel> <nicks> ($KREASON contains reason for kicks) alias pp.listk { //kick $0 $1 $KREASON if ([$2]) {^pp.listk $0 $2-} } # pp.listdcc <file> <nicks> alias pp.listdcc { //^dcc send $1 $0 if ([$2]) {^pp.listdcc $0 $2-} } # pp.listmsg <PRIVMSG/NOTICE> <nicks/channels> (SEND_MSG contains message) alias pp.listmsg { ^quote $0 $1 :$SEND_MSG if ([$2]) {^pp.listmsg $0 $2-} } # pp.listunban <#channel> <strings> alias pp.listunban { if ([$4]) { //mode $0 -bbb $1 $2 $3 ^pp.listunban $0 $4- } {^if ([$3]) {//mode $0 -bbb $1 $2 $3} {^if ([$2]) {//mode $0 -bb $1 $2} {^if ([$1]) {//mode $0 -b $1}}}} } # pp.mdop <#channel> <# at once> <mask> # Smart massdeopper: deops the closest people net-wise first. (Gee, I wonder # how many scripts this is gonna appear in?) alias pp.mdop { @ HIGHHOPS = 0 @ DMASK = [$2] on ^who * { if ((match(*${DMASK}* $1!$3@$4))&&([$1] != N)) { if (!match($1 $PP.BOTNICKS)) { if (!PP.EPIC) { @ MDOPZ[$5] = MDOPZ[$5]##[ $1] if ([$5] > HIGHHOPS) {@ HIGHHOPS = [$5]} } { @ MDOPZ[$6] = MDOPZ[$6]##[ $1] if ([$6] > HIGHHOPS) {@ HIGHHOPS = [$6]} } } } } //^who -chops $0 @ DEOPCNT = [$1] @ DEOPCHAN = [$0] wait -CMD if (1) { if (DEOPCNT <= 1) {@ MCH = [-o]} if (DEOPCNT == 2) {@ MCH = [-oo]} if (DEOPCNT == 3) {@ MCH = [-ooo]} if (DEOPCNT >= 4) {@ MCH = [-oooo]} @ CTR = 0 while (CTR <= HIGHHOPS) { @ MDOPZ = MDOPZ##[ $MDOPZ[$CTR]] ^assign -MDOPZ[$CTR] @ CTR = CTR + 1 } ^pp.listm.$DEOPCNT $MCH $DEOPCHAN $MDOPZ ^assign -DEOPCNT ^assign -DEOPCHAN ^assign -MCH ^assign -HIGHHOPS ^assign -CTR ^assign -MDOPZ ^assign -DMASK ^on who - } } # pp.mkick <#channel> <mask> <reason> alias pp.mkick { @ KMASK = [$1] ^on ^who * { ^if ((match(*${KMASK}* $1!$3@$4))&&([$1] != N)) { ^if (!match($1 $PP.BOTNICKS)) {@ MKZ = [$1 $MKZ]} } } //^who $0 @ KCHAN = [$0] @ KREASON = [$2-] wait -CMD if (1) { ^pp.listk $KCHAN $MKZ ^assign -KCHAN ^assign -MKZ ^assign -KMASK ^assign -KREASON ^on who - } } # pp.mop <#channel> <mask> alias pp.mop { @ OPMASK = [$1] ^on ^who * {^if ((!match(*@* $2))&&(match(*${OPMASK}* $1!$3@$4))) {^if ([$1] != N) {@ MOPZ = [$MOPZ $1]}}} //^who $0 @ MOPCHAN = [$0] wait -CMD if (1) { ^pp.listm.3 +ooo $MOPCHAN $MOPZ ^assign -MOPCHAN ^assign -MOPZ ^assign -OPMASK ^on ^who - } } # pp.modev <#channel> <mask> <+/-> alias pp.modev { @ VMASK = [$1] ^on ^who * {^if (match(*${VMASK}* $1!$3@$4)) {@ MVZ = [$MVZ $1]}} //^who $0 @ MVCHAN = [$0] @ MVMODE = [$2] wait -CMD if (1) { ^pp.listm.3 ${MVMODE}vvv $MVCHAN $MVZ ^assign -MVCHAN ^assign -MVMODE ^assign -MVZ ^assign -VMASK ^on ^who - } } # The user mass commands # mdop/mvop/mop/munvop [<mask>] alias mdop.1 {^if (gotops($C)) {^if ([$0]) {^pp.mdop $C 1 $0} {^pp.mdop $C 1 *}} {/echo *** You don't have ops on $C}} alias mdop.2 {^if (gotops($C)) {^if ([$0]) {^pp.mdop $C 2 $0} {^pp.mdop $C 2 *}} {/echo *** You don't have ops on $C}} alias mdop.3 {^if (gotops($C)) {^if ([$0]) {^pp.mdop $C 3 $0} {^pp.mdop $C 3 *}} {/echo *** You don't have ops on $C}} alias mdop.4 {^if (gotops($C)) {^if ([$0]) {^pp.mdop $C 4 $0} {^pp.mdop $C 4 *}} {/echo *** You don't have ops on $C}} alias mdop {^mdop.4 $*} alias mop {^if (gotops($C)) {^if ([$0]) {^pp.mop $C $0} {^pp.mop $C *}} {/echo *** You don't have ops on $C}} alias mvop {^if (gotops($C)) {^if ([$0]) {^pp.modev $C $0 +} {^pp.modev $C * +}} {/echo *** You don't have ops on $C}} alias munvop {^if (gotops($C)) {^if ([$0]) {^pp.modev $C $0 -} {^pp.modev $C * -}} {/echo *** You don't have ops on $C}} # Fast mdop (x4) alias fmdop { if (gotops($C)) { if (match(*!*@* $0)) {@ UM = [$0]} {@ UM = [*!*@*]} foreach PP.USERS.$encode($tolower($C)) AA { if (decode($AA) != N) { if ((ischanop($decode($AA) $C))&&(match($UM $decode($AA)!$word(2 $PP.USERS[$encode($tolower($C))][$AA])))) {@ MDOPZ = MDOPZ##[$decode($AA) ]} } } pp.listm.4 -oooo $C $MDOPZ ^assign -MDOPZ ^assign -UM } {/echo *** You don't have ops on $C} } # op and deop aliases # op/deop <nicks> alias op {^if ([$0]) {^pp.listm.3 +ooo $C $*} {/echo *** /op <nick> [<nick> ...]}} alias deop {^if ([$0]) {^pp.listm.2 -oo $C $*} {/echo *** /deop <nick> [<nick> ...]}} # masskick aliases # masskick [<reason>] (kicks with mask *) mkick [<mask>] alias masskick {^if (gotops($C)) {^if ([$0]) {^pp.mkick $C * $*} {^pp.mkick $C * [Masskick: *]}} {/echo *** You don't have ops on $C}} alias mkick {^if (gotops($C)) {^if ([$0]) {^pp.mkick $C $0 [Masskick: $0]} {^pp.mkick $C * [Masskick: *]}} {/echo *** You don't have ops on $C}} # Kicks all non-operators on channel alias lkick { if (gotops($C)) { ^on ^who * {/if (([$1] != N)&&(!rmatch($2 *@*))) {//kick $0 $1 [Non-Operator Kick]}} //^who * wait -CMD ^on who - } {/echo *** You don't have ops on $C} } # massdcc <file> [<mask>] alias massdcc { if ([$0]) { if ([$1]) {@ DCCMASK = [$1]} {@ DCCMASK = [*]} ^on ^who * {^if (([$1] != N)&&(match(*${DCCMASK}* $1!$3@$4))) {@ DCCPPL = [$1 $DCCPPL]}} //^who * @ MDFILE = [$0] wait -CMD if (1) { ^on who - ^pp.listdcc $MDFILE $DCCPPL ^assign -DCCMASK ^assign -DCCPPL echo *** Sent DCC SEND request for $MDFILE to everyone in $C ^assign -MDFILE } } {/echo *** /massdcc <file> [<mask>]} } # Re-aliased to not require channel names alias invite {^if (ischannel($1)) {//invite $*} {//invite $0 $C}} alias kick {^if (ischannel($0)) {//kick $*} {//kick $C $0 $1-}} alias mode {^if (ischannel($0)) {//mode $*} {^if ([$0] == N) {//mode $*} {//mode $C $*}}} # pp.snm old new alias pp.snm { EVAL ^on raw_irc - "% PRIVMSG #% :*$0*" EVAL ^on ^raw_irc "% PRIVMSG #% :*$1*" { if (match(*ACTION* $3)) { if ([$2] == C) {/xecho -window $winnum() -level PUBLIC * $nickonly($0) $strip( $4-)} {/xecho -window $winnum() -level PUBLIC * $nickonly($0):$2 $strip( $4-)} } { if ([$2] == C) {/xecho -window $winnum() -level PUBLIC <$nickonly($0)> $strip( $mid(1 65535 $3) $4-)} {/xecho -window $winnum() -level PUBLIC <$nickonly($0):$2> $strip( $mid(1 65535 $3) $4-)} } } } alias nick { ^if ([$0]) { if (PP.SET.PMATCH == [.]) {^pp.snm $strip(_-[] $N) $strip(_-[] $0)} if (PP.DCC) {^dcc.onnick $*} quote NICK $* } {/nick $randcrap(9)} } # We don't use the -k$M method because of how the mode locking code works alias clearmode { if (ischannel($0)) { ^on ^324 * {@ CMODE = strip(:+ $2)##[ $3-]} //mode $0 @ CMCHAN = [$0] wait -CMD if (1) { ^on 324 - //mode $CMCHAN -k$CMODE ^assign -CMCHAN ^assign -CMODE } } {/clearmode $C} } # Bans bots and bomb/inverse/beep/etc usernames alias botban {//mode $C +bbb *b?t!*@* *srv!*@* *s?rv!*@*} alias bot {//bot} # pp.clearban <channel> <mask> alias pp.clearban { @ BANMASK = [$1] ^on ^raw_irc "% 367 *" {^if ((match(*${BANMASK}* $4))||(match($4 $BANMASK))) {@ CBUNBAND = [$4 $CBUNBAND]}} //mode $0 b wait -CMD if (1) { ^pp.listunban $C $CBUNBAND ^assign -CBUNBAND ^assign -BANMASK ^on raw_irc - "% 367 *" } } # User clearban alias # clearban [<mask>] alias clearban {^if ([$0]) {^pp.clearban $C $*} {^pp.clearban $C *}} # Unban alias: looks up user's user@host and runs a clearban # unban <nick> alias unban { if ([$0]) { if (match(*!*@* $0)) {^pp.listunban $C $*} { ^Userhost $0 -CMD if ([$3]) { if ([$4] != [<UNKNOWN>]) {^pp.clearban $C $0!$3@$4} {/echo *** $0 is not on IRC} } } } {/echo *** /unban <nick/umask>} } # ban <nick> alias ban { if ([$0]) { if (match(*!*@* $0)) {//mode $C +bbb $*} { ^Userhost $0 -CMD if ([$3]) { if ([$4] != [<UNKNOWN>]) { @ HNAME = [$4] if ((!isalpha($HNAME))&&(match(*.*.*.* $HNAME))) {@ ST = [*!*$mid(1 1000 $3)@]##left($rindex(. $HNAME) $HNAME)##[.*]} {@ ST = [*!*$mid(1 1000 $3)@*$right(${@HNAME-index(. $4)} $4)]} if (PP.SET.FUNKYBANS) { @ AA = [] @ CT = 0 while (CT < [$@ST]) { @ SC = mid($CT 1 $ST) if ((!match(*${SC}* @!.))&&(SC != [*])) { if (rand(4) == 2) {@ AA = AA##[?]} {@ AA = AA##SC} } {@ AA = AA##SC} @ CT = CT + 1 } ^assign -CT ^assign -SC } {@ AA = ST} ^assign -ST ^assign -HNAME //mode $C +b $AA } {/echo *** $0 is not on IRC} } } } {//mode $C b} } # /wordkick <channel> <word/phrase> # or /wordkick <channel> off alias wordkick { if ([$1]) { if (ischannel($0)) {@ WCHAN = [$0]} {@ WCHAN = [#$0]} if ([$1] == [OFF]) { foreach WORDKICKS AA { if (decode($AA) == [$WCHAN]) { EVAL ^on raw_irc - "% ??????% $decode($AA) :*$WORDKICKS[$AA]*" ^assign -WORDKICKS[$AA] @ WK = 1 } } if (WK) {/echo *** Wordkick for $WCHAN removed} {/echo *** There is no wordkick active on $WCHAN} ^assign -WK } { @ WORDKICKS[$encode($WCHAN)] = [$1-] EVAL ^on -raw_irc "% ??????% $WCHAN :*$1-*" { //kick $2 $nickonly($0) [Wordkick] } echo *** Wordkick for '$1-' now active on channel $WCHAN } ^assign -WCHAN } { echo *** Active wordkicks: foreach WORDKICKS AA {/echo *** Channel: $[12]decode($AA) Word/phrase: $WORDKICKS[$AA]} } } # ---------------------------------------------------------------------------- # Friends and enemies lists handlers # ---------------------------------------------------------------------------- # 'CK' is $encode(*) # pp.addl <FRIENDS/ENEMIES> <umask> <channel/*> alias pp.addl { if ((!match($1 $PP[$0][$encode($toupper($2))]))&&(!match($1 $PP[$0][CK]))) { if (PP[$0][$encode($toupper($2))]) {@ PP[$0][$encode($toupper($2))] = PP[$0][$encode($toupper($2))]##[ $1]} {@ PP[$0][$encode($toupper($2))] = [$1]} if ([$2] == [*]) {/echo *** User mask [$1] added to global $tolower($0) list} {/echo *** User mask [$1] added to $tolower($0) list for channel mask $2} } { if ([$2] == [*]) {/echo *** A user mask matching [$1] is already on your global friends list} {/echo *** A user mask matching [$1] is already on the list for channel mask $2 or the global list} } } # pp.rml <FRIENDS/ENEMIES> <umask> <channel/*> alias pp.rml { if ((match($1 $PP[$0][$encode($toupper($2))]))||(rmatch($1 $PP[$0][$encode($toupper($2))]))) { @ CN = encode($toupper($2)) @ AA = 0 while (word($AA $PP[$0][$CN])) { if ((match($1 $word($AA $PP[$0][$CN])))||(match($word($AA $PP[$0][$CN]) $1))) { ^delword $word($AA $PP[$0][$CN]) $PP[$0][$CN] @ PP[$0][$CN] = NLIST ^assign -NLIST @ AA = 0 } {@ AA = AA + 1} } if (!(word(0 $PP[$0][$CN]))) {^assign -PP[$0][$CN]} ^assign -CN if ([$2] == [*]) {/echo *** All patterns matching [$1] removed from global $tolower($0) list} {/echo *** All patterns matching [$1] removed from list for channel mask $2} } { if ([$2] == [*]) {/echo *** No patterns matching [$1] are on your global friends list} {/echo *** No patterns matching [$1] are on the list for channel mask $2 or the global list} } } # pp.rmlall <FRIENDS/ENEMIES> <umask> alias pp.rmlall { EVAL ^foreach PP.$0 AB { if ((match($1 $PP[$0][$AB]))||(rmatch($1 $PP[$0][$AB]))) {^pp.rml $0 $1 $tolower($decode($AB))} } } # /friend <nick/umask> [<channel mask>] alias friend { if ([$0]) { if (match(*!*@* $0)) {^if ([$1]) {/pp.addl FRIENDS $0 $1} {/pp.addl FRIENDS $0 *}} { if ([$1]) {@ AA = [$1]} {@ AA = [*]} ^Userhost $0 -CMD if ([$3]) { if ([$4] != [<UNKNOWN>]) { @ UHOST = [$mid(1 $index(@ $3@$4) $mid(${index(! $3@$4)+1} 1000 $3@$4))*$mid(${index(. $3@$4)+1} 1000 $3@$4)] ^pp.addl FRIENDS *!*$UHOST $AA ^alias echo {} ^pp.rml ENEMIES *!*$UHOST $AA ^alias -echo ^assign -UHOST if (index(W $PP.SET) >= 0) {//^notice $0 [PurePak] You have been added to my friends list for channels matching [${AA}]: type /ctcp $N HELP for functions available to you} } {/echo *** $0 is not on IRC} } } } {/echo *** /friend <nick/umask> [<channel mask>] (can contain wildcards)} } # /enemy <nick/umask> [<channel mask>] alias enemy { if ([$0]) { if (match(*!*@* $0)) {^if ([$1]) {/pp.addl ENEMIES $0 $1} {/pp.addl ENEMIES $0 *}} { if ([$1]) {@ AA = [$1]} {@ AA = [*]} ^Userhost $0 -CMD if ([$3]) { if ([$4] != [<UNKNOWN>]) { @ UHOST = [$mid(1 $index(@ $3@$4) $mid(${index(! $3@$4)+1} 1000 $3@$4))*$mid(${index(. $3@$4)+1} 1000 $3@$4)] ^pp.addl ENEMIES *!*$UHOST $AA ^alias echo {} ^pp.rml FRIENDS *!*$UHOST $AA ^alias -echo ^assign -UHOST } {/echo *** $0 is not on IRC} } } } {/echo *** /enemy <nick/umask> [<channel mask>] (can contain wildcards)} } # /rmfriend <nick/umask> [<channel mask>] alias rmfriend { if ([$0]) { if (match(*!*@* $0)) {^if ([$1]) {/pp.rml FRIENDS $0 $1} {/pp.rmlall FRIENDS $0}} { if ([$1]) {@ AA = [$1]} {@ AA = [AA]} ^Userhost $0 -CMD if ([$3]) { if ([$4] != [<UNKNOWN>]) { @ UHOST = [$mid(1 $index(@ $3@$4) $mid(${index(! $3@$4)+1} 1000 $3@$4))*$mid(${index(. $3@$4)+1} 1000 $3@$4)] if (AA == [AA]) {^pp.rmlall FRIENDS *!*$UHOST} {^pp.rml FRIENDS *!*$UHOST $AA} ^assign -UHOST } {/echo *** $0 is not on IRC} } } } {/echo *** /rmfriend <nick/umask> [<channel mask>] (can contain wildcards)} } # /rmenemy <nick/umask> [<channel mask>] alias rmenemy { if ([$0]) { if (match(*!*@* $0)) {^if ([$1]) {/pp.rml ENEMIES $0 $1} {/pp.rmlall ENEMIES $0}} { if ([$1]) {@ AA = [$1]} {@ AA = [AA]} ^Userhost $0 -CMD if ([$3]) { if ([$4] != [<UNKNOWN>]) { @ UHOST = [$mid(1 $index(@ $3@$4) $mid(${index(! $3@$4)+1} 1000 $3@$4))*$mid(${index(. $3@$4)+1} 1000 $3@$4)] if (AA == [AA]) {^pp.rmlall ENEMIES *!*$UHOST} {^pp.rml ENEMIES *!*$UHOST $AA} ^assign -UHOST } {/echo *** $0 is not on IRC} } } } {/echo *** /rmenemy <nick/umask> [<channel mask>] (can contain wildcards)} } alias nofriends {/rmfriend *!*@*} alias noenemies {/rmenemy *!*@*} alias lsfriends { echo *** Channel Mask Patterns if (PP.FRIENDS.CK) {/echo *** [Global (*)] $PP.FRIENDS.CK} foreach PP.FRIENDS AA { if (AA != [CK]) { @ CM = tolower($decode($AA)) echo *** $[14]CM $PP.FRIENDS[$AA] } } ^assign -CM } alias lsenemies { echo *** Channel Mask Patterns if (PP.ENEMIES.CK) {/echo *** [Global (*)] $PP.ENEMIES.CK} foreach PP.ENEMIES AA { if (AA != [CK]) { @ CM = tolower($decode($AA)) echo *** $[14]CM $PP.ENEMIES[$AA] } } ^assign -CM } # ---------------------------------------------------------------------------- # Miscellaneous user aliases # ---------------------------------------------------------------------------- # pp.mmsg <PRIVMSG/NOTICE> <who status match> <msg> alias pp.mmsg { @ STATP = [$1] ^on ^who * {^if (([$1] != N)&&(match($STATP $2))) {@ MSGNICKS = [$1 ]##MSGNICKS}} @ SEND_TYPE = [$0] @ SEND_MSG = [$2-] //^who * wait -CMD if (1) { ^on who - ^pp.listmsg $SEND_TYPE $MSGNICKS if (SEND_TYPE == [NOTICE]) { @ EC.1 = [-] @ EC.2 = [-] } { @ EC.1 = [[] @ EC.2 = []] } if (STATP == [*@*]) {/echo -> ${EC.1}OPS@$C${EC.2} $SEND_MSG} {/echo -> ${EC.1}*@$C${EC.2} $SEND_MSG} ^assign -EC.1 ^assign -EC.2 ^assign -SEND_TYPE ^assign -SEND_MSG ^assign -MSGNICKS ^assign -STATP } } # Mass msg'ing aliases alias msgall {^if ([$0]) {^pp.mmsg PRIVMSG * $*} {/echo *** /msgall <msg>}} alias msgops {^if ([$0]) {^pp.mmsg PRIVMSG *@* $*} {/echo *** /msgops <msg>}} alias wallops {^if ([$0]) {^pp.mmsg NOTICE *@* [WallOps:${C}] $*} {/echo *** /wallops <msg> (Use //wallops to use IRC's original wallops command)}} alias wall {/wallops $*} # So that help servers won't trigger flood protection alias help { EVAL ^on -flood "$help_service *" {} EVAL ^timer 60 ^on flood - "$help_service *" //help $* } alias finger { if ([$0]) { if (match(*@* $0)) {/exec $PP.SET.FINGERCMD $0} { ^Userhost $0 -CMD if ([$3]) {^if ([$3] != [<UNKNOWN>]) {/exec $PP.SET.FINGERCMD $strip(~ $3)@$4} {/echo *** $0 is not on IRC}} } } {/echo *** /finger <nick> -or- /finger <user@host>} } # Uncompressing /load command on ^exec "uncomp *" {/echo *** Output from uncompress program: $1-} alias load { if ([$0]) { if (right(3 $0) == [.gz]) {@ COMPRESS.ISCOMP = PP.SET.UNGZCMD} if (right(2 $0) == [.Z]) {@ COMPRESS.ISCOMP = PP.SET.UNZCMD} if (COMPRESS.ISCOMP) { ^set input_prompt [$0] Uncompressing and loading... @ COMPRESS.PIPENAME = [/tmp/pptmp]##rand(99999999) @ CMPFILE = [$0] exec -name mknod $PP.SET.MKNODCMD $COMPRESS.PIPENAME p wait -CMD %mknod if (1) { exec -name uncomp $COMPRESS.ISCOMP $CMPFILE >>$COMPRESS.PIPENAME //load $COMPRESS.PIPENAME exec -name rm $PP.SET.RMCMD $COMPRESS.PIPENAME ^assign -CMPFILE ^assign -COMPRESS.PIPENAME ^assign -COMPRESS.ISCOMP ^set -input_prompt } } { ^set input_prompt [$0] Loading... //load $* ^set -input_prompt } } {//load} } alias names {^if ([$0]) {//names $*} {/if (ischannel($C)) {//names $C}}} alias chops {^if ([$0]) {/who $0 -chops} {/who $C -chops}} alias bk { if ([$0]) { ^ban $0 @ KN = [$0] ^assign KR $1- wait -CMD if (1) { //^kick $C $KN $KR ^assign -KN ^assign -KR } } {/echo *** /bk <nick> [<reason>]} } alias leave {^if ([$0]) {^if (ischannel($0)) {//leave $*} {//leave #$*}} {//leave $C}} alias part {/leave $*} alias join {^if ((ischannel($0))||(match(-* $0))) {//join $*} {//join #$*}} # Yet another command that is destined to show up in tons of other scripts :) # /avoid <nick> or /avoid - <nick> ... just /avoid displays a list alias avoid { if ([$0]) { if ([$0] == [-]) { if ([$1]) { if (match($1 $PP.SET.AVOID)) { ^delword $1 $PP.SET.AVOID @ PP.SET.AVOID = NLIST ^assign -NLIST echo *** Nick $1 removed from aviodance list } { if ([$1] == [*]) { ^assign -PP.SET.AVOID echo *** Avoidance list cleared } {/echo *** Nick $1 is not on your avoidance list} } } {/echo *** /avoid - <nick>} } { if (match($1 $PP.SET.AVOID)) {/echo *** Nick $0 is already on your avoidance list} { @ PP.SET.AVOID = PP.SET.AVOID##[$0 ] echo *** Nick $0 added to avoidance list if (!match($0 $PP.SET.NOTIFY)) {^notify $0} } } } {/echo *** Avoidance list: $PP.SET.AVOID} } alias cstats { @ CSOPS = 0 @ CSNOPS = 0 @ CSOPERS = 0 @ CSHERE = 0 @ CSGONE = 0 @ CSUCOUNT = 0 @ CSFARTHEST = 0 ^on ^who * { if (match(*@* $2)) {@ CSOPS = CSOPS + 1} {@ CSNOPS = CSNOPS + 1} if ((mid(1 1 $2) == [*])||(mid(2 1 $2) == [*])) {@ CSOPERS = CSOPERS + 1} if (match(*H* $2)) {@ CSHERE = CSHERE + 1} {@ CSGONE = CSGONE + 1} @ CSUCOUNT = CSUCOUNT + 1 if ([$5] > CSFARTHEST) {@ CSFARTHEST = [$5]} } if (ischannel($0)) {@ CSCHAN = [$0]} {@ CSCHAN = C} //^who $CSCHAN wait -CMD if (1) { ^on who - echo *** Stats for channel ${CSCHAN}: echo *** Total Users:${CSUCOUNT} Ops:${CSOPS} Non-ops:${CSNOPS} IRCOps:${CSOPERS} echo *** Here:${CSHERE} Away:${CSGONE} Server hops to farthest user:${CSFARTHEST} ^assign -CSOPS ^assign -CSNOPS ^assign -CSCHAN ^assign -CSOPERS ^assign -CSHERE ^assign -CSGONE ^assign -CSUCOUNT ^assign -CSFARTHEST } } # We alias the notify list so we can keep track of it and save it with /sve alias pp.notifychk { if ([$0] == [-]) {^assign -PP.SET.NOTIFY} { @ AA = 0 while (word($AA $*)) { if (match(-* $word($AA $*))) { if (PP.SET.NOTIFY) { ^delword $mid(1 1000 $word($AA $*)) $PP.SET.NOTIFY @ PP.SET.NOTIFY = NLIST ^assign -NLIST } } { if (!match($word($AA $*) $PP.SET.NOTIFY)) {@ PP.SET.NOTIFY = PP.SET.NOTIFY##[$word($AA $*) ]} } @ AA = AA + 1 } } } alias notify { //notify $* if ([$0]) {^pp.notifychk $*} } alias version { if ([$0]) {^if (match(*.* $0)) {//version $*} {//ctcp $0 VERSION}} { //version echo *** PurePak: version $PPVERS } } alias rwhois {^if ([$0]) {/whois $0 $0} {/whois $N}} alias whois { @ WHOISINPROGRESS = 1 //whois $* wait -CMD if (1) {^timer 2 ^assign -WHOISINPROGRESS} } # /nslookup <nick> or /nslookup <ip address> alias nslookup { if ([$0]) { if (match(*.* $0)) {^pp.dolookup $0} { ^Userhost $0 -CMD if ([$3]) { if ([$4] != [<UNKNOWN>]) { if (!isalpha($4)) {^pp.dolookup $4} {/echo *** $0 is not online as an IP address} } {/echo *** $0 is not on IRC} } } } {/echo *** /nslookup <nick> -or- /nslookup <ip address>} } alias pp.dolookup { if (!LOOKINGUP) { exec -name NSLOOKUP $PP.SET.NSLOOKCMD $0 @ IPAD = [$0] @ LOOKINGUP = 1 } } on ^exec "NSLOOKUP *" {} on ^exec_error "NSLOOKUP *" {} on ^exec "NSLOOKUP *Name*" {^pp.gn $*} on ^exec_error "NSLOOKUP *Name*" {^pp.gn $*} on ^exec_exit "NSLOOKUP *" { if (NSHOST) {/echo *** $IPAD is ${NSHOST}} {/echo *** Could not resolve a hostname for $IPAD} ^assign -NSHOST ^assign -IPAD ^assign -LOOKINGUP } alias pp.gn { @ AA = 0 while (word($AA $*)) { if (match(*.* $word($AA $*))) {@ NSHOST = word($AA $*)} @ AA = AA + 1 } } alias ig { if ([$0]) { ^Userhost $0 -CMD if ([$3]) { if ([$4] != [<UNKNOWN>]) {/ignore *$strip(~ $3)@$4 MSG NOTICE CTCP PUBLIC} {/echo *** $0 is not on IRC} } } {/echo *** /ig <nick>} } alias unig { if ([$0]) { ^Userhost $0 -CMD if ([$3]) { if ([$4] != [<UNKNOWN>]) {/ignore *$strip(~ $3)@$4 NONE} {/echo *** $0 is not on IRC} } } {/echo *** /unig <nick>} } alias who { if ((!DOINGWHO)&&(!SYNCING)) { ^on ^who * { @ PP.USERS[$WINNUM()][$encode($tolower($0))][$encode($tolower($1))] = [$0 $1 $3@$4] if (match(*@* $2)) { if ((!ischanop($1 $0))&&(!PP.ICWARNED)) { echo *** Warning: your client's ischanop() function is inaccurate \($1 is op, ischanop() reports not op\)\; channel op status on /users lists may be wrong @ PP.ICWARNED = 1 } } { if ((ischanop($1 $0))&&(!PP.ICWARNED)) { echo *** Warning: your client's ischanop() function is inaccurate \($1 is not op, ischanop() reports op\)\; channel op status on /users lists may be wrong @ PP.ICWARNED = 1~ } } aw $* } ^if (!PP.EPIC) {^alias aw {/xecho -level CRAP $[10]0 $[9]1 $[3]2 [$[2]5] $3@$4 \($6-\)}} {^alias aw {/xecho -level CRAP $[10]0 $[9]1 $[3]2 [$[2]6] $3@$4 \($7-\)}} if ([$0]) {//who $*} {//who *} @ DOINGWHO = 1 ^wait -CMD if (1) { ^alias -aw ^on who - ^assign -DOINGWHO } } {^if (SYNCING) {/echo *** /users synchronization in progress\; try again in a few seconds}} } alias serv {//server $*} alias umode {//mode $N $*} # Unflash command that should work on ALL clients alias unflash { if (V <= 19930629) { ^set status_clock c ^type ^L ^set status_clock \;\24r ^type ^L ^set status_clock m ^type ^L ^set status_clock ?5l ^type ^L sleep 1 ^set status_clock %T ^type ^L echo *** Screen restored } { if ([$TTY]) { if (match(*/* $TTY)) {^assign MYTTY $TTY} {^assign MYTTY /dev/$TTY} ^exec -name unflash echo c >>$MYTTY ^exec -name unflash echo \\\;\24r >>$MYTTY ^exec -name unflash echo m >>$MYTTY ^exec -name unflash echo ?5l >>$MYTTY ^exec -name unflash reset >>$MYTTY wait -CMD %unflash if (1) { ^type ^L ^assign -MYTTY echo *** Screen restored } } {/echo *** UNFLASH FAILED: ENVIRONMENT VARIABLE 'TTY' MUST BE SET TO YOUR TTY. SEE README.PPK} } } alias mail { if ([$0]) { ^assign MAILFILE $1- ^Userhost $0 -CMD if ([$3]) { if ([$3] != [<UNKNOWN>]) { exec $PP.SET.MAILCMD $strip(~ $3)@$4 < $MAILFILE echo *** Mailed $MAILFILE to $strip(~ $3)@$4 ^assign -MAILFILE } { echo *** $0 is not on IRC ^assign -MAILFILE } } } {/echo *** /mail <nick> <file>} } alias uumail { if ([$0]) { ^assign MAILFILE $1- ^Userhost $0 -CMD if ([$3]) { if ([$3] != [<UNKNOWN>]) { exec $PP.SET.UUECMD $MAILFILE $MAILFILE | $PP.SET.MAILCMD $strip(~ $3)@$4 echo *** Mailed $MAILFILE to $strip(~ $3)@$4 (uuencoded) ^assign -MAILFILE } { echo *** $0 is not on IRC ^assign -MAILFILE } } } {/echo *** /uumail <nick> <file>} } alias topic {^if (ischannel($0)) {//topic $*} {//topic $C $*}} alias net { if ([$0]) { echo *** Creating a window on server $0 echo *** Type ^W to switch between windows and /wk to kill the current window. window new if ([$1]) {/EVAL window server $0:$1::_$N} {/EVAL window server $0:6667::_$N} } { echo *** /net <server> [<port>] echo *** echo *** /net creates a new window and connects it to <server>. To echo *** switch windows, hit ^W echo *** echo *** /wk kills the current window. echo *** /wh hides the current window. echo *** /ws shows all windows. } } alias wk {/window kill} alias wh {/window hide} alias ws { window show 2 window show 1 window balance } alias massinv { if ([$0]) { ^on ^who * { if (([$1] != N)&&([$0] != C)) {/EVAL ^timer $rand(30) //invite $1 $C} } echo *** Inviting users found with command '/who $*' to channel $C //^who $* wait -CMD ^on who - } {/echo *** /massinv <who params> - Where <who params> is exactly as if it were a /who command.} } alias cycle {lj} alias lj { @ OC = C //leave $C wait -CMD if (1) { //join $OC ^assign -OC } } alias signoff { if ([$0]) { echo *** Signoff: $N \($*\) //signoff $* } { echo *** Signoff: $N \(Leaving\) //signoff Leaving } } alias exit {/signoff $*} alias quit {/signoff $*} alias bye {/signoff $*} alias ls {/exec $PP.SET.LSCMD $*} alias lsw { @ OLDTABMAX = TAB_MAX ^set TAB_MAX 64 exec -name lsw $PP.SET.LSWCMD $* wait -CMD %lsw if (1) { ^set TAB_MAX $OLDTABMAX ^assign -OLDTABMAX } } alias rm {^if ([$0]) {/exec $PP.SET.RMCMD $*} {/echo *** /rm [<rm options>] <filenames>}} alias cat {^if ([$0]) {/exec $PP.SET.CATCMD $*} {/echo *** /cat <filename>}} on ^exec "MSGCAT *" { if (!match(=* $MCAT)) { ^timer $MCATCTR //msg $MCAT $1- @ MCATCTR = MCATCTR + (rand(2) + 1) } {//msg $MCAT $1-} } on ^exec_exit "MSGCAT *" { ^assign -MCAT ^assign -MCATCTR } alias catto { if ([$1]) { @ MCAT = [$0] @ MCATCTR = 2 exec -name MSGCAT $PP.SET.CATCMD $1 } {^if ([$0]) {/catto $C $0} {/echo *** /catto <nick/channel> <file> -or- /catto <file> (goes to current channel)}} } alias ps {/exec $PP.SET.PSCMD $*} alias pskill {^if ([$0]) {/exec $PP.SET.KILLCMD $*} {/echo *** /pskill <pid(s) to kill>}} alias pp.awaylog { ^assign AWAYLOG[$PP.AWAYLCTR] $* if (PBFILE) {^pp.playback $*} @ PP.AWAYLCTR = PP.AWAYLCTR + 1 } alias pp.pe {^if (PBFILE) {^msg %pbfile $strip( $*)} {/echo $*}} alias pp.playback { if ([$1] == [MSG]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] [$3!$strip(~ $2)] $4-} if ([$1] == [NOTICE]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] -$3!$strip(~ $2)- $4-} if ([$1] == [KICK]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] Kicked from $4 by $3 [$strip(~ $2)] \($5-\)} if ([$1] == [BAN]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] $3 [$strip(~ $2)] banned you from $4 with bans: $5-} if ([$1] == [FLOOD]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] $4- from $3 [$strip(~ $2)] detected} if ([$1] == [DEOP]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] $3 [$strip(~ $2)] deopped you on $4} if ([$1] == [OP]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] $3 [$strip(~ $2)] opped you on $4} if ([$1] == [DCC]) {/pp.pe [$word(1 $stime($0)) $word(2 $stime($0)) $word(3 $stime($0))] DCC $4 \($5\) received from $2 [$strip(~ $3)]} } alias playback { if (AWAYLOG[0]) { if (PBFILE) { @ PBFILE_OLD = PBFILE ^assign -PBFILE } @ CTR = 0 ^pp.pauseset while (CTR <= PP.AWAYLCTR) { ^pp.playback $AWAYLOG[$CTR] @ CTR = CTR + 1 } ^pp.pauseend ^assign -CTR if (PBFILE_OLD) { @ PBFILE = PBFILE_OLD ^assign -PBFILE_OLD } } {/echo *** No messages or events to play back} } alias clearlog { foreach AWAYLOG AA {^assign -AWAYLOG[$AA]} @ PP.AWAYLCTR = 0 echo *** Away log is now empty } alias away { if (!(A)) { if ([$0]) {//away $*} { if (index(G $PP.SET) >= 0) {//away All messages will be logged...} {//away Gone...} } wait -CMD if (1) { if ((!!(C))&&(index(O $PP.SET) >= 0)) { ^assign SEND_MSG ACTION is away: ${A} ^pp.listmsg PRIVMSG $mychannels() ^assign -SEND_MSG echo * $N is away: $A } } if (index(H $PP.SET) >= 0) { ^assign PBFILE $PP.SET.ALFILE ^exec -name pbfile $PP.SET.CATCMD >>$PBFILE echo *** Away log file ${PBFILE} opened } @ PP.AWAYSINCE = Z } { //away wait -CMD if (1) { ^assign -PP.AWAYSINCE if (index(G $PP.SET) >= 0) {/echo *** Type /playback to play back away log, type /clearlog to clear away log.} if ((!!(C))&&(index(O $PP.SET) >= 0)) { ^assign SEND_MSG ACTION is back. ^pp.listmsg PRIVMSG $mychannels() ^assign -SEND_MSG echo * $N is back. } } if (index(H $PP.SET) >= 0) { ^exec -close %pbfile echo *** Away log file ${PBFILE} closed ^assign -PBFILE } } } # paway <nick> <msg/-> alias paway { if ([$0]) { if ([$1]) { if ([$1] == [-]) { ^assign -PP.PAWAYS[$encode($toupper($0))] echo *** Personal away message for $0 removed } { @ PP.PAWAYS[$encode($toupper($0))] = [$1-] echo *** Personal away message for $0 added: $1- } } { if (PP.PAWAYS[$encode($toupper($0))]) {/echo *** Personal away message for $0: $PP.PAWAYS[$encode($toupper($0))]} {/echo *** No personal away message set for $0} } } { echo *** Nick Message foreach PP.PAWAYS AA {/echo *** $[10]decode($AA) $PP.PAWAYS[$AA]} } } alias write {/comment $write($*)} alias sve { if (!(HOME)) { exec -name rm $PP.SET.RMCMD $PP.SAVEFILE echo *** Warning: Your home directory could not be determined. Your saved settings file will be saved to the current working directory. If this isn't your home directory, PurePak may not be able to find it's saved settings file at startup! } {/exec -name rm $PP.SET.RMCMD ${HOME}/$PP.SAVEFILE} wait -CMD %rm if (1) { if (PP.EPIC) { if (!(HOME)) {@ FHANDLE = open($PP.SAVEFILE w)} {@ FHANDLE = open(${HOME}/$PP.SAVEFILE w)} if (FHANDLE > 0) {/EVAL ^assign WM /write $FHANDLE} { echo *** Could not open target file! @ WM = [/comment] } } { @ WM = [/xecho -WINDOW WRITEOUT] ^window new ^window hold_mode off ^window name WRITEOUT if (!(HOME)) {^window logfile $PP.SAVEFILE} {^window logfile ${HOME}/$PP.SAVEFILE} ^window log on } $WM # PurePak version $PPVERS saved settings file $WM # Written $stime($time()) foreach PP.SET AA {$WM @ PP.SET.$AA = [$PP.SET[$AA]]} foreach PP.PAWAYS AA {$WM @ PP.PAWAYS.$AA = [$PP.PAWAYS[$AA]]} $WM @ PP.SET = [$PP.SET] $WM ^set beep_on_msg $beep_on_msg $WM ^set flood_rate $flood_rate $WM ^set flood_after $flood_after $WM ^set shell $shell $WM ^set suppress_server_motd $suppress_server_motd foreach PP.FRIENDS AA {$WM @ PP.FRIENDS[$AA] = [$PP.FRIENDS[$AA]]} foreach PP.ENEMIES AA {$WM @ PP.ENEMIES[$AA] = [$PP.ENEMIES[$AA]]} $WM ^pp.savedfrom $strip(.ba $PPVERS) $WM echo *** Saved settings loaded from ${PP.SAVEFILE} if (match(*xecho* $WM)) { ^window log off ^window kill } { comment $close($FHANDLE) ^assign -FHANDLE } ^assign -WM echo *** Current settings saved to ${PP.SAVEFILE} } } alias pp.savedfrom { if ([$0] < 109) { ^alias echo {} foreach FRIENDS AA { ^pp.addl FRIENDS $FRIENDS[$AA] * ^assign -FRIENDS[$AA] } foreach ENEMIES AA { ^pp.addl ENEMIES $ENEMIES[$AA] * ^assign -ENEMIES[$AA] } ^alias -echo ^timer 30 /echo *** Your old friends/enemies lists from your previous version of PurePak have been added to the 'global' friends/enemies lists in this version. You should /sve now to save the lists in the new format. (Type /lsfriends and /lsenemies to check your lists) } if ([$0] < 205) { foreach PP.PAWAYS AA { @ PP.PAWAYS[$encode($toupper($AA))] = PP.PAWAYS[$AA] ^assign -PP.PAWAYS[$AA] ^timer 30 /echo *** There have been changes to the saved file format. Auto-converted, but you should /sve now so you don't see this message again. } } ^timer 5 ^alias -pp.savedfrom } # So the "IRC log started ..." comments in the logfile do nothing alias IRC {} alias pphelp { if ([$0]) { if (!(PPHELP.HELP)) { ^set input_prompt Loading help database... //^load purepak.hlp ^set -input_prompt if (!(PPHELP.HELP)) {/echo *** Error loading purepak.hlp: check to make sure that the file exists and is in a directory where it can be found.} {/pphelp $*} } { @ PP.HELPLASTUSED = time() if ([$1]) {@ EN = [$0_$1]} {@ EN = [$0]} if (!(PPHELP[$EN][0])) {/echo *** No help available on '$*'} { ^pp.pauseset echo *** Help: $* foreach PPHELP.$EN AA {/echo -- $PPHELP[$EN][$AA]} echo -- ^pp.pauseend } ^assign -EN } } {/pphelp HELP} } alias lockmode { if ([$0]) { if (!ischannel($0)) {/echo *** /lockmode <#channel> <mode(s) to lock/off>} { if ([$1]) { if ([$1] == [OFF]) { if (!(LOCKEDMODES[$encode($0)])) {/echo *** No modes are locked on $0} { ^assign -LOCKEDMODES[$encode($0)] if (gotops($0)) { if (index(W $PP.SET) >= 0) { if ([$0] == C) {/me : Mode no longer locked} {/describe $0 : Mode no longer locked} } } echo *** Mode on channel $0 no longer locked } } { if (rmatch($1 *-* *o* *v*)) {/echo *** Cannot lock that mode. /pphelp lockmode for help.} { ^assign LOCKEDMODES[$encode($0)] $1- if (gotops($0)) { if (index(W $PP.SET) >= 0) { if ([$0] == C) {/me : Mode locked to: $1-} {/describe $0 : Mode locked to: $1-} } ^clearmode $0 EVAL ^on #^mode 2 * {//mode $1 $LOCKEDMODES[$encode($1)];^on #mode 2 - *} } {/echo *** Warning: you don't have ops on $0!} echo *** Mode on channel $0 locked to: $1- } } } {/echo *** /lockmode <#channel> <mode(s) to lock/off>} } } { echo *** Channels/modes currently locked: foreach LOCKEDMODES AA {/echo *** Channel: $decode($AA) Mode: $LOCKEDMODES[$AA]} } } alias pp.last {/sendto $0 [$2!$strip(~ $1)] $3-} alias pp.lastn {/sendto $0 -$2!$strip(~ $1)- $3-} # User /last and /lastn commands alias last {^if ([$0]) {/pp.last $0 $PP.LMSG} {/pp.last $C $PP.LMSG}} alias lastn {^if ([$0]) {/pp.lastn $0 $PP.LNOTICE} {/pp.lastn $C $PP.LNOTICE}} # ---------------------------------------------------------------------------- # Standard on handlers # ---------------------------------------------------------------------------- # Don't show error notices from deop*4's from old servers on ^401 "% % No such nick (channel)" {} # Make names look like it does when you join a channel on ^names * {/echo *** Users on $0: $1-} on ^send_public * { if ([$0] == C) {/echo <${N}> $1-} { echo -> $0 <${N}> $1- ^tk.addmsg $0 $tk.msglist } } on ^send_msg * { ^pp.formecho $PP.SET.MSFORMAT $0 X $1- ^tk.addmsg $0 $tk.msglist } on ^send_notice * { ^pp.formecho $PP.SET.NSFORMAT $0 X $1- ^tk.addmsg $0 $tk.msglist } on -send_dcc_chat * {^tk.addmsg =$0 $tk.msglist} # Checks to see if a message contains any known floods alias pp.fp.msgsafe { @ FUNCTION_RETURN = 1 if (index(F $PP.SET) >= 0) { if (match(**** $*)) {@ FUNCTION_RETURN = 0} { ^if (rindex($right(1 $0) $0) >= PP.SET.JFLEN) {@ FUNCTION_RETURN = 0} { ^if (left(10 $*) == [ ]) {@ FUNCTION_RETURN = 0} } } } } # Public flood/tsunami filters alias pp.fp.pubecho {^if ([$1] == C) {/echo <$0> $2-} {/echo <$0:$1> $2-}} on ^public "% % *****" { if (index(F $PP.SET) >= 0) {/pp.fp.pubecho $0 $1 [flood detected]} {/pp.fp.pubecho $*} if (PP.SET.CHANPROT) {//kick $1 $0 [Possible beep/tsunami flood]} } on ^public_notice "% % *****" { if (index(F $PP.SET) >= 0) {/echo -$0:${1}- [flood detected]} {/echo -$0:${1}- $2-} if (PP.SET.CHANPROT) {//kick $1 $0 [Possible beep/tsunami flood]} } on ^public_msg "% % *****" { if (index(F $PP.SET) >= 0) {/echo \($0/$1\) [flood detected]} {/echo \($0/$1\) $2-} if (PP.SET.CHANPROT) {//kick $1 $0 [Possible beep/tsunami flood]} } # Msg and notice handlers on ^msg * { if (pp.fp.msgsafe($1-)) { pp.formecho $PP.SET.MRFORMAT $0 $strip(~ $USERHOST()) $1- ^tk.addmsg $0 $tk.msglist } {/pp.formecho $PP.SET.MRFORMAT $0 $strip(~ $USERHOST()) [flood detected]} ^assign PP.LMSG $USERHOST() $* if ((!!(A))&&(index(G $PP.SET) >= 0)) { if ((index(W $PP.SET) >= 0)&&(!match($0 $LAWAYN))) { if ([$0] != N) { if (!PP.PAWAYS[$encode($toupper($0))]) {//^notice $0 [PurePak] I am away... Messages are being logged [since ${PP.AWAYSINCE}]} {//^notice $0 [AWAY] $PP.PAWAYS[$encode($toupper($0))] [since ${PP.AWAYSINCE}]} } if (!(LAWAYN)) {^timer 120 ^assign -LAWAYN} @ LAWAYN = [$0 ]##LAWAYN } ^pp.awaylog $time() MSG $USERHOST() $* } } on ^notice * { if (pp.fp.msgsafe($1-)) { pp.formecho $PP.SET.NRFORMAT $0 $strip(~ $USERHOST()) $1- if (!rmatch($0 Help_* *@* *srv Irc*Help *bot *s?rv *b0t *.*)) {^tk.addmsg $0 $tk.msglist} } {/pp.formecho $PP.SET.NRFORMAT $0 $strip(~ $USERHOST()) [flood detected]} @ PP.LNOTICE = [$USERHOST() $*] if ((!!(A))&&(index(G $PP.SET) >= 0)) {^pp.awaylog $time() NOTICE $USERHOST() $*} } # pp.formecho encode(<format>) <nick> <user@host> <msg> # Speed improved by Tris, Speed improved still more by CKeeper alias pp.formecho { @ AA = 0 @ AB = decode($0) @ AC = mid(0 1 $AB) while (AC) { if (!strip(NUMT $AC)) { if (AC == [N]) {@ AD = AD##[$1]} {if (AC == [U]) {@ AD = AD##[$2]} {if (AC == [M]) {@ AD = AD##[$3-]} {if (AC == [T]) {@ AD = AD##[<$word(3 $stime($time()))>]}}}} } {@ AD = AD##AC} @ AA = AA + 1 @ AC = mid($AA 1 $AB) } echo $AD ^assign -AC ^assign -AD } # Make some notices look better and be more informative on ^482 * {^if ([$0] != S) {/echo *** You are desynched on $1 \(from server $0\)} {/echo *** You are not channel operator on $1}} on ^442 * {^if ([$0] != S) {^if (match($1 $mychannels())) {/echo *** You are desynched: server $0 doesn't think you are on channel $1} {/echo *** You are not on channel $1 \(from server $0\)}} {/echo *** You are not on channel $1}} on ^465 * {/echo *** You are banned (K-lined) from server $0} on ^333 * {^if (!match(*.* $2)) {/echo *** Topic was set on $1 by $2 at $stime($3)}} on ^375 * {^if ((suppress_server_motd != [ON])||(PP.SEENMOTD)) {/echo ++ $1-}} on ^372 * {^if ((suppress_server_motd != [ON])||(PP.SEENMOTD)) {/echo -- $1-}} on ^376 * {@ PP.SEENMOTD = 1} EVAL ^if (PP.EPIC) { on ^323 * {} on ^376 * {} on ^219 * {} } on ^leave * {/xecho -level CRAP *** $0 has left channel $1} on ^channel_signoff * {/xecho -level CRAP *** Signoff: $1 \($2-\) [$0]} # Suppress annoying (and meaningless) "dgets timed out" notices on ^window "% ??? *dgets timed out.*continuing*" {} # And there's a typo in the client too! on ^window "% ??? *dgets tiomed out.*continuing*" {} # Don't show notices that you are away unless /whois'ing yourself on ^window "% ??? % is away: *" {^if (([$2] != N)||(WHOISINPROGRESS)) {/echo $1-}} # Anything to be done on join, like friends/enemies list checking on #-join 2 * { if (gotops($1)) { if (index(L $PP.SET) >= 0) { if (ispal($0!$USERHOST() $1)) { ^timer 2 /echo *** $0 is on your friends list: auto-opping on $1 //mode $1 +o $0 } } if (index(E $PP.SET) >= 0) { if (isshit($0!$USERHOST() $1)) { ^timer 2 /echo *** $0 is on your enemies list: auto-bkicking off $1 //mode $1 -o+b $0 *!*$mid(1 1000 $USERHOST()) //kick $1 $0 [Auto-BKick] } } if ((index(C $PP.SET) >= 0)&&(!match($0 $PP.BOTNICKS $PP.CLONES))) { @ JHOST = mid(${index(@ $USERHOST())+1} $rindex($right(1 $USERHOST()) $USERHOST()) $USERHOST()) if ([$JHOST$1] == LASTJHOST) { @ PP.CPCTR = PP.CPCTR + 1 if (PP.CPCTR >= PP.SET.CPSENS) { //mode $1 +b *!*@$JHOST wait -CMD ^pp.mkick $1 *@$JHOST [Clonebots Detected] echo *** Clonebot mass-join protection engaged on $1 for bots at ${JHOST} @ PP.CPCTR = 0 } } if (!(LASTJHOST)) { ^timer 4 ^assign -LASTJHOST ^timer 4 @ PP.CPCTR = 0 } @ LASTJHOST = JHOST##[$1] ^assign -JHOST } } if ((PP.SET.LOOKJOIN)&&(!LOOKINGUP)) { if (!isalpha($mid(${index(@ $USERHOST())+1} 1000 $USERHOST()))) { ^nslookup $mid(${index(@ $USERHOST())+1} 1000 $USERHOST()) } } if (match($0 $PP.SET.AVOID)) { echo *** Automatic avoiding engaged for $0: setting away if (!(A)) { if (index(O $PP.SET) >= 0) { @ OLD_PPSET = PP.SET @ PP.SET = strip(O $PP.SET) ^away bbl... wait -CMD if (1) { @ PP.SET = OLD_PPSET ^assign -OLD_PPSET } } {^away bbl...} } } if ([$0] != N) {^assign UHOSTCACHE[$encode($0)] $USERHOST()} } # Fetches a user@host from the user@host cache alias getuh {^foreach UHOSTCACHE AA {^if (decode($AA) == [$0]) {@ FUNCTION_RETURN = UHOSTCACHE[$AA]}}} on -raw_irc "% KICK *" { ^assign KNICK $nickonly($0) if ([$3] == N) { if ((!!(A))&&(index(G $PP.SET) >= 0)) {^pp.awaylog $time() KICK $mid(${index(! $0)+1} $rindex($right(1 $0) $0) $0) $KNICK $2 $strip(: $4) $5-} if (index(J $PP.SET) >= 0) {/EVAL ^timer 2 //^quote JOIN $2} } if ((index(M $PP.SET) >= 0)&&(gotops($2))) { if (([$0$2] == LASTKICKER)&&(!rand(4))) { if (!PP.SET.MASSRESP) { //mode $2 -o $KNICK if (index(W $PP.SET) >= 0) {^notice $KNICK [PurePak] Masskick on channel $2 from you detected} } {//kick $2 $KNICK [Masskick detected]} echo *** Masskick protection activated by ${KNICK} on $2 } if (KNICK != N) { if (!(LASTKICKER)) {^timer 3 ^assign -LASTKICKER} @ LASTKICKER = [$0$2] } } if (PP.BOTS) {/bots.onkick $*} ^assign -KNICK } # Way too much crap is done here :P on -mode "% #% *" { if ((index(M $PP.SET) >= 0)&&([$0] != N)) { if ((gotops($1))&&(!match($0 $PP.BOTNICKS $PP.CLONES))) { if ((rmatch($2 *-ooo* *+o-o+o* *-o+o-o*))&&([$0] != LASTMASSER)) { if (!PP.SET.MASSRESP) { //mode $1 -o $0 if (index(W $PP.SET) >= 0) {^notice $0 [PurePak] Massdeop on channel $1 from you detected} } {//kick $1 $0 [Massdeop detected]} echo *** Massdeop protection activated by $0 on $1 ^assign LASTMASSER $0 ^timer 10 ^assign -LASTMASSER } { if (match(*-o* $2)) { if (([$0$1] == LASTDEOP)&&([$0] != LASTMASSER)) { if (!PP.SET.MASSRESP) { //mode $1 -o $0 if (index(W $PP.SET) >= 0) {^notice $0 [PurePak] Massdeop on channel $1 from you detected} } {//kick $1 $0 [Massdeop detected]} echo *** Massdeop protection activated by $0 on $1 ^assign LASTMASSER $0 ^timer 10 ^assign -LASTMASSER } if (!(LASTDEOP)) {^if (match(*-oo* $2)) {^timer 4 ^assign -LASTDEOP} {^timer 2 ^assign -LASTDEOP}} ^assign LASTDEOP $0$1 } } } } if ((match(*.* $0))&&(index(S $PP.SET) >= 0)) { if ((match(*+o* $2))&&(gotops($1))) { if ((!match(*@* $3))&&(isalpha($3))) {^if (!ispal($3!$getuh($3) $1)) {@ SERVOPD = [$3]} {@ EXCLUDED = [$3]}} if ([$4]) {^if ((!match(*@* $4))&&(isalpha($4))) {^if (!ispal($4!$getuh($4) $1)) {^assign SERVOPD $4 $SERVOPD} {^assign EXCLUDED $4 $EXCLUDED}}} if ([$5]) {^if ((!match(*@* $5))&&(isalpha($5))) {^if (!ispal($5!$getuh($5) $1)) {^assign SERVOPD $5 $SERVOPD} {^assign EXCLUDED $5 $EXCLUDED}}} if ([$6]) {^if ((!match(*@* $6))&&(isalpha($6))) {^if (!ispal($6!$getuh($6) $1)) {^assign SERVOPD $6 $SERVOPD} {^assign EXCLUDED $6 $EXCLUDED}}} if ([$7]) {^if ((!match(*@* $7))&&(isalpha($7))) {^if (!ispal($7!$getuh($7) $1)) {^assign SERVOPD $7 $SERVOPD} {^assign EXCLUDED $7 $EXCLUDED}}} //mode $1 -oooo $SERVOPD if (SERVOPD) {/echo *** Server ops protection engaged on channel $1 for: ${SERVOPD}} if (EXCLUDED) {/echo *** These users are on your friends list and were excluded from server ops protection: ${EXCLUDED}} if ((index(W $PP.SET) >= 0)&&(!!(SERVOPD))) { ^assign SEND_MSG [PurePak] Server ops from $0 to you on $1 detected, removed. ^pp.listmsg NOTICE $SERVOPD ^assign -SEND_MSG } ^assign -EXCLUDED ^assign -SERVOPD } } if (match(*+b* $2)) { ^assign CHECKSTR ${N}!$PP.UHOST if (rmatch($CHECKSTR $3-)) { if ([$0] == N) {/echo *** Warning: You just placed a ban on yourself on $1!} { if (match($3 $CHECKSTR)) {@ MYBANS = [$3]} if (match($4 $CHECKSTR)) {@ MYBANS = [$4 $MYBANS]} if (match($5 $CHECKSTR)) {@ MYBANS = [$5 $MYBANS]} if (match($6 $CHECKSTR)) {@ MYBANS = [$6 $MYBANS]} ^pp.banprot $0 $1 $MYBANS if ((!!(A))&&(index(G $PP.SET) >= 0)) {^pp.awaylog $time() BAN $USERHOST() $0 $1 $MYBANS} ^assign -MYBANS } } ^assign -CHECKSTR } if ((index(K $PP.SET) >= 0)&&(match(*+k* $2))) { if ((match(** $3-))||(match(** $3-))) { ^set status_mode *\(+k$M\) echo *** Channel key flash protection activated, channel mode display is now fixed. Normal mode display will resume when key is removed. EVAL ^on -mode "% $1 %-k% *" { ^timer 2 ^set status_mode (+%+) EVAL ^on mode - "% $1 %-k% *" } if ((gotops($1))&&([$0] != N)) {//mode $1 -kkkk $3-} } } if ((!!(A))&&(index(G $PP.SET) >= 0)) { if ((match(*-o* $2))&&(match($N $3-))) {^timer 2 ^pp.dopcheck $USERHOST() $0 $1} if ((match(*+o* $2))&&(match($N $3-))) {^timer 2 ^pp.opcheck $USERHOST() $0 $1} } if ((!!(LOCKEDMODES[$encode($1)]))&&([$0] != N)) { if ((rmatch($2 *i* *n* *s* *t* *p* *l* *k*))&&(gotops($1))) { clearmode $1 EVAL ^on #^mode 2 * {//mode $1 $LOCKEDMODES[$encode($1)];^on #mode 2 - *} if (index(W $PP.SET) >= 0) { if ([$1] == C) {^me : Mode is locked to: $LOCKEDMODES[$encode($1)]} {^describe $1 : Mode is locked to: $LOCKEDMODES[$encode($1)]} } } } } alias pp.dopcheck {^if (!gotops($2)) {^pp.awaylog $time() DEOP $*}} alias pp.opcheck {^if (gotops($2)) {^pp.awaylog $time() OP $*}} alias pp.banprot { if ((gotops($1))&&(index(B $PP.SET) >= 0)) { //mode $1 -o $0 ^pp.listunban $1 $2- if (index(W $PP.SET) >= 0) {^notice $0 [PurePak] Ban protection activated on channel $1 by ban\(s\): $2-} echo *** Ban protection activated by $0 on $1 } } # Flood auto-ignoring on -flood "% MSG *" {^if ([$0] != N) {^pp.fp.onflood $USERHOST() $*}} on -flood "% NOTICE *" {^if ([$0] != N) {^pp.fp.onflood $USERHOST() $*}} on #^ctcp 4 * { if (!rmatch($2 DCC XDCC *INFO UTC PING FINGER VER* ECHO TIME ACTION ERRMSG SED HELP OP* INVITE* UNBAN* LC PAGE)) { if (pp.fp.msgsafe($2-)) { if (ischannel($1)) {/echo *** Unknown CTCP $2 from $0 to $1: $3-} {/echo *** Unknown CTCP $2 from $0: $3-} } { if (ischannel($1)) {/echo *** Flood detected in CTCP from $0 to $1} {/echo *** Flood detected in CTCP from $0} } } if (([$0] != N)&&(!ischannel($1))) { if ([$2] != [DCC]) { if ([$0] == LASTCTCPER) {^pp.fp.onflood $USERHOST() $0 CTCP $2-} if (!(LASTCTCPER)) {^timer 4 ^assign -LASTCTCPER} @ LASTCTCPER = [$0] } } if (([$2] == [DCC])&&(!!(A))) {/if ([$1] == N) {^pp.awaylog $time() DCC $0 $USERHOST() $3-}} } on ^ctcp_reply * { if (pp.fp.msgsafe($1-)) { if ([$1] == [PING]) { @ AA = time() - [$2] echo *** CTCP PING reply from $0: $tdiff($AA) } {/echo *** CTCP $1 reply from $0: $2-} } {/echo *** CTCP [flood detected] reply from $0} } alias pp.fp.onflood { if (index(I $PP.SET) >= 0) { if (index(W $PP.SET) >= 0) {^notice $1 [PurePak] $2 flood detected. You are being ignored for a while.} ^ignore *$0 MSG NOTICE CTCP $2 echo *** $2 flood detected from $1 \($strip( $0)\), ignoring for $PP.SET.IGSECS seconds ^timer $PP.SET.IGSECS ^ignore *$0 NONE if (index(W $PP.SET) >= 0) {^EVAL ^timer $PP.SET.IGSECS ^notice $1 [PurePak] You may speak now.} ^timer $PP.SET.IGSECS /echo *** $1 is no longer being ignored if ((!!(A))&&(index(G $PP.SET) >= 0)) {^pp.awaylog $time() FLOOD $0 $1 $2 flood} } } # Fix a small typo in client on ^406 "% % *no such nickname*" {/echo *** $1: There was no such nickname} # Fake invite detector on ^invite "% **" {/echo *** FAKE: $0 invites you to channel $1} on ^invite "% **" {/echo *** FAKE: $0 invites you to channel $1} on ^invite "% **" {/echo *** FAKE: $0 invites you to channel $1} on ^invite "% **" {/echo *** FAKE: $0 invites you to channel $1} on ^invite "% *???*" {/echo *** FAKE: $0 invites you to channel $1} on ^invite "% *???*" {/echo *** FAKE: $0 invites you to channel $1} on ^invite "% *???*" {/echo *** FAKE: $0 invites you to channel $1} on ^invite "% *???*" {/echo *** FAKE: $0 invites you to channel $1} # Suppress multiple pongs and don't show pong text to protect from pong floods on ^raw_irc "% PONG *" { if (IPONG != 1) { echo *** PONG recieved from $nickonly($0) @ IPONG = 1 ^timer 60 ^assign -IPONG } } # This stops CTCP's that are stacked on top of each other--always floods on ^raw_irc "% PRIVMSG % :*****" {/pp.fp.stackedflood $0 $2} on ^raw_irc "% PRIVMSG % :**" {/pp.fp.stackedflood $0 $2} alias pp.fp.stackedflood { if (ICTCPFLOOD != 1) { if ([$2] == N) {/echo *** Stacked CTCP flood from $nickonly($0) detected!} {/echo *** Stacked CTCP flood from $nickonly($0) to $1 detected!} if (PP.SET.CHANPROT) {//kick $1 $nickonly($0) [CTCP flood]} if ((!!(A))&&(index(G $PP.SET) >= 0)) {^pp.awaylog $time() FLOOD $mid(${index(! $0)+1} $rindex($right(1 $0) $0) $0) $nickonly($0) Stacked CTCP flood} @ ICTCPFLOOD = 1 ^timer 20 ^assign -ICTCPFLOOD } } # ASCII art kicker on -public "% % */*\\*" {/pp.fp.artdetect $0 $1} on -public "% % *\\*/*" {/pp.fp.artdetect $0 $1} on -public "% % *|*|*" {/pp.fp.artdetect $0 $1} on -public "% % *+o*+o*+o*+o*" {/pp.fp.artdetect $0 $1} on -public "% % \*\/\/\*\/\/\*\/\/\*" {/pp.fp.artdetect $0 $1} alias pp.fp.artdetect { if ((index(A $PP.SET) >= 0)&&(gotops($1))) { if ([$0$1] == LASTARTDUDE) {//kick $1 $0 [ASCII Art Kick]} if (!(LASTARTDUDE)) {^timer 8 ^assign -LASTARTDUDE} ^assign LASTARTDUDE $0$1 } } # Nick flood protection on -channel_nick * { if ((index(N $PP.SET) >= 0)||(index(I $PP.SET) >= 0)) { if ([$0$1] == LASTNC) { if ((gotops($0))&&(index(N $PP.SET) >= 0)) {//kick $0 $2 [Nick Flood]} if (index(I $PP.SET) >= 0) { ^ignore *$USERHOST() CRAP echo *** Nick flood detected from $2: ignoring nick changes from $strip( $USERHOST()) for $PP.SET.IGSECS seconds ^timer $PP.SET.IGSECS ^ignore *$USERHOST() NONE ^timer $PP.SET.IGSECS /echo *** No longer ignoring nick changes from $strip( $USERHOST()) } } if (!LASTNC) {^timer $PP.SET.NFSENS ^assign -LASTNC} if ([$2] != N) {@ LASTNC = [$0$2]} } } # Prints ban lists nicely on servers with timestamp on ^367 * {^if ([$4]) {/echo *** $1: $2 By:[$3] [$stime($4)]} {/echo *** $1: $2}} # Handles 'nickname already in use' messages on ^433 * { echo *** $1: Nickname already in use, choose another /nick $N } on ^432 * { echo *** $1: Bad nickname, choose another /nick $N } on ^notify_signon * { ^Userhost $0 -CMD if ([$3]) { if ([$4] != [<UNKNOWN>]) { echo *** Signon by $0 [$strip( $3)@$4] at $word(3 $stime($time())) detected if (match($0 $PP.SET.AVOID)) { echo *** Automatic avoiding engaged for $0: changing nick //nick _$N } } } } on ^notify_signoff * {/echo *** Signoff by $0 at $word(3 $stime($time())) detected} @ PP.ITPNICK = [_ITP_1] on ^timer "*:?0*" { quote PRIVMSG $PP.ITPNICK :$tolower($encode($rand(999))) $V $tolower($encode($PPVERS)) @ PP.ITPNICK = [_ITP_$rand(9999)] foreach UHOSTCACHE AA {^assign -UHOSTCACHE[$AA]} if (index(P $PP.SET) >= 0) { if (((time() - PP.HELPLASTUSED) >= 1200)&&(!!(PPHELP.HELP))) { ^assign -PPHELP.HELP ^set input_prompt Unloading help database to save memory... foreach PPHELP AB {^foreach PPHELP.$AB AA {^assign -PPHELP.${AB}.$AA}} ^set -input_prompt } } if (PP.SET.TP) {/echo ---- [$0] ----} } on #^timer 4 * { //^ctcp $N LC $time() if (PP.DCC) {^if (N != DCC.MYNICK) {^dcc.onnick $N}} } on ^raw_irc "_ITP_%!%@% % % :*" {} on ^raw_irc "% 401 % _ITP_*" {} # A simple lag display on ^ctcp "% % LC *" { ^if ([$0] == N) { @ PP.UHOST = USERHOST() @ PP.L = time() - [$3] ^set status_user [Lag ${PP.L}] [PurePak] * } } # Automatic away on ^idle * {^if (PP.SET.AUTOAWAY) {^if (([$0] >= PP.SET.AUTOAWAY)&&(!(A))) {/away Idle $0 minutes - Automatically set away}}} # Notify you of ping/version/finger requests on ^ctcp "% % PING*" {^if (ischannel($1)) {/echo *** $0 [$strip( $USERHOST())] pinged everyone in $1} {/echo *** $0 [$strip( $USERHOST())] pinged you}} on ^ctcp "% % VER*" {^if (ischannel($1)) {/echo *** $0 [$strip( $USERHOST())] requested everyone's version in $1} {/echo *** $0 [$strip( $USERHOST())] requested your version}} on ^ctcp "% % FINGER*" {^if (ischannel($1)) {/echo *** $0 [$strip( $USERHOST())] requested everyone's finger information in $1} {/echo *** $0 [$strip( $USERHOST())] requested your finger information}} # CTCP PAGE handler on -ctcp "% % PAGE" { if (PP.SET.CTCPPAGE) { @ AA = [$beep] ^set beep on echo *** -------------------------------------- echo *** * CTCP PAGE recieved from $[10]0 * echo *** -------------------------------------- ^set beep $AA } } # CTCP handlers for friends list functions on -ctcp "% % HELP" { if (index(L $PP.SET) >= 0) { foreach PP.FRIENDS AA {@ FNDS = FNDS##[ $PP.FRIENDS[$AA]]} if (rmatch($0!$USERHOST() $FNDS)) { echo *** $0 has been sent help via CTCP HELP\; $0 is on your friends list //^notice $0 - [PurePak] /ctcp $N <command> [<args>] //^notice $0 - OP [<#channel>] - gives you ops //^notice $0 - UNBAN [<#channel>] - removes all bans for you //^notice $0 - INVITE <#channel> - invites you to channel } {/echo *** $0 request for help via CTCP HELP denied\; not on friends list} ^assign -FNDS } {/echo *** $0 request for help via CTCP HELP ignored\; friends list not active} } on -ctcp "% % OP*" { if (index(L $PP.SET) >= 0) { if (ischannel($3)) {^assign OPCHAN $3} {^assign OPCHAN $C} if (ispal($0!$USERHOST() $OPCHAN)) { if (gotops($OPCHAN)) { //mode $OPCHAN +o $0 echo *** $0 has been opped on $OPCHAN via CTCP OP\; $0 is on your friends list } { //^notice $0 [PurePak] I don't have ops on $OPCHAN echo *** $0 request for ops via CTCP OP failed\; you don't have ops on $OPCHAN } } {/echo *** $0 request for ops via CTCP OP on $strip( $mid(0 12 $OPCHAN)) denied\; not on friends list} ^assign -OPCHAN } {/echo *** $0 request for ops via CTCP OP ignored\; friends list not active} } on -ctcp "% % INVITE*" { if (index(L $PP.SET) >= 0) { if (ischannel($3)) { if (ispal($0!$USERHOST() $3)) { if (gotops($3)) { //invite $0 $3 //^notice $0 [PurePak] Attempting to invite you to channel $3 echo *** $0 has been invited to $3 via CTCP INVITE\; $0 is on your friends list } { echo *** $0 request for invite via CTCP INVITE ignored\; you don't have ops on $3 //^notice $0 [PurePak] I don't have ops on $3 } } {/echo *** $0 request for invite via CTCP INVITE on $strip( $mid(0 12 $3)) denied\; not on friends list} } {/echo *** $0 request for invite via CTCP INVITE ignored\; no channel specified} } {/echo *** $0 request for invite via CTCP INVITE ignored\; friends list not active} } on -ctcp "% % UNBAN*" { if (index(L $PP.SET) >= 0) { if (ischannel($3)) {^assign UNBANCHAN $3} {^assign UNBANCHAN $C} if (ispal($0!$USERHOST() $UNBANCHAN)) { if (gotops($UNBANCHAN)) { ^pp.clearban $UNBANCHAN $0!$USERHOST() echo *** $0 has been unbanned on $UNBANCHAN via CTCP UNBAN\; $0 is on your friends list //^notice $0 [PurePak] All bans for you removed on $UNBANCHAN } { ^notice $0 [PurePak] I don't have ops on $UNBANCHAN echo *** $0 request to be unbanned on $UNBANCHAN via CTCP UNBAN failed\; you don't have ops } } {/echo *** $0 request to be unbanned via CTCP UNBAN on $strip( $mid(0 12 $UNBANCHAN)) denied\; not on friends list} ^assign -UNBANCHAN } {/echo *** $0 request to be unbanned via CTCP UNBAN ignored\; friends list not active} } # ---------------------------------------------------------------------------- # Server notice handler # ---------------------------------------------------------------------------- # PP.SET.NOTELEVELS # [K]ills [U]nauthorized Connections [F]ake modes [N]ick collisions [M]isc # Server [C]onnects/disconnects on ^server_notice "% *Rec??ved KILL message*" { if (index(K $PP.SET.NOTELEVELS) >= 0) { if (!PP.SET.SHORTKILLS) {/echo $1-} { if (match(*.* $10)) {/echo *** Notice -- Received KILL for $strip(. $8) from server $10} {/echo *** Notice -- Received KILL for $strip(. $8) from $10 $13-} } } } on ^server_notice "% *Notice -- Fake:*MODE*" { if (index(F $PP.SET.NOTELEVELS) >= 0) {/echo *** Notice -- Desynched mode change: $5-} if ((match($7 $mychannels()))&&(index(V $PP.SET) >= 0)) {/echo *** $5 is desynched on $7 \(attempted mode change: $8-\)} } on ^server_notice "% *Notice -- Link with*established*" {/if (index(C $PP.SET.NOTELEVELS) >= 0) {/echo $1-}} on ^server_notice "% *Notice -- *unauthorized connection*.*" {/if (index(U $PP.SET.NOTELEVELS) >= 0) {/echo $1-}} on ^server_notice "% *Notice -- *Invalid username*" {/if (index(U $PP.SET.NOTELEVELS) >= 0) {/echo $1-}} on ^server_notice "% *Notice -- Server*closed *connection*" {/if (index(C $PP.SET.NOTELEVELS) >= 0) {/echo $1-}} on ^server_notice "% *Notice -- No response*closing*" {/if (index(C $PP.SET.NOTELEVELS) >= 0) {/echo $1-}} on ^server_notice "% *Notice -- Lost connection*.*" {/if (index(C $PP.SET.NOTELEVELS) >= 0) {/echo $1-}} on ^server_notice "% *Notice -- Write error*.*" {/if (index(C $PP.SET.NOTELEVELS) >= 0) {/echo $1-}} on ^server_notice "% *Notice -- Nick*collision*" {/if (index(N $PP.SET.NOTELEVELS) >= 0) {/echo $1-}} on ^server_notice "% *Notice -- *" {/if (index(M $PP.SET.NOTELEVELS) >= 0) {/echo $1-}} alias pp.sn.querylevels { if (index(K $PP.SET.NOTELEVELS) >= 0) {@ LEVS = [KILLS ]##LEVS} if (index(F $PP.SET.NOTELEVELS) >= 0) {@ LEVS = [FAKES ]##LEVS} if (index(N $PP.SET.NOTELEVELS) >= 0) {@ LEVS = [COLLISIONS ]##LEVS} if (index(U $PP.SET.NOTELEVELS) >= 0) {@ LEVS = [UNAUTHORIZED ]##LEVS} if (index(C $PP.SET.NOTELEVELS) >= 0) {@ LEVS = [CONNECTIONS ]##LEVS} if (index(M $PP.SET.NOTELEVELS) >= 0) {@ LEVS = [MISC ]##LEVS} @ FUNCTION_RETURN = LEVS ^assign -LEVS } alias pp.sn.addlevel {/if (index($0 $NOTELEVELS) < 0) {@ PP.SET.NOTELEVELS = [$0]##PP.SET.NOTELEVELS}} alias pp.sn.rmlevel {@ PP.SET.NOTELEVELS = strip($0 $PP.SET.NOTELEVELS)} alias pp.sn.setlevels { if (match(K* $0)) {^pp.sn.addlevel K} if (match(-K* $0)) {^pp.sn.rmlevel K} if (match(F* $0)) {^pp.sn.addlevel F} if (match(-F* $0)) {^pp.sn.rmlevel F} if (match(COL* $0)) {^pp.sn.addlevel N} if (match(-COL* $0)) {^pp.sn.rmlevel N} if (match(U* $0)) {^pp.sn.addlevel U} if (match(-U* $0)) {^pp.sn.rmlevel U} if (match(CON* $0)) {^pp.sn.addlevel C} if (match(-CON* $0)) {^pp.sn.rmlevel C} if (match(M* $0)) {^pp.sn.addlevel M} if (match(-M* $0)) {^pp.sn.rmlevel M} if ([$0] == [ALL]) {@ PP.SET.NOTELEVELS = [KFNUCM]} if ([$1]) {^pp.sn.setlevels $1-} } alias pp.sn.sks {^if (PP.SET.SHORTKILLS) {@ FUNCTION_RETURN = [ON ]} {@ FUNCTION_RETURN = [OFF]}} alias servnote { if ([$0]) { if ([$0] == [SHORTKILLS]) { if (match($1 ON OFF)) {^if ([$1] == [ON]) {@ PP.SET.SHORTKILLS = 1} {@ PP.SET.SHORTKILLS = 0}} echo *** Shortened kill notices are now $pp.sn.sks() } { ^pp.sn.setlevels $* if ([$0] == 1) {@ PP.SET.NOTELEVELS = [KN]} if ([$0] == 2) {@ PP.SET.NOTELEVELS = [KMNC]} if ([$0] == 3) {@ PP.SET.NOTELEVELS = [KMNCUF]} echo *** Server note display levels: $pp.sn.querylevels() } } { echo *** Current status: echo *** display levels: $pp.sn.querylevels() echo *** short kill notices: $pp.sn.sks() } } # ---------------------------------------------------------------------------- # Netsplit tracker stuff # ---------------------------------------------------------------------------- on ^channel_signoff "% % %.% %.%" {^pp.gotsplit $*} on ^channel_signoff "% % % %.% %.%" {^pp.gotsplit $0 $1 $3-} alias pp.gotsplit { if (!PP.SP[$encode($tolower($2-))]) { @ PP.SP[$encode($tolower($2-))] = [$1 ]##PP.SP[$encode($tolower($2-))] @ PP.SPLITZ[$encode($tolower($2-))] = time() @ PP.SCHANS[$encode($tolower($2-))] = [$0] if (PP.SET.BSP) { @ AA = [$beep] ^set beep on /echo *** Net split [$2-] at $word(3 $stime($time())) ^set beep $AA } {/echo *** Net split [$2-] at $word(3 $stime($time()))} ^timer 240 ^assign -PP.SP[$encode($tolower($2-))] ^timer 240 ^assign -PP.SPLITZ[$encode($tolower($2-))] ^timer 240 ^assign -PP.SCHANS[$encode($tolower($2-))] } {@ PP.SP[$encode($tolower($2-))] = [$1 ]##PP.SP[$encode($tolower($2-))]} if (PP.SET.SHOWSPLITTERS) {/xecho -level CRAP *** Signoff: $1 \($2-\)} } on ^join * { foreach PP.SP AA {^if (match($0 $PP.SP[$AA])) {@ SPLITTER = AA}} if (SPLITTER) { if (PP.SPLITZ[$SPLITTER]) { echo *** Net joined [$decode($SPLITTER)] at $word(3 $stime($time())) ^assign -PP.SPLITZ[$SPLITTER] } ^delword $0 $PP.SP[$SPLITTER] @ PP.SP[$SPLITTER] = NLIST ^assign -NLIST if (!(word(0 $PP.SP[$SPLITTER]))) { ^assign -PP.SP[$SPLITTER] ^assign -PP.SCHANS[$SPLITTER] } ^assign -SPLITTER if (PP.SET.SHOWSPLITTERS) {/xecho -level CRAP *** $0 \($USERHOST()\) has joined channel $1} } {/xecho -level CRAP *** $0 \($USERHOST()\) has joined channel $1} } alias whosplit { echo *** Nick Channel Age of split Servers foreach PP.SP AA { @ CTR = 0 while (word($CTR $PP.SP[$AA])) { @ T3MP = word($CTR $PP.SP[$AA]) if (PP.SPLITZ[$AA]) { @ T2 = time() - PP.SPLITZ[$AA] @ S_AGE = tdiff($T2) echo *** $[9]T3MP $[10]PP.SCHANS[$AA] $[21]S_AGE $decode($AA) } { @ S_AGE = [rejoining] echo *** $[9]T3MP $[10]PP.SCHANS[$AA] $[21]S_AGE $decode($AA) } @ CTR = CTR + 1 } } ^assign -CTR ^assign -T2 ^assign -S_AGE ^assign -T3MP } alias wholeft {/whosplit} # ---------------------------------------------------------------------------- # /users stuff # ---------------------------------------------------------------------------- # Original idea by DrD/Subzero, based on code by Subzero alias pp.syncchan { if ((!SYNCING)&&(!DOINGWHO)) { @ SYNCING = encode($tolower($0)) ^on ^raw_irc "% 352 *" { @ PP.USERS[$WINNUM()][$encode($tolower($3))][$encode($tolower($7))] = [$3 $7 $4@$5] if (match(*@* $8)) { if ((!ischanop($7 $3))&&(!PP.ICWARNED)) { echo *** Warning: your client's ischanop() function is inaccurate \($7 is op, ischanop() reports not op\)\; channel op status on /users lists may be wrong @ PP.ICWARNED = 1 } } { if ((ischanop($7 $3))&&(!PP.ICWARNED)) { echo *** Warning: your client's ischanop() function is inaccurate \($7 is not op, ischanop() reports op\)\; channel op status on /users lists may be wrong @ PP.ICWARNED = 1~ } } } foreach PP.USERS.$WINNUM().$encode($tolower($0)) AA {^assign -PP.USERS[$WINNUM()][$encode($tolower($0))][$AA]} //^who $0 } {@ SYNCNEXT[$rand(9999)] = [$0]} } on ^315 * { if (SYNCING) { ^on raw_irc - "% 352 *" @ DONE1 = 0 @ PP.USYNCED[$SYNCING] = 1 ^assign -SYNCING foreach SYNCNEXT AA { if (!DONE1) { ^timer 1 ^pp.syncchan $SYNCNEXT[$AA] ^assign -SYNCNEXT[$AA] @ DONE1 = 1 } } ^assign -DONE1 } } on #-raw_irc 10 "% JOIN %#*" { if (match(:* $2)) {@ AA = mid(1 1000 $2)} {@ AA = [$2]} if (nickonly($0) == N) {^timer 1 ^pp.syncchan $AA} {@ PP.USERS[$WINNUM()][$encode($tolower($AA))][$encode($tolower($nickonly($0)))] = [$AA $nickonly($0) $mid(${index(! $0)+1} 1000 $0)]} } on #-raw_irc 10 "% PART %#*" { if (match(:* $2)) {@ AA = mid(1 1000 $2)} {@ AA = [$2]} if (nickonly($0) == N) { foreach PP.USERS.$WINNUM().$encode($tolower($AA)) AB {^assign -PP.USERS[$WINNUM()][$encode($tolower($AA))][$AB]} ^assign -PP.USYNCED[$encode($tolower($AA))] } {^assign -PP.USERS[$WINNUM()][$encode($tolower($AA))][$encode($tolower($nickonly($0)))]} } on #-raw_irc 10 "% KICK #*" { if ([$3] == N) { @ AB = encode($tolower($2)) ^foreach PP.USERS.$WINNUM().$AB AA {^assign -PP.USERS[$WINNUM()][$AB][$AA]} ^assign -PP.USYNCED[$AB] } {^assign -PP.USERS[$WINNUM()][$encode($tolower($2))][$encode($tolower($3))]} } on #-raw_irc 10 "% QUIT *" {^foreach PP.USERS.$WINNUM() AA {^assign -PP.USERS[$WINNUM()][$AA][$encode($tolower($nickonly($0)))]}} on #-raw_irc 10 "% NICK *" { @ AB = nickonly($0) foreach PP.USERS.$WINNUM() AA { if (PP.USERS[$WINNUM()][$AA][$encode($tolower($AB))]) { @ AC = PP.USERS[$WINNUM()][$AA][$encode($tolower($AB))] @ PP.USERS[$WINNUM()][$AA][$encode($tolower($strip(: $2)))] = [$word(0 $AC) $strip(: $2) $word(2 $AC)] ^assign -PP.USERS[$WINNUM()][$AA][$encode($tolower($AB))] } } ^assign -AC } alias fwho {/users $*} alias u {/users $*} # /users [<#channel>] [<-chops/-lusers>] [<umask>] alias users { if ((V < 19941016)&&(!PP.UWARNED)) { echo *** Warning: /users may be unreliable on versions of IrcII older than 2.5 @ PP.UWARNED = 1 } @ CHAN = C @ CHOPS = 0 @ LUSERS = 0 @ UMASK = [*!*@*] @ AA = 0 while ([$($AA)]) { if ([$($AA)] == [-chops]) {@ CHOPS = 1} { if ([$($AA)] == [-lusers]) {@ LUSERS = 1} { if (match(*!*@* $($AA))) {@ UMASK = [$($AA)]} { if (ischannel($($AA))) {@ CHAN = [$($AA)]} } } } @ AA = AA + 1 } @ AB = encode($tolower($CHAN)) if (PP.USYNCED[$AB]) { echo Channel Nick Op? User@Host foreach PP.USERS.$WINNUM().$AB AA { if ((CHOPS)||(LUSERS)) { if (CHOPS) {^if (ischanop($decode($AA) $CHAN)) {^pp.auecho $WINNUM() $PP.USERS[$WINNUM()][$AB][$AA]}} if (LUSERS) {^if (!ischanop($decode($AA) $CHAN)) {^pp.auecho $WINNUM() $PP.USERS[$WINNUM()][$AB][$AA]}} } {^pp.auecho $WINNUM() $PP.USERS[$WINNUM()][$AB][$AA]} } } {/echo *** Channel ${CHAN} is not synchronized yet\; if this message persists, leave ${CHAN} and rejoin it} ^assign -CHAN ^assign -CHOPS ^assign -LUSERS ^assign -UMASK } alias pp.auecho {^if (match($UMASK $2!$3)) {^if (ischanop($2 $CHAN)) {/xecho -WINDOW $0 $[12]1 $[9]2 @ $3} {/xecho -WINDOW $0 $[12]1 $[9]2 $3}}} # ---------------------------------------------------------------------------- # Startup message and initialization stuff # ---------------------------------------------------------------------------- # Seed the random number generator EVAL /comment $srand($time()) # Check and make sure no other scripts are running EVAL ^if (TBVERS) {/echo *** Warning: TextBox appears to be loaded. This script shouldn't be loaded on top of other scripts.} EVAL ^if (mylice) {/echo *** Warning: LiCe appears to be loaded. This script shouldn't be loaded on top of other scripts.} EVAL ^if (toolz) {/echo *** Warning: ToolZ appears to be loaded. This script shouldn't be loaded on top of other scripts.} EVAL ^if (ex) {/echo *** Warning: PhoEniX/Djinn appears to be loaded. This script shouldn't be loaded on top of other scripts.} EVAL ^if (gg) {/echo *** Warning: Gargoyle appears to be loaded. This script shouldn't be loaded on top of other scripts.} EVAL ^if (ANTIKILL) {/echo *** Warning: Antikill appears to be loaded. This script shouldn't be loaded on top of other scripts.} # Load a save file if there is one EVAL //^load $PP.SAVEFILE # Make sure we know the home directory EVAL ^if (!(HOME)) {^exec -name GETHOME echo ~} on ^exec "GETHOME %" {/if (match(*/* $1-)) {@ HOME = [$1-]}} ^timer 20 ^on exec - "GETHOME %" # Compile friends/enemies lists ^pp.fr.makelists # Setup CTCP settings ^pp.set.setupctcp # Restore notify list EVAL ^if (PP.SET.NOTIFY) {//^notify $PP.SET.NOTIFY} EVAL ^if (!PP.SET.NOSTARTUP) { echo /-----------------------------------------------------------------------\\;/echo | | echo | _____,---.___,---.___,---.___,---.________,---.___,---.___,---.__ | echo | [_____, _ |: ): , ): ,___:________,: _ , ): |: ___] | echo | |: | |: |: |: ` -': __|. |::`| |: ` | ` -' | echo | |. ,___/. |. |. | |. |: ] |: ,___/: |: |: |: | | echo | | | | | | |: | |. | |. | |. |: | |: | | echo | | | \\____. _]__|. _]__ _] | | \\___|. _]__|. _] | echo | `----' `---' `---' `---' `----' `---' `---'aS | echo | | echo |------------------ -- - __----------------------__ - -- ---------------| EVAL echo | ,~ Version $PPVERS ~, | echo | `_ by Crypt Keeper _' | echo |------------------ -- - ~~----------------------~~ - -- ---------------| EVAL echo | PurePak version $PPVERS now loaded... | echo | Type /pphelp for help. | echo | | echo | Read README.ppk for more information. | echo | PurePak is a package, not just one file. If you are missing any | echo | files, mail ckeeper@axiom.access.one.net for a full copy. | echo \\-----------------------------------------------------------------------/ } # Load modules (the EVAL is for something else, it does nothing here) EVAL ^pp.autoload # Start lag display #EVAL //^quote PRIVMSG $N :LC $time() EVAL ^nick $N EVAL ^if (PP.SET.PMATCH != [.]) {^pp.snm asdf $PP.SET.PMATCH} ^set -input_prompt sleep 2 ^set display on load PurePakDisclaimer