%analog_banlist = %(); %analog_colors = %(); $analog_inwhois = false; $analog_inwhowas = false; %analog_colors['blue'] = %( 24 => "-14795911", 25 => "-12295258", 26 => "-8807192" ); %analog_colors['cyan'] = %( 24 => "-15572640", 25 => "-13135471", 26 => "-8787737" ); %analog_colors['green'] = %( 24 => "-15572706", 25 => "-12805044", 26 => "-8787828" ); %analog_colors['mono'] = %( 24 => "-11645619", 25 => "-8290176", 26 => "-3355444" ); %analog_colors['purple'] = %( 24 => "-12053919", 25 => "-9160815", 26 => "-3900952" ); %analog_colors['red'] = %( 24 => "-10415598", 25 => "-6538180", 26 => "-1541767" ); sub ansistr { return buildCP437String($1); } sub ansi { local('$code $str'); $str = ''; foreach $code (@_) { if ($code isa ^Integer) { $str = $str . chr($code); } else { $str = $str . $code; } } return ansistr($str); } sub analog_sort { return (lc($1) cmp lc($2)); } sub analog_prefix { return ansi("\c24", 249, "\c25", 249, "\c26", 249, "\c ") . $1; } sub analog_color { local('$c $key $val'); $c = lc($1); if ($1 eq '') { analog_echo($active, analog_prefix("\c25available color schemes\c21:\c22 " . join(', ', sorta(keys(%analog_colors))))); analog_echo($active, analog_prefix("\c25use \c26/anacolor \c25to change active scheme \c21[\c22" . getProperty('analog.color') . "\c21]")); } else if (%analog_colors[$1]) { foreach $key => $val (%analog_colors[$1]) { setMappedColor($key, $val); } saveColorMap(); setProperty('desktop', -1); setProperty('statusbar', -1); setProperty('window', -1); setProperty('analog.color', $c); analog_echo($active, analog_prefix("\c25switched to color scheme \c21[\c22 $+ $c $+ \c21]")); } else { analog_echo($active, analog_prefix("\c25no such color scheme \c21[\c22 $+ $c $+ \c21]")); } } sub analog_reset { setProperty("desktop.color", "-16777216"); setProperty('statusbar.bgtype', 2); setProperty('statusbar.color', 0); setProperty('ui.sbarlines', 2); setMappedColor(20, "-5263698"); setMappedColor(21, "-11645619"); setMappedColor(22, "-8290176"); setMappedColor(23, "-3355444"); saveColorMap(); setProperty('analog.loaded', 1); setProperty('desktop', -1); setProperty('statusbar', -1); setProperty('window', -1); } alias anacolor { analog_color($1); } alias anareset { analog_reset(); } sub analog_echo { local('$str'); $str = ''; if (-isSetT 'option.timestamp') { $str = parseSet('TIMESTAMP'); } $str = "$str $+ $2"; if (-iswindow $1 || lc($1) eq 'status') { echo($1, $str); } else { echo($str); } } sub analog_scan { local('$chan $user @users @list $str'); if ($me ison $1) { $chan = $1; } else if ($me ison $active) { $chan = $active; } else { return; } @users = @(); addAll(@users, sort(&analog_sort, getOps($chan))); addAll(@users, sort(&analog_sort, getHalfOps($chan))); addAll(@users, sort(&analog_sort, getVoiced($chan))); addAll(@users, sort(&analog_sort, getNormal($chan))); analog_echo($chan, ansi(" \c22", 218, "\c21", 196, "\c24", 196, "\c21[\c26 $chan \c21(\c22", analog_chanmode($chan), "\c21) ]")); $str = ansi(" \c22",192,"\c23",196,196,"\c22",196,"\c23",196,"\c22",196,"\c21",196,196,"\c22",196,"\c21",196); $str = $str . ansi(196,"\c22",196,"\c21",196,"\c25",196,"\c22",196,"\c26",210,"\c25",196,196,"\c23",196,"\c26",196); $str = $str . ansi("\c25",196,"\c22",196,"\c23",196,196,"\c22",196,"\c25",196,"\c22",196,196,"\c21",196,"\c22",196); $str = $str . ansi("\c21",196,"\c22",196,196,"\c21",196,196,196,"\c22",196,"\c21",196,"\c22",196); $str = $str . "\c21[ \c26@\c24" . size(getOps($chan)); $str = $str . " \c26%\c24" . size(getHalfOps($chan)); $str = $str . " \c26+\c24" . size(getVoiced($chan)); $str = $str . " \c26=\c24" . size(getUsers($chan)); $str = $str . " \c21]"; analog_echo($chan, $str); $str = ansi("\c22",218,"\c23",196,196,196,"\c22",196,"\c23",196,"\c22",196,"\c25",196,"\c26",196,196,"\c25",196,196); $str = $str . ansi("\c24",196,"\c25",196,196,"\c21",196,"\c22",196,196,"\c21",196,"\c24",196,"\c25",196,"\c23",196,"\c25",196,"\c26",208); $str = $str . ansi("\c25",196,196,"\c26",196,196,196,196,196,"\c25",196,"\c26",196,196,"\c25",196,"\c24",196); $str = $str . ansi("\c21",196,"\c24",196,"\c25",196,196,"\c22",196,"\c23",196,"\c22",196,"\c23",196,196,"\c22",196,"\c23",196,"\c22",196); $str = $str . ansi(196,196,196,"\c21",196,"\c22",196,"\c21",196,196,"\c22",196,196,196,"\c21",196,196); $str = $str . ansi("\c22",196,"\c23",196,"\c22",196,196,"\c21",196,"\c22",196,"\c21",196,196,196,196,196,196,196,191); analog_echo($chan, $str); @list = @(); foreach $user (@users) { push(@list, "\c26" . analog_usermode($user, $chan) . "\c25" . left("$[9]user", 9)); if (size(@list) == 6) { $str = ansi("\c21", 179); $str = "$str $+ \c21[" . @list[0] . "\c21]"; $str = "$str $+ \c21[" . @list[1] . "\c21]"; $str = "$str $+ \c21[" . @list[2] . "\c21]"; $str = "$str $+ \c21[" . @list[3] . "\c21]"; $str = "$str $+ \c21[" . @list[4] . "\c21]"; $str = "$str $+ \c21[" . @list[5] . "\c21]"; $str = $str . ansi("\c21", 179); analog_echo($chan, $str); @list = @(); } } if (size(@list) > 0) { for ($i = size(@list); $i < 6; $i++) { @list[$i] = ' '; } $str = ansi("\c21", 179); $str = "$str $+ \c21[" . @list[0] . "\c21]"; $str = "$str $+ \c21[" . @list[1] . "\c21]"; $str = "$str $+ \c21[" . @list[2] . "\c21]"; $str = "$str $+ \c21[" . @list[3] . "\c21]"; $str = "$str $+ \c21[" . @list[4] . "\c21]"; $str = "$str $+ \c21[" . @list[5] . "\c21]"; $str = $str . ansi("\c22", 179); analog_echo($chan, $str); } $str = ansi("\c21",192,196,196,196,196,"\c22",196,"\c21",196,"\c22",196,196,"\c23",196,"\c22",196,"\c21",196,196,"\c22",196,196,196,"\c21",196); $str = $str . ansi(196,"\c22",196,"\c21",196,"\c22",196,196,196,196,"\c23",196,"\c22",196,"\c23",196,196,"\c22",196,"\c23",196); $str = $str . ansi("\c22",196,"\c25",196,196,"\c24",196,"\c21",196,"\c24",196,"\c25",196,196,"\c24",196,"\c25",196,"\c26",196,196); $str = $str . ansi("\c25",196,"\c26",196,196,196,196,196,"\c25",196,196,"\c26",196,"\c25",196,"\c22",196,"\c25",196,"\c24",196); $str = $str . ansi("\c21",196,"\c22",196,196,"\c21",196,"\c25",196,196,"\c24",196,"\c25",196,196,"\c26",196,196,"\c25",196,"\c22"); $str = $str . ansi(196,"\c23",196,"\c22",196,"\c23",196,196,196,217); analog_echo($chan, $str); } sub analog_box_head { local('$s'); $s = ansi("\c22",218,"\c23",196,"\c22",196,"\c23",196,"\c22",196,196,"\c21",196,"\c22",196,"\c21",196); $s = "$s $+ \c21[\c25 $1 \c21]"; return $s; } sub analog_box_body { return ansi("\c21",179,"\c20 $1"); } sub analog_box_foot { local('$s'); $s = ansi("\c22",192,"\c23",196,196,"\c22",196,"\c23",196,"\c26",196,196,196,"\c23",196); $s = $s . ansi("\c22",196,"\c23",196,"\c22",196,196,196,196,"\c21",196,"\c22",196,196,"\c21",196); $s = $s . ansi(196,196,196,"\c22",196,"\c25-",196,"\c22",196,"\c21",196,196,196,"\c22-\c21"); $s = $s . ansi(196,"\c22",196,"\c21- -\c22",196,"\c23",196,"\c22",196,"\c21",196,"- -","\c22",196,"\c21- \c22-\c21- -"); return $s; } sub analog_addr { local('$nick $addr $user $host'); ($nick, $addr) = split('!', $1); ($user, $host) = split('@', $addr); return @($nick, $user, $host); } sub analog_chanmode # include limit and key, in respective order { local('$m $mode @modes'); $mode = getMode($1); @modes = split('', $mode); foreach $m (@modes) { if ($m eq 'l') { $mode = "$mode " . getLimit($1); } if ($m eq 'k') { $mode = "$mode " . getKey($1); } } return $mode; } sub analog_usermode { local('$mode'); $mode = getModeFor($1, $2); if ($mode eq $null) { return ' '; } else { return $mode; } } sub analog_version { local('$ver'); $ver = systemProperties()['os.name'] . ' ' . systemProperties()['os.version']; $ver = "$ver : jircii!" . versionString(); $ver = "$ver + analog.irc[" . lc(left(getProperty('analog.color'), 1)) . "]"; $ver = "$ver : vote for pedro!"; return $ver; } sub analog_sv { if ($1 eq '') { if ($active eq '') { echo(analog_version()); } else { sendMessage($active, analog_version()); } } else { sendMessage($1, analog_version()); } } alias sc { analog_scan($1-); } alias scan { analog_scan($1-); } alias sv { analog_sv($1-); } alias sver { analog_sv($1-); } alias server { if ($1 eq $null) { call('server ' . getServerHost() . ' ' . getServerPort(), 1); } else { call("server $1-", 1); } } on REQUEST { if (lc($1) eq 'version') { sendReply($nick, 'VERSION', analog_version()); if (-isSetT 'active.ctcp') { analog_echo($active, parseSet('CTCP_REQUEST', %localData)); } else { analog_echo('status', parseSet('CTCP_REQUEST', %localData)); } halt; } } on REPL_366 { if ($me ison $1) { analog_scan($1); } } set CHANNEL_NAMES { return; } set FORMATTED_NAMES_HEADER { return; } set FORMATTED_NAMES { return; } set IRC_CONNECT { return; } set REPL_001 { return analog_prefix("\c20 $+ $1-"); } set REPL_002 { return analog_prefix("\c20 $+ $1-"); } set REPL_003 { return analog_prefix("\c20 $+ $1-"); } set REPL_004 { return analog_prefix("\c20 $+ $1-"); } set REPL_005 { return analog_prefix("\c20 $+ $1-"); } set REPL_211 { return analog_prefix("\c20 $+ $1-"); } set REPL_212 { return analog_prefix("\c20 $+ $1-"); } set REPL_213 { return analog_prefix("\c20 $+ $1-"); } set REPL_214 { return analog_prefix("\c20 $+ $1-"); } set REPL_215 { return analog_prefix("\c20 $+ $1-"); } set REPL_216 { return analog_prefix("\c20 $+ $1-"); } set REPL_218 { return analog_prefix("\c20 $+ $1-"); } set REPL_219 { return analog_prefix("\c25end of /stats \c21[\c22 $+ $1 $+ \c21]"); } set REPL_221 { return analog_prefix("\c25your usermode is \c21[\c22 $+ $1- $+ \c21]"); } set REPL_242 { return analog_prefix("\c20 $+ $1-"); } set REPL_243 { return analog_prefix("\c20 $+ $1-"); } set REPL_244 { return analog_prefix("\c20 $+ $1-"); } set REPL_249 { return analog_prefix("\c20 $+ $1-"); } set REPL_250 { return analog_prefix("\c20 $+ $1-"); } set REPL_251 { return analog_prefix("\c20 $+ $1-"); } set REPL_252 { return analog_prefix("\c20 $+ $1-"); } set REPL_253 { return analog_prefix("\c20 $+ $1-"); } set REPL_254 { return analog_prefix("\c20 $+ $1-"); } set REPL_255 { return analog_prefix("\c20 $+ $1-"); } set REPL_256 { return analog_prefix("\c25 $+ $1- $+ \c21:"); } set REPL_257 { return "\c20 $1-"; } set REPL_258 { return "\c20 $1-"; } set REPL_259 { return "\c20 $1-"; } set REPL_262 { return analog_prefix("\c25end of trace \c21[\c22 $+ $1 $+ \c21]"); } set REPL_265 { return analog_prefix("\c20 $+ $3-"); } set REPL_266 { return analog_prefix("\c20 $+ $3-"); } set REpL_302 { return analog_prefix("\c25 $+ $1-"); } set REPL_305 { return analog_prefix("\c25you are no longer away"); } set REPL_306 { return analog_prefix("\c25you are now away"); } set REPL_341 { return analog_prefix("\c26 $+ $2 \c25has been invited to\c25 $1"); } set REPL_351 { return analog_prefix("\c20 $+ $1-"); } set REPL_353 { return; } set REPL_364 { return analog_prefix("\c25 $+ $[20]1 \c21->\c25 $[20]2 \c21[\c23 $+ $3 \c22hop(s)\c21]:\c20 $4-"); } set REPL_365 { return analog_prefix("\c25end of /links"); } set REPL_366 { return; } set REPL_371 { return "\c20 $1-"; } set REPL_372 { return "\c20 $1-"; } set REPL_374 { return analog_prefix("\c25end of /info"); } set REPL_375 { return analog_prefix("\c25 $+ $1-"); } set REPL_376 { return analog_prefix("\c25 $+ $1-"); } set REPL_381 { return analog_prefix("\c25 $+ $1-"); } set REPL_391 { return analog_prefix("\c26 $+ $1 \c25local time\c21:\c22 $2-"); } set REPL_401 { return analog_prefix("\c25no such nick/channel \c21[\c22 $+ $1 $+ \c21]"); } set REPL_402 { return analog_prefix("\c25no such server \c21[\c22 $+ $1 $+ \c21]"); } set REPL_403 { return analog_prefix("\c25no such channel \c21[\c22 $+ $1 $+ \c21]"); } set REPL_404 { return analog_prefix("\c25cannot send to channel \c21[\c22 $+ $1 $+ \c21]"); } set REPL_405 { return analog_prefix("\c25you're on too many channels \c21[\c22 $+ $1 $+ \c21]"); } set REPL_406 { return analog_prefix("\c25there was no such user \c21[\c22 $+ $1 $+ \c21]"); } set REPL_407 { return analog_prefix("\c25 $+ $2- \c21[\c22 $+ $1 $+ \c21]"); } set REPL_413 { return analog_prefix("\c25 $+ $2- \c21[\c22 $+ $1 $+ \c21]"); } set REPL_414 { return analog_prefix("\c25 $+ $2- \c21[\c22 $+ $1 $+ \c21]"); } set REPL_421 { return analog_prefix("\c26error\c21: \c25stupid command \c21[\c23/\c22" . lc($1) . "\c21]"); } set REPL_423 { return analog_prefix("\c25 $+ $2- \c21[\c22 $+ $1 $+ \c21]"); } set REPL_431 { return analog_prefix("\c25no nickname given"); } set REPL_432 { return analog_prefix("\c25erroneous nickname \c21[\c22 $+ $1 $+ \c21]"); } set REPL_433 { return analog_prefix("\c25nickname already in use \c21[\c22 $+ $1 $+ \c21]"); } set REPL_436 { return analog_prefix("\c25 $+ $2- \c21[\c22 $+ $1 $+ \c21]"); } set REPL_442 { return analog_prefix("\c25not on channel \c21[\c22 $+ $1 $+ \c21]"); } set REPL_443 { return analog_prefix("\c26 $+ $1 \c25is already on channel \c21[\c22 $+ $2 $+ \c21]"); } set REPL_444 { return analog_prefix("\c25user is not logged in \c21[\c22 $+ $1 $+ \c21]"); } set REPL_461 { return analog_prefix("\c25not enough parameters \c21[\c23/\c22" . lc($1) . "\c21]"); } set REPL_467 { return analog_prefix("\c25channel key already set \c21[\c22 $+ $1 $+ \c21]"); } set REPL_471 { return analog_prefix("\c25channel limit reached \c21[\c22 $+ $1 $+ \c21]"); } set REPL_472 { return analog_prefix("\c25unknown mode \c21[\c22 $+ $1 $+ \c21]"); } set REPL_473 { return analog_prefix("\c25you're not invited \c21[\c22 $+ $1 $+ \c21]"); } set REPL_474 { return analog_prefix("\c25banned from channel \c21[\c22 $+ $1 $+ \c21]"); } set REPL_475 { return analog_prefix("\c25need correct key to join channel \c21[\c22 $+ $1 $+ \c21]"); } set REPL_477 { return analog_prefix("\c25need registered nick to join channel \c21[\c22 $+ $1 $+ \c21]"); } set REPL_481 { return analog_prefix("\c26error\c21: \c25you're not an ircop. nice try!"); } set REPL_482 { return analog_prefix("\c25need channel ops \c21[\c22 $+ $1 $+ \c21]"); } set REPL_483 { return analog_prefix("\c25 $+ $1-"); } set REPL_491 { return analog_prefix("\c25no o-line for you!"); } set REPL_501 { return analog_prefix("\c25unknown mode flag(s)"); } set REPL_704 { return analog_prefix("\c25 $+ $2-"); } set REPL_705 { return "\c20 $2-"; } set REPL_706 { return analog_prefix("\c25end of help \c21[\c22 $+ $1 $+ \c21]"); } set REPL_321 { analog_echo('status', analog_box_head("\c25listing channels")); analog_echo('status', analog_box_body("\c23 channel\c21: \c23users\c21: \c23topic\c21:")); return; } set REPL_322 { analog_echo('status', analog_box_body("\c21[\c25 $+ $[16]1 $+ \c21] [\c26 $+ $[6]2 $+ \c21]\c22 $3-")); return; } set REPL_323 { analog_echo('status', analog_box_foot()); return; } set REPL_352 { local('$chan $user $host $server $nick $modes $hops $name $cmode $away $oper $mode'); $chan = $1; $user = $2; $host = $3; $server = $4; $nick = $5; $modes = $6; $hops = $7; $name = $8-; $away = 'here'; $oper = 'not an oper'; $cmode = ''; foreach $mode (split('', $modes)) { if (lc($mode) eq 'g') { $away = 'away'; } else if (lc($mode) eq 'h') { $away = 'here'; } else if (lc($mode) eq '*') { $oper = 'an oper'; } else if ($mode ne '') { $cmode = $mode; } } return analog_prefix("\c26 $+ $cmode $+ \c25 $+ $nick \c21(\c24 $+ $user $+ \c25@\c24 $+ $host $+ \c21)\c25 is \c21'\c22 $+ $name $+ \c21' (\c24 $+ $away $+ \c21)\c25 on\c26 $server \c21(\c23 $+ $hops \c22hop(s) away\c21) -\c22 $oper"); } set REPL_315 { return analog_prefix("\c25end of /who \c21[\c22 $+ $1 $+ \c21]"); } sub analog_whois { return ansi("\c21",179,' ',179,"\c25 $[8]1 \c21",179,"\c20 $2"); } set REPL_301 { if ($analog_inwhois) { return analog_whois('away', $2-); } else { return analog_prefix("\c26 $+ $1 \c25is away \c21[\c20 $+ $2- $+ \c21]"); } } set REPL_307 { return analog_whois('register', "\c23 $+ $1 \c22 $+ $2-"); } set REPL_310 { return analog_whois('help', "\c23 $+ $1 \c22 $+ $2-"); } set REPL_311 { local('$s'); $analog_inwhois = true; $s = ansi(" \c23",218,196,"\c22",196,"\c21",196,"[\c26 $1 \c21(\c24 $+ $2 $+ \c25@\c24 $+ $3 $+ \c21) ]"); analog_echo($active, $s); $s = ansi("\c23",218,196,"\c22",196,"\c23",196,196,196,"\c26",196,196,196,196,"\c22",196,"\c26",196,196,"\c22",196,196,196,196,"\c25",196,"\c22",196,"\c25",196,196,196,196,196,"\c24",196,196,"\c25",196,"\c24",196,196,196,"\c21",196,"\c24",196,"\c21",196,196,196,"\c22",196,"\c21",196,"\c22",196,196,196,196,"\c23",196"\c22",196,"\c23",196,"\c22",196,196,"\c21",196,"\c22",196,"\c21",196,196,196,"-"); analog_echo($active, $s); return ansi("\c22",179,' ',179,"\c25 name \c21|\c20 $5-"); } set REPL_312 { if ($analog_inwhois) { return analog_whois('server', "\c23 $+ $2 \c21(\c22 $+ $3- $+ \c21)"); } else if ($analog_inwhowas) { return analog_prefix("\c26 $+ $1 \c25was using server\c26 $2 \c21[\c22signed on\c23 $3- $+ \c21]"); } else { return analog_prefix("\c26 $+ $1 \c25is using server\c26 $2 \c21[\c22 $+ $3- $+ \c21]"); } } set REPL_313 { return analog_whois('operator', "\c23 $+ $1 \c22 $+ $2-"); } set REPL_317 { return analog_whois('idle', formatTime3($2)); } set REPL_318 { local('$s'); if ($analog_inwhois) { $analog_inwhois = false; $s = ansi("\c22",179,' ',"\c23",192,196,196,196,"\c26",196,196,196,196,"\c22",196,"\c26",196,196,"\c22",196,196,196,196,"\c25",196,"\c22",196,"\c25",196,196,196,196,196,"\c24",196,196,"\c25",196,"\c24",196,196,196,"\c21",196,"\c24",196,"\c21",196,196,196,"\c22",196,"\c21",196,"\c22",196,196,196,196,"\c23",196"\c22",196,"\c23",196,"\c22",196,196,"\c21",196,"\c22",196,"\c21",196,196,196,"-"); analog_echo($active, $s); return ansi("\c23",192,196,196,"\c22",196,"\c23",196,"\c22",196,196,"\c21",196,"\c22",196,"\c21",196,196,"\c22",196,196,"\c23",217); } } set REPL_319 { local('$c $s'); foreach $c (split(" ", $2-)) { if (strlen($c) > 0 && charAt($c, 0) ne "#" && charAt($c, 0) ne "&") { $c = "\c23" . charAt($c, 0) . "\c22" . substr($c, 1, strlen($c)); } $s = "$s $+ \c22 $+ $c "; } return analog_whois('channels', $s); } set REPL_320 { return analog_whois('secure', "\c23 $+ $1 \c22 $+ $2-"); } set REPL_330 { return analog_whois('register', "\c23 $+ $1 \c22 $+ $3- \c21(\c22 $+ $2 $+ \c21)"); } set REPL_338 { return analog_whois('host', $2); } set REPL_378 { return analog_whois("mask/ip", $5-); } set REPL_379 { return analog_whois('modes', $5-); } set REPL_671 { return analog_whois('secure', "\c23 $+ $1 \c22 $+ $2-"); } set REPL_703 { return analog_whois('codepage', "\c23 $+ $2 \c22 $+ $3-"); } set REPL_314 { $analog_inwhowas = true; return analog_prefix("\c26 $+ $1 \c21(\c24 $+ $2 $+ \c25@\c24 $+ $3 $+ \c21)\c25 was \c21'\c20 $+ $5- $+ \c21'"); } set REPL_369 { $analog_inwhowas = false; return; } set NUMERIC { if (charAt($1, 0) eq '#' || charAt($1, 0) eq '&') { return analog_prefix("\c25 $+ $1 $+ \c21:\c20 $2-"); } return analog_prefix("\c20 $+ $1-"); } set TIMESTAMP { return formatDate("\c21HH\c22:\c21mm\c22:\c21ss "); } set PROCESS_DATA { return "\c20 $parms"; } set IDENT_REQUEST { return analog_prefix("\c25Received ident request from\c26 $0"); } set IRC_ATTEMPT_CONNECT { return analog_prefix("\c25Connecting to\c26 " . getServerHost() . "\c21:\c26" . getServerPort() . "\c21..."); } set IRC_DISCONNECT { return analog_prefix("\c25Lost connection to\c26 " . getServerHost() . "\c24:\c26" . getServerPort() . " \c21[\c22 $+ $parms $+ \c21]"); } set IRC_RECONNECT { return analog_prefix("\c25Reconnecting to\c26 $1 $+ \c21..."); } set SERVER_ERROR { return analog_prefix("\c25 $+ $parms"); } set SET_IGNORE { if (lc($0) == 'add') { return analog_prefix("\c25added\c26 $1 \c25to ignore list"); } else { return analog_prefix("\c25removed\c26 $1 \c25from ignore list"); } } set SET_NOTIFY { if (lc($0) eq 'add') { return analog_prefix("\c25added\c26 $1 \c25to notify list"); } else { return analog_prefix("\c25removed\c26 $1 \c25from notify list"); } } set NOTIFY_SIGNON { return analog_prefix("\c26notify\c21:\c26 $nick \c21(\c24 $+ $user $+ \c25@\c24 $+ $host $+ \c21)\c25 has signed on"); } set NOTIFY_SIGNOFF { return analog_prefix("\c26notify\c21:\c26 $nick \c21(\c24 $+ $user $+ \c25@\c24 $+ $host $+ \c21)\c25 has signed off"); } set JOIN_SYNC { return analog_prefix("\c26 $+ $1 \c25sync completed in\c26 $sync \c25sec"); } set CHANNEL_CREATED { return analog_prefix("\c26 $+ $1 \c25created\c26 $created"); } set CHANNEL_MODE_IS { return analog_prefix("\c26 $+ $1 \c25mode is\c21:\c22 $parms"); } set CHANNEL_TOPIC_IS { return analog_prefix("\c26 $+ $0 \c25topic is\c21:\c22 $parms"); } set CHANNEL_TOPIC_SETBY { return analog_prefix("\c26 $+ $1 \c25topic set by\c21:\c22 $nick \c21(\c22 $+ $seton $+ \c21)"); } set INVITE { return analog_prefix("\c26 $+ $nick \c21(\c24 $+ $user $+ \c25@\c24 $+ $host $+ \c21)\c25 invited you to\c26 $parms"); } set ON_CHANNELS { return analog_prefix("\c25open channels\c21:\c22 $parms"); } set CHANNEL_JOIN { if ($nick eq $me) { return analog_prefix("\c25joined conversation in\c26 $target"); } else { return analog_prefix("\c26 $+ $nick \c21(\c24 $+ $user $+ \c25@\c24 $+ $host $+ \c21)\c25 has joined\c26 $target"); } } set CHANNEL_KICK { if ($1 eq $me) { return analog_prefix("\c26you \c21(\c26 $+ $me $+ \c21)\c25 were kicked from\c26 $target \c25by\c26 $nick \c21[\c20 $+ $2- $+ \c21]"); } else { return analog_prefix("\c26 $+ $1 \c25was kicked from\c26 $target \c25by\c26 $nick \c21[\c20 $+ $2- $+ \c21]"); } } set CHANNEL_MODE { return analog_prefix("\c26 $+ $nick \c25set\c26 $target \c25mode \c21[\c22 $+ $parms $+ \c21]"); } set CHANNEL_PART { return analog_prefix("\c26 $+ $nick \c21(\c24 $+ $user $+ \c25@\c24 $+ $host $+ \c21)\c25 has left\c26 $target \c21[\c20 $+ $parms $+ \c21]"); } set CHANNEL_TOPIC_CHANGED { if ($parms eq '') { return analog_prefix("\c26 $+ $nick \c25erased\c26 $target \c25topic"); } else { return analog_prefix("\c26 $+ $nick \c25changed\c26 $target \c25topic \c21[\c20 $+ $parms $+ \c21]"); } } set USER_NICK { return analog_prefix("\c26 $+ $nick \c25changed nickname to\c26 $parms"); } set USER_QUIT { return analog_prefix("\c26 $+ $nick \c21(\c24 $+ $user $+ \c25@\c24 $+ $host $+ \c21)\c25 signed off \c21[\c20 $+ $parms $+ \c21]"); } set USER_MODE { return analog_prefix("\c26 $+ $source \c25set\c26 $target \c25mode \c21[\c22 $+ $parms $+ \c21]"); } set CHANNEL_BANLIST { local('$nick $user $host $when'); if (%analog_banlist[$1] != 1) { %analog_banlist[$1] = 1; analog_echo($1, analog_box_head("\c25ban list for\c26 $1")); analog_echo($1, analog_box_body(" \c23set by\c21:\c23 when\c21:\c23 ban mask\c21:")); } $when = timeDateStamp($4); ($nick, $user, $host) = analog_addr($3); return analog_box_body("\c21[\c26" . left("$[9]nick", 9) . "\c21] [\c24 $+ $[25]when $+ \c21] [\c25 $+ $[30]2 $+ \c21]"); } set CHANNEL_BANLIST_END { if (%analog_banlist[$1] == 1) { %analog_banlist[$1] = $null; return analog_box_foot(); } else { %analog_banlist[$1] = $null; return analog_prefix("\c25no bans set on\c26 $1"); } } set CHANNEL_TEXT { return "\c26" . analog_usermode($nick, $target) . "\c21[\c24 $+ $[9]nick $+ \c21]\c20 $1-"; } set CHANNEL_TEXT_INACTIVE { return "\c26" . analog_usermode($nick, $target) . "\c21[\c24 $+ $[9]nick $+ \c21: $+ $target $+ ]\c20 $1-"; } set SEND_TEXT { return "\c26" . analog_usermode($me, $target) . "\c21[\c25 $+ $[9]me $+ \c21]\c20 $1-"; } set SEND_TEXT_INACTIVE { return "\c26" . analog_usermode($me, $target) . "\c21[\c25 $+ $[9]me $+ \c21: $+ $target $+ ]\c20 $1-"; } set ACTION { local('$mode'); $mode = analog_usermode($nick, $target); if ($mode eq ' ') { $mode = '>'; } return "\c24 $+ $mode $nick $1-"; } set ACTION_INACTIVE { local('$mode'); $mode = analog_usermode($nick, $target); if ($mode eq ' ') { $mode = '*'; } return "\c24 $+ $mode $nick $+ \c21: $+ $target \c24 $+ $1-"; } set PRIVMSG { if (-iswindow $target) { return "\c21[\c24 $+ $[9]nick $+ \c21]\c20 $parms"; } else { return "\c21(\c26 $+ $nick $+ \c21[\c24 $+ $user $+ \c25@\c24 $+ $host $+ \c21])\c20 $parms"; } } set PRIVACTION { if (-iswindow $target) { return "\c24> $nick $parms"; } else { return "\c21(\c26 $+ $nick $+ \c21[\c24 $+ $user $+ \c25@\c24 $+ $host $+ \c21]) \c25> $nick $parms"; } } set NOTICE { if ($nick eq $server) { return "\c21-\c26 $+ $nick $+ \c21(\c24*\c25@\c24*\c21)-\c20 $parms"; } else { return "\c21-\c26 $+ $nick $+ \c21(\c24 $+ $user $+ \c25@\c24 $+ $host $+ \c21)-\c20 $parms"; } } set CTCP_REQUEST { local('$targ'); if ($target eq $me) { $targ = 'you'; } else { $targ = $target; } return analog_prefix("\c26 $+ $nick \c21(\c24 $+ $user $+ \c25@\c24 $+ $host $+ \c21)\c25 requested ctcp \c21[\c20 $+ $parms $+ \c21]\c25 from\c26 $targ"); } set CTCP_REPLY { return analog_prefix("\c25received ctcp\c26 $type \c25reply from\c26 $nick \c21[\c20 $+ $2- $+ \c21]"); } set SEND_MSG { if (-iswindow $target) { return "\c21[\c25 $+ $[9]me $+ \c21]\c20 $parms"; } else { return "\c24-\c25> \c21(\c25msg\c21/\c26 $+ $target $+ \c21)\c20 $parms"; } } set SEND_ACTION { local('$mode'); if ($me ison $target) { $mode = analog_usermode($me, $target); } else { if (-iswindow $target) { $mode = '>'; } else { return "\c24-\c25> \c21(\c25msg\c21/\c26 $+ $target $+ \c21)\c22 $parms"; } } if ($mode eq ' ') { $mode = '>'; } return "\c25 $+ $mode $me $1-"; } set SEND_ACTION_INACTIVE { local('$mode'); $mode = analog_usermode($me, $target); if ($mode eq ' ') { $mode = '>'; } return "\c25 $+ $mode $me $+ \c21: $+ $target \c25 $+ $1-"; } set SEND_CTCP { return "\c24-\c25> \c21(\c25ctcp\c21/\c26 $+ $target $+ \c21)\c20 $type $parms"; } set SEND_NOTICE { return "\c24-\c25> \c21(\c25notice\c21/\c26 $+ $target $+ \c21)\c20 $parms"; } set SEND_WALL { return "\c24-\c25> \c21(\c25wall\c21/\c26 $+ $target $+ \c21)\c20 $parms"; } set SEND_WALLEX { return "\c24-\c25> \c21(\c25wall\c26ex\c21/\c26 $+ $target $+ \c21)\c20 $parms"; } set SBAR_LEFT { local('$s'); $s = ''; if ($line == 0) { if ($me ison $query) { $s = "\c26" . getModeFor($me, $query) . "\c25 $+ $query"; $s = "$s \c21(\c23" . getMode($query) . "\c21) ]"; $s = ansi("$s", 196, "\c22", 196, 196, "\c23", 196, "\c22", 196, "\c21", 196, "["); $s = "$s \c26@\c24" . size(getOps($query)); $s = "$s \c26%\c24" . size(getHalfOps($query)); $s = "$s \c26+\c24" . size(getVoiced($query)); $s = "$s \c26=\c24" . size(getUsers($query)); } else if ($query ne '') { $s = "query\c21:\c25 $query"; } else { $s = "hello :)"; } return ansi("\c24", 214, "\c25", 194, "\c24", 196, "\c21[\c22 $s \c21]\c"); } else if ($line == 1) { if (isServerConnected()) { $s = "\c25 $+ $me \c21(\c23 $+ $mymode $+ \c21) ]"; $s = ansi("$s", 196, "\c22", 196, "\c23", 196, "\c22", 196, 196, "\c21", 196, "["); $s = "$s \c22" . getServerHost() . "\c21:\c22" . getServerPort(); } else { $s = "not connected"; } return ansi("\c24", 186, "\c25", 192, 196, "\c22", 196, "\c23", 196, "\c22", 196, "\c21", 196, "\c21[\c22 $s \c21]\c"); } } set SBAR_RIGHT { local('$stamp'); $stamp = lc(formatDate("\c23h\c21:\c23mm\c22")); $stamp = $stamp . lc(left(formatDate('a'), 1)); setWindowPrompt($window, ansi("\c24", 211, "\c25-\c26>\c22 ")); if ($line == 0) { return ansi("\c21[\c25 lag\c21:\c26 $lag \c21]", 196, "\c22", 196, "\c21", 196, "[\c23 $stamp \c21]", 196, "\c22", 196, "\c21", 196, "\c24", 196, "\c25", 196, "\c24", 183); } else if ($line == 1) { return ansi("\c21[\c24 a\c25n\c26al\c25o\c24g\c21.\c22i\c23r\c22c\c21[\c25" . left(lc(getProperty('analog.color')), 1) . "\c21] ]", 196, "\c25", 196, "\c24", 189); } } set NICKLIST_FORMAT { local('$s'); if ($nick eq $me) { if (-isidle $nick) { $s = "\c25 $+ $nick"; } else { $s = "\c26 $+ $nick"; } return "\c23" . analog_usermode($nick, $channel) . $s; } else if (-isidle $nick) { $s = "\c24 $+ $nick"; } else { $s = "\c25 $+ $nick"; } return "\c26" . analog_usermode($nick, $channel) . $s; } set RESOLVED_HOST { local('$answer $question'); if ($parms eq '') { return analog_prefix("\c25unable to resolve\c26 $data"); } else { ($answer, $question) = split(' ', $parms, 2); return analog_prefix("\c25resolved\c26 $question \c25to\c26 $answer"); } } set RESOLVED_LOCALINFO { return analog_prefix("\c25resolved localhost to\c26 $0"); } set CHATMSG { if (-iswindow "= $+ $nick") { return "\c21[\c24 $+ $[9]nick $+ \c21]\c20 $parms"; } else { return "\c21(\c26 $+ $nick $+ \c21[\c24dcc\c25@\c24*\c21])\c20 $parms"; } } set CHAT_OPEN { return analog_prefix("\c25opened dcc chat with\c26 $nick"); } set CHAT_CLOSE { return analog_prefix("\c25closed dcc chat with\c26 $nick \c21[\c22 $+ $1- $+ \c21]"); } set SEND_CHAT { if (-iswindow "= $+ $target") { return "\c21[\c25 $+ $[9]me $+ \c21]\c20 $parms"; } else { return "\c24-\c25> \c21(\c25chat\c21/\c23=\c26 $+ $target $+ \c21)\c20 $parms"; } } set SEND_CHAT_ERROR { return analog_prefix("\c25no chat with\c26 $target \c24- \c25cannot send message \c21[\c22 $+ $parms $+ \c21]"); } set SEND_DCC { if (lc($1) eq 'chat') { return "\c24-\c25> \c21(\c25dcc\c21/\c26 $+ $0 $+ \c21)\c20 $parms"; } else { return "\c24-\c25> \c21(\c25dcc\c21/\c26 $+ $0 $+ \c21)\c20 $1 $4-"; } } set DCC_REQUEST { local('$s'); if (lc($2) eq 'chat') { $s = "CHAT $5"; } else if (lc($2) eq 'send') { $s = "SEND $3"; } else { $s = $2; } return analog_prefix("\c26 $+ $nick \c21(\c24 $+ $user $+ \c25@\c24 $+ $host $+ \c21)\c25 requested dcc \c21[\c20 $+ $s $+ \c21]"); } set SEND_START { local('$dcc'); $dcc = getDCCConnection($this); return analog_prefix("\c25dcc send \c21[\c22" . getDCCFileName($dcc) . "\c21]\c25 to\c26 $nick \c25started"); } set SEND_COMPLETE { local('$dcc'); $dcc = getDCCConnection($this); return analog_prefix("\c25dcc send \c21[\c22" . getDCCFileName($dcc) . "\c21]\c25 to\c26 $nick \c25completed \c21[\c22" . getDCCTransferRate($dcc) . "\c21]"); } set SEND_FAILED { local('$dcc'); $dcc = getDCCConnection($this); return analog_prefix("\c25dcc send \c21[\c22" . getDCCFileName($dcc) . "\c21]\c25 to\c26 $nick \c25failed \c21[\c22 $+ $parms $+ \c21]"); } set RECEIVE_START { local('$dcc'); $dcc = getDCCConnection($this); return analog_prefix("\c25dcc receive \c21[\c22" . getDCCFileName($dcc) . "\c21]\c25 from\c26 $nick \c25started"); } set RECEIVE_COMPLETE { local('$dcc'); $dcc = getDCCConnection($this); return analog_prefix("\c25dcc receive \c21[\c22" . getDCCFileName($dcc) . "\c21]\c25 from\c26 $nick \c25completed \c21[\c22" . getDCCTransferRate($dcc) . "\c21]"); } set RECEIVE_FAILED { local('$dcc'); $dcc = getDCCConnection($this); return analog_prefix("\c25dcc receive \c21[\c22" . getDCCFileName($dcc) . "\c21]\c25 from\c26 $nick \c25failed \c21[\c22 $+ $parms $+ \c21]"); } set RESUME_REQUEST { local('$dcc'); $dcc = getDCCConnection($this); return analog_prefix("\c25dcc resume \c21[\c22" . getDCCFileName($dcc) . "\c21]\c25 requested from\c26 $nick"); } set RESUME_REQUEST_ERROR { local('$dcc'); $dcc = getDCCConnection($this); return analog_prefix("\c25dcc resume \c21[\c22" . getDCCFileName($dcc) . "\c21]\c25 from\c26 $nick \c25failed \c21[\c22 $+ $parms $+ \c21]"); } set RESUME_SUCCEEDED { local('$dcc'); $dcc = getDCCConnection($this); return analog_prefix("\c25dcc resume \c21[\c22" . getDCCFileName($dcc) . "\c21]\c25 to\c26 $nick \c25succeeded"); } set RESUME_FAILED { local('$dcc'); $dcc = getDCCConnection($this); return analog_prefix("\c25dcc resume \c21[\c22" . getDCCFileName($dcc) . "\c21]\c25 to\c26 $nick \c25failed \c21[\c22 $+ $parms $+ \c21]"); } sub analog_dccinfo { local('$dcc'); $dcc = $1; if (!-isdccopen $dcc) { return "\c26Waiting..."; } if (lc(getConnectionType($dcc)) eq 'chat') { return "\c26Idle\c21:\c22 " . formatTime3(getDCCIdleTime($dcc) / 1000); } else { return "\c26" . getDCCFileName($dcc) . " \c21[\c22" . formatBytes(getDCCSizeSoFar($dcc)) . " \c21@\c22 " . formatBytes(getTransferRate($dcc)) . "\c21/\c22s \c21(\c22" . getDCCPercentage($dcc) . "\r%\r\c21)] \c25Est\c21:\c22 " . formatTime3(getTimeRemaining($dcc)); } } set DCC_LIST_NICK { return "\c25" . getDCCNickname(getDCCConnection($this)); } set DCC_LIST_TYPE { return "\c25" . getConnectionType(getDCCConnection($this)); } set DCC_LIST_INFORMATION { return analog_dccinfo(getDCCConnection($this)); } alias dcc { local('$dcc $type $nick'); if ($1 ne '') { call("$0 $1-", 1); return; } if (size(getActiveConnections()) == 0) { analog_echo($active, analog_prefix("\c25no active dcc connections")); return; } analog_echo($active, analog_box_head("\c25listing active connections")); analog_echo($active, analog_box_body("\c23type\c21:\c23 nick\c21:\c23 information\c21:")); foreach $dcc (getActiveConnections()) { $type = lc(getConnectionType($dcc)); $nick = getDCCNickname($dcc); analog_echo($active, analog_box_body("\c21[\c25 $+ $[7]type $+ \c21] [\c26 $+ $[9]nick $+ \c21] [" . analog_dccinfo($dcc) . "\c21]")); } analog_echo($active, analog_box_foot()); } alias notify { local('$out $user'); if ($1 ne '') { call("$0 $1-", 1); return; } if (size(getSignedOnUsers()) == 0) { analog_echo($active, analog_prefix("\c25nobody in your notify list is online")); return; } $out = ''; foreach $user (getSignedOnUsers()) { if (onlineFor($user) < 300) { $out = "$out \c23 $+ $user"; } else if (onlineFor($user) < (60 * 60)) { $out = "$out \c22 $+ $user"; } else { $out = "$out \c21 $+ $user"; } } analog_echo($active, analog_prefix("\c25users signed on\c21:")); analog_echo($active, " $out"); if (size(getSignedOffUsers()) == 0) { analog_echo($active, analog_prefix("\c25nobody in your notify list is offline")); return; } $out = ''; foreach $user (getSignedOffUsers()) { $out = "$out $user"; } analog_echo($active, analog_prefix("\c25users signed off\c21:")); analog_echo($active, "\c22 $out"); } on UNLOAD { local('$id $i $win'); $id = getActiveSessionId(); for ($i = 0; $i < getTotalSessions(); $i++) { activateSession($i); foreach $win (getWindows()) { setWindowPrompt($win, ''); } } activateSession($id); setProperty('analog.loaded', ''); } if (getProperty('analog.loaded') eq '') { analog_reset(); if (getProperty('analog.color') eq '') { analog_color('blue'); } else { analog_color(getProperty('analog.color')); } analog_echo($active, analog_prefix("\c25loaded \c26analog.irc \c25by \c26era-")); analog_color(); analog_echo($active, analog_prefix("\c25use \c26/anareset \c25to reset the color mappings if things look weird.")); }