Register
tglogo.png
thumbblank.png 0 LIKES

Snippet

Nick Change History Logger
posted by err0r in Buzzen - 01/07/16
Use this snippet on Buzzen to log nickname history
menu channel {
  Nick History
  .$iif($istok(%nickhistorychannels,$chan,44),$style(1)) Log $chan : {
    $iif($istok(%nickhistorychannels,$chan,44),set %nickhistorychannels $remtok(%nickhistorychannels,$chan,1,44),set %nickhistorychannels $addtok(%nickhistorychannels,$chan,44))
  }
  .-
  .Log Room : lognicks $chan
}
on !*:Join:*: { 
  if ($left($nick,1) == >) { halt }
  var %s buzzen $+ .Log
  if ($istok(%nickhistorychannels,$chan,44)) {
    if (%history.flood. [ $+ [ $chan ] ] == on) { halt }
    set -eu3 %history.flood. [ $+ [ $chan ] ] on
    ; If Account Saved
    var %r $qt($mircdirhistory. $+ buzzen $+ .txt)
    var %addr $naddy($nick) 
    if (%addr == $gettok($read(%r, w,* $+ %addr $+ *),1,32)) {
      var %samenick
      var %hs 1
      var %his $gettok($read(%r,$readn),2,32)
      while ($gettok(%his,%hs,44)) {
        if ($regsubex($nick, /[0-9]+$/gi,$null) == $v1) { var %samenick $nick }
        inc %hs
      }
      if (%samenick != $nick) {
        if (!$istok($gettok($read(%r,$readn),2,32),$nick,44)) { 
          echo $chan [Nick Change] ---------------------------------------------------------------------------------------
          echo $chan  $+ $nick has made a nick change. Previous $iif($gettok($gettok($read(%r,$readn),2,32),2,44),nicks have been,nick was) $sorttok($gettok($read(%r,$readn),2,32),44,c)
          echo $chan -----------------------------------------------------------------------------------------------------
        }
        if ($numtok($gettok($read(%r,$readn),2,32),44) >= 11) { write -l $readn %r %addr $addtok($deltok($gettok($read(%r,$readn),2,32),1,44),$nick,44)  }
        else { write -l $readn %r %addr $addtok($gettok($read(%r,$readn),2,32),$nick,44) }
      }
      unset %samenick
    }
    ; Add Account
    else {
      echo $chan  $+ $chr(91) $+ $nick Logged $+ $chr(93)
      write %r %addr $nick
    }
  }
}
alias lognicks {
  var %a 1
  var %r $qt($mircdir\history. $+ buzzen $+ .txt)
  while ($nick($1,%a)) {
    var %n $nick($1,%a)
    if (%n != $me) {
      var %addr $naddy(%n)
      if (%addr == $gettok($read(%r, w,* $+ %addr $+ *),1,32)) {
      }
      else { 
        write %r %addr %n
      }
    }
    inc %a
  }
}
alias naddy {
  var %n $numtok($ial($1).user,46)
  if (%n isnum 1-3) { return $gettok($ial($1).user,%n,46) }
  else { return $ial($1).user }
}


0 Comments
You must be logged in to comment.