Skip to content
TG007 community snippet #77

Nick Change History Logger

Use this snippet on Buzzen to log nickname history

By err0r Added Jan 7, 2016
Buzzen All snippets
mIRC script 64 lines
About this snippet

Overview

Use this snippet on Buzzen to log nickname history
Source code

mIRC script

64 lines · 2,413 characters
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 }
}
Community

Comments

Want to join the discussion? Sign in to TG007.
dangerThursday, 12 November, 2020
//raw ACCESS $active ADD DENY err0rstotle*!*@* 0 :ban that wraskly wabbit
err0rSunday, 1 November, 2020
You should have already who'ed room before this else you wouldn't be able to ban or anything else.
dangerSunday, 1 November, 2020
else you will not have the persons gate to do it
dangerSunday, 1 November, 2020
you might also want to change " .Log Room : lognicks $chan" to " .Log Room : .raw WHO $chan | .timerdolog -co 1 2 lognicks $chan"
dangerSunday, 1 November, 2020
also %samenick should be declared at top of script as it stands currently its gonna = nick or whatever that vars value is globally
View 7 older comments
dangerSunday, 1 November, 2020
and naddy should be one line
dangerSunday, 1 November, 2020
i was only saying no need to bring my back pussy into this, now PK is pissing in it
guestSunday, 1 November, 2020
PMSL!
err0rSunday, 1 November, 2020
Maybe just not be an asshole then
dangerFriday, 30 October, 2020
you aint in any of the rooms im flooding with random nicks every 30 seconds is prolly why
err0rThursday, 15 October, 2020
Very unlikely this would happen on ircwx networks as they are so small in numbers. If it becomes an issue the user should do that but I think text files will be ok.. I run one room bot over 9 networks using this and so far no real issues to this point. Bu
dangerThursday, 8 October, 2020
you should remake this using hashtables using file to log them will lock mirc if the file gets too big