Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;*****************************************************************************;
- alias -l show_nick_with_hosts_join { return 1 }
- alias -l show_nick_with_idents_join { return 1 }
- alias -l max_items { return 100 }
- alias -l database1 { return nicks_with_host.db }
- alias -l database2 { return nicks_with_ident.db }
- alias -l except_idents { return first.host.here second.host.here }
- alias -l except_hosts { return ident1 ident2 }
- ;*****************************************************************************;
- ON *:START:{
- hmake NICKS_PLUS_HOST 1000
- hmake NICKS_PLUS_IDENT 1000
- if ($file($database1)) { hload NICKS_PLUS_HOST $qt($database1) }
- if ($file($database2)) { hload NICKS_PLUS_IDENT $qt($database2) }
- }
- ON *:EXIT: {
- if ($hget(NICKS_PLUS_HOST)) { hsave $v1 $qt($database1) }
- if ($hget(NICKS_PLUS_IDENT)) { hsave $v1 $qt($database2) }
- }
- ON *:JOIN:#: {
- if ($nick == $me) { set -eu30 %who_ $+ $chan $+ _nicknames 1 | .ialfill -f $chan | return }
- nick_plus_ident_add $nick $remove($ial($nick).user,~)
- nick_plus_host_add $nick $ial($nick).host
- if ($show_nick_with_hosts_join) { nick_plus_host_show $nick $chan $ial($nick).host }
- if ($show_nick_with_idents_join) { nick_plus_ident_show $nick $chan $remove($ial($nick).user,~) }
- }
- ON !*:NICK: {
- nick_plus_ident_add $newnick $remove($ial($newnick).user,~)
- nick_plus_host_add $newnick $ial($newnick).host
- var %t = $comchan($newnick,0)
- var %i = 1
- while (%i <= %t) {
- var %c = $comchan($newnick,%i)
- if (%c) {
- if ($show_nick_with_hosts_join) { nick_plus_host_show $newnick %c $ial($newnick).host }
- if ($show_nick_with_idents_join) { nick_plus_ident_show $newnick %c $remove($ial($newnick).user,~) }
- }
- inc %i
- }
- }
- raw *:*: {
- if ($numeric == 352) {
- if (!%who_ [ $+ [ $2 ] $+ ] _nicknames) { return }
- haltdef
- if ($6) && ($3) && ($6 !== $me) { nick_plus_ident_add $6 $remove($3,~) }
- if ($6) && ($4) && ($6 !== $me) { nick_plus_host_add $6 $4 }
- }
- if ($numeric == 354) {
- if (!%who_ [ $+ [ $3 ] $+ ] _nicknames) { return }
- haltdef
- if ($7) && ($4) && ($7 !== $me) { nick_plus_ident_add $7 $remove($4,~) }
- if ($7) && ($5) && ($7 !== $me) { nick_plus_host_add $7 $5 }
- }
- if ($numeric == 315) {
- if (%who_ [ $+ [ $2 ] $+ ] _nicknames) { haltdef | unset %who_ $+ $2 $+ _nicknames }
- }
- }
- alias nick_plus_host_show {
- ; /nick_plus_host_show <nickname> <#channel> <host>
- if (!$1) || (!$2) || (!$3) || ($me !ison $2) { return }
- var %h = $hget(NICKS_PLUS_HOST,$3)
- if (!%h) { return }
- var %s = $remtok(%h,$1,1,32)
- if ($numtok(%h,32) > 1) { echo -tg $2 * $bold($col(4,AKA HOSTS)) $col(3,$1) $chr(9866) $col(4,%s) ( $+ $col(5,$numtok(%s,32)) $+ ) }
- }
- alias nick_plus_ident_show {
- ; /nick_plus_ident_show <nickname> <#channel> <ident>
- if (!$1) || (!$2) || (!$3) || ($me !ison $2) { return }
- var %h = $hget(NICKS_PLUS_IDENT,$3)
- if (!%h) { return }
- var %s = $remtok(%h,$1,1,32)
- if ($numtok(%h,32) > 1) { echo -tg $2 * $bold($col(4,AKA IDENTS)) $col(3,$1) $chr(9866) $col(4,%s) ( $+ $col(5,$numtok(%s,32)) $+ ) }
- }
- alias nick_plus_host_add {
- ; /nick_plus_host_add <nickname> <host>
- if (!$1) || (!$2) || ($istok($except_hosts,$2,32)) { return }
- var %h = $hget(NICKS_PLUS_HOST,$2)
- if ($numtok(%h,32) > $max_items) || ($istok(%h,$1,32)) { return }
- hadd NICKS_PLUS_HOST $2 %h $1
- }
- alias nick_plus_ident_add {
- ; /nick_plus_ident_add <nickname> <ident>
- if (!$1) || (!$2) || ($istok($except_idents,$2,32)) { return }
- var %h = $hget(NICKS_PLUS_IDENT,$2)
- if ($numtok(%h,32) > $max_items) || ($istok(%h,$1,32)) { return }
- hadd NICKS_PLUS_IDENT $2 %h $1
- }
- alias -l bold { return $+($chr(2),$1-,$chr(2)) }
- alias -l underline { return $+($chr(31),$1-,$chr(31)) }
- alias -l italic { return $+($chr(29),$1-,$chr(29)) }
- alias -l reverse { return $+($chr(22),$1-,$chr(22)) }
- alias -l col {
- ; $col(N1-N2,TEXT)
- if ($1 == $null) { return }
- var %n0 = $gettok($1,1-2,45)
- var %n1 = $gettok(%n0,1,45)
- var %n2 = $gettok(%n0,2,45)
- if (%n1 !== $null) && (%n1 isnum 0-9) { var %n1 = 0 $+ %n1 }
- if (%n2 !== $null) && (%n2 isnum 0-9) { var %n2 = 0 $+ %n2 }
- if (%n1 !== $null) && (%n1 !isnum 0-98) { return }
- if (%n2 !== $null) && (%n2 !isnum 0-98) { return }
- if (%n1 !== $null) && (%n2 == $null) { var %t = %n1 }
- if (%n1 !== $null) && (%n2 !== $null) { var %t = $+(%n1,$chr(44),%n2)) }
- return $+($chr(3),%t,$2-,$chr(3))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement