# Hide display of client connects/exits. # Written by Wizzu # Date: 8th Jun 1996 #echo %%% Loading noclients.irc # Features toggle alias clientson {^assign showclients ON} alias clientsoff {^assign -showclients} # Length. Returns lenght of string. #alias length {@function_return = [$rindex($right(1 $0-) $0-)] + 1} alias length {@ string = [$0-];@ function_return = [$@string];^assign -string} # Trim. Drop first and last character from string. alias trim {@ function_return = [$mid(1 ${[$length($0-)] - 2} $0-)]} # IPtrim. Remove [aaa.bbb.ccc.ddd] from nick/hostname, if present. alias iptrim if (index([ $0)>0) {@ function_return = [$left($rindex(\[ $0) $0)]} {@ function_return = [$0]} # Servname. Trim the "xx.xx.dal.net" from server names. From MirclMax. # Modified by Wizzu to check for .dal.net at end of name (so other net # server names won't be affected. alias servname if (match(*.dal.net $0)) { @ function_return = [$left($index(. $0) $0)] } { @ function_return = [$0] } # Client connect on ^server_notice "% % NOTICE -- Client connecting*" if ([$showclients]) { if ([$7]==[port]) { eopnote !N! ${aw}Connect port $8 $9 <$trim($10)> } { eopnote !N! ${aw}Connect: $6 <$trim($7)> } } # Client exit on ^server_notice "% % NOTICE -- Client exiting*" if ([$showclients]) { ^assign enick $6 ^assign eaddr $trim($7) if ([$8]==[[]]) { xecho -level opnote !!! ${aw}Exit: $enick <$eaddr> } { ^assign emsg $trim($8-) if (([$word(2 $emsg)]==[<-])||([$word(4 $emsg)]==[<-])) { xecho -level opnote !!! ${aw}Exit: $enivk <$eadd> (Collision kill) } { if ([$emsg]==[($enick)]) { xecho -level opnote !!! ${aw}Exit: $enick <$eaddr> } { xecho -level opnote !!! ${aw}Exit: $enick <$eaddr> \($emsg\) } } ^assign -emsg } ^assign -enick ^assign -eaddr } # Cannot accept connection on ^server_notice "% % NOTICE -- Cannot accept connections *" if ([$showclients]) { ^assign host $left($index(: $7) $7) ^assign reason $right(${[$length($7-)]-[$index(: $7-)]+1} $7-) xecho -level opnote !!! ${aw}Cannot accept connection at $servname($host) \($reason\) ^assign -reason ^assign -host } # Connect failure on ^server_notice "% % NOTICE -- connect failure: *" if ([$showclients]) { ^assign failed $iptrim($6) ^assign reason $right(${[$length($7-)]-[$rindex(: $7-)]+1} $7-) xecho -level opnote !!! ${aw}Connection failed for $failed \($reason\) ^assign -reason ^assign -failed } # Failed connect attempt on ^server_notice "% % NOTICE -- Failed in connecting to *" if ([$showclients]) { ^assign host $left($index([ $8) $8) ^assign port $strip(]. $right(${[$length($8)]-[$rindex(. $8)]} $8)) ^assign reason $right(${[$length($9-)]-[$rindex(: $9-)]+1} $9-) xecho -level opnote !!! ${aw}Failed connect to $servname($host):$port \($reason\) ^assign -reason ^assign -port ^assign -host } xecho -level crap ### noclients.irc loaded. Usage: ${K}clientson and ${K}clientsoff