Advertisement
westor

AKA based on hosts+idents for Jfaster v1.1

Nov 14th, 2021 (edited)
1,596
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 4.48 KB | None | 0 0
  1. ;*****************************************************************************;
  2.  
  3. alias -l show_nick_with_hosts_join { return 1 }
  4. alias -l show_nick_with_idents_join { return 1 }
  5. alias -l max_items { return 100 }
  6. alias -l database1 { return nicks_with_host.db }
  7. alias -l database2 { return nicks_with_ident.db }
  8. alias -l except_idents { return first.host.here second.host.here }
  9. alias -l except_hosts { return ident1 ident2 }
  10.  
  11. ;*****************************************************************************;
  12.  
  13. ON *:START:{
  14.   hmake NICKS_PLUS_HOST 1000
  15.   hmake NICKS_PLUS_IDENT 1000
  16.  
  17.   if ($file($database1)) { hload NICKS_PLUS_HOST $qt($database1) }
  18.   if ($file($database2)) { hload NICKS_PLUS_IDENT $qt($database2) }
  19. }
  20.  
  21. ON *:EXIT: {
  22.   if ($hget(NICKS_PLUS_HOST)) { hsave $v1 $qt($database1) }
  23.   if ($hget(NICKS_PLUS_IDENT)) { hsave $v1 $qt($database2) }
  24. }
  25.  
  26. ON *:JOIN:#: {
  27.   if ($nick == $me) { set -eu30 %who_ $+ $chan $+ _nicknames 1 | .ialfill -f $chan | return }
  28.  
  29.   nick_plus_ident_add $nick $remove($ial($nick).user,~)
  30.   nick_plus_host_add $nick $ial($nick).host
  31.  
  32.   if ($show_nick_with_hosts_join) { nick_plus_host_show $nick $chan $ial($nick).host  }
  33.   if ($show_nick_with_idents_join) { nick_plus_ident_show $nick $chan $remove($ial($nick).user,~) }
  34. }
  35.  
  36. ON !*:NICK: {
  37.   nick_plus_ident_add $newnick $remove($ial($newnick).user,~)
  38.   nick_plus_host_add $newnick $ial($newnick).host
  39.  
  40.   var %t = $comchan($newnick,0)
  41.   var %i = 1
  42.  
  43.   while (%i <= %t) {
  44.     var %c = $comchan($newnick,%i)
  45.  
  46.     if (%c) {
  47.       if ($show_nick_with_hosts_join) { nick_plus_host_show $newnick %c $ial($newnick).host }
  48.       if ($show_nick_with_idents_join) { nick_plus_ident_show $newnick %c $remove($ial($newnick).user,~) }
  49.     }
  50.  
  51.     inc %i
  52.   }
  53. }
  54.  
  55. raw *:*: {
  56.   if ($numeric == 352) {
  57.     if (!%who_ [ $+ [ $2 ] $+ ] _nicknames) { return }
  58.  
  59.     haltdef
  60.  
  61.     if ($6) && ($3) && ($6 !== $me) { nick_plus_ident_add $6 $remove($3,~) }
  62.     if ($6) && ($4) && ($6 !== $me) { nick_plus_host_add $6 $4 }
  63.   }
  64.  
  65.   if ($numeric == 354) {
  66.     if (!%who_ [ $+ [ $3 ] $+ ] _nicknames) { return }
  67.  
  68.     haltdef
  69.  
  70.     if ($7) && ($4) && ($7 !== $me) { nick_plus_ident_add $7 $remove($4,~) }
  71.     if ($7) && ($5) && ($7 !== $me) { nick_plus_host_add $7 $5 }
  72.   }
  73.  
  74.   if ($numeric == 315) {
  75.     if (%who_ [ $+ [ $2 ] $+ ] _nicknames) { haltdef | unset %who_ $+ $2 $+ _nicknames }
  76.   }
  77. }
  78.  
  79. alias nick_plus_host_show {
  80.   ; /nick_plus_host_show <nickname> <#channel> <host>
  81.  
  82.   if (!$1) || (!$2) || (!$3) || ($me !ison $2) { return }
  83.  
  84.   var %h = $hget(NICKS_PLUS_HOST,$3)
  85.  
  86.   if (!%h) { return }
  87.  
  88.   var %s = $remtok(%h,$1,1,32)
  89.  
  90.   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)) $+ ) }
  91. }
  92.  
  93. alias nick_plus_ident_show {
  94.   ; /nick_plus_ident_show <nickname> <#channel> <ident>
  95.  
  96.   if (!$1) || (!$2) || (!$3) || ($me !ison $2) { return }
  97.  
  98.   var %h = $hget(NICKS_PLUS_IDENT,$3)
  99.  
  100.   if (!%h) { return }
  101.  
  102.   var %s = $remtok(%h,$1,1,32)
  103.  
  104.   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)) $+ ) }
  105. }
  106.  
  107. alias nick_plus_host_add {
  108.   ; /nick_plus_host_add <nickname> <host>
  109.  
  110.   if (!$1) || (!$2) || ($istok($except_hosts,$2,32)) { return }
  111.  
  112.   var %h = $hget(NICKS_PLUS_HOST,$2)
  113.  
  114.   if ($numtok(%h,32) > $max_items) || ($istok(%h,$1,32)) { return }
  115.  
  116.   hadd NICKS_PLUS_HOST $2 %h $1
  117. }
  118.  
  119. alias nick_plus_ident_add {
  120.   ; /nick_plus_ident_add <nickname> <ident>
  121.  
  122.   if (!$1) || (!$2) || ($istok($except_idents,$2,32)) { return }
  123.  
  124.   var %h = $hget(NICKS_PLUS_IDENT,$2)
  125.  
  126.   if ($numtok(%h,32) > $max_items) || ($istok(%h,$1,32)) { return }
  127.  
  128.   hadd NICKS_PLUS_IDENT $2 %h $1
  129. }
  130.  
  131. alias -l bold { return $+($chr(2),$1-,$chr(2)) }
  132. alias -l underline { return $+($chr(31),$1-,$chr(31)) }
  133. alias -l italic { return $+($chr(29),$1-,$chr(29)) }
  134. alias -l reverse { return $+($chr(22),$1-,$chr(22)) }
  135.  
  136. alias -l col {
  137.   ; $col(N1-N2,TEXT)
  138.  
  139.   if ($1 == $null) { return }
  140.  
  141.   var %n0 = $gettok($1,1-2,45)
  142.   var %n1 = $gettok(%n0,1,45)
  143.   var %n2 = $gettok(%n0,2,45)
  144.  
  145.   if (%n1 !== $null) && (%n1 isnum 0-9) { var %n1 = 0 $+ %n1 }
  146.   if (%n2 !== $null) && (%n2 isnum 0-9) { var %n2 = 0 $+ %n2 }
  147.  
  148.   if (%n1 !== $null) && (%n1 !isnum 0-98) { return }
  149.   if (%n2 !== $null) && (%n2 !isnum 0-98) { return }
  150.  
  151.   if (%n1 !== $null) && (%n2 == $null) { var %t = %n1 }
  152.   if (%n1 !== $null) && (%n2 !== $null) { var %t = $+(%n1,$chr(44),%n2)) }
  153.  
  154.   return $+($chr(3),%t,$2-,$chr(3))
  155. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement