tglogo.png
2 LIKES

Snippet


NickChange Logger Updated

In Category General ircWx Posted by Winz On 08/03/20

This informs you via ECHO on screen on the channel or currently active window when a new person joins your room (green) and if they have changed their name (red). It does NOT display in channel. You now have the ability to turn the log ON or OFF and has a delay of 5 seconds after a user parts and rejoins so it doesn't log ghosted nicknames. You can also view the logged names, any who are logged, remote view the nickname log file and remove particular lines or logged names from the log file, should it get too big (a lot of ghosting logs). It has a delay from the time a user leaves a room and might rejoin with a ghosted nick to help limit the number of ghost names that gets logged. It also gives a new menu to both the nicklist and channel menus. Suggestions welcome, enjoy! This will work across all channels you are connected to and informs only the channel that is joined. It is also turned on/off via a script group for easy on/off access in the file. Currently works in mIRC 7.61 The %kfont variable can be left alone if you don't use any of my scripts, it should not affect this snippet. Also requires the gaddy { var %n $numtok($ial($nick).user,46) return $gettok($ial($nick).user,%n,46) } alias if you don't already have it.
menu nicklist {
  UserLog
  .ON: enable #log
  .OFF: disable #log
  .Nicklog For Selected Name: set %laddr $addy | nkb
  .Nicklog Help: nlhelp
  -
}
menu channel {
  Nickname Log
  .ON: enable #log
  .OFF: disable #log
  ..Options
  ..View Nickname Log: showlog
  ..NickLog Help: nlhelp
}
#log on
on *:JOIN:*: { 
  if (!%pa) {
    if ($read(nicklog.txt, s, $gaddy($nick)) == $null) { /write nicklog.txt $gaddy($nick) $nick $+ , | echo 9 $active $nick joined $chan and is a new person! | halt
    }
    if ($read(nicklog.txt, s, $gaddy($nick)) !== $null) { 
      set %na $replace($read(nicklog.txt, s, $gaddy($nick)),$chr(44),$chr(32)) | tokenize 32 %na
      if ($nick isin $1-) { 
        halt
      }
      if ($nick !isin $1-) { 
        set %na $replace($read(nicklog.txt, s, $gaddy($nick)),$chr(44),$chr(32)) | tokenize 32 %na
        /write -as $+ $gaddy($nick) nicklog.txt $nick $+ ,
        echo 4 $active $nick in $chan Previous Nicknames $1-
      }
    }
    else { halt
    }
  }
  unset %na
}
on *:PART:*: { set -u5 %pa 1 }
alias showlog { if (@nicknamelog) { clear @nicknamelog
  }
  if (!@nicknamelog) { window -ae0 @nicknamelog
  } 
  var %n 1 | var %nl $lines(nicklog.txt) 
  while %n <= %nl { echo @nicknamelog 11 $+ %n  $read(nicklog.txt, %n) | inc %n
  }
  if (%n > %nl) { echo @nicknamelog 11Please type /dlog linenumber eg.(/dlog 22) to clear the line from the log once complete the window will refresh confirming the line and info that was deleted.
    echo @nicknamelog 11You can open the file and edit it manually by typing /editlog
  }
} 
alias dlog { if ($active == @nicknamelog) && ($1 == $null) { echo $active 4You must enter a line number to delete the line from the log 11eg.(/dlog 22) /showlog to refresh 
  }
  if ($active == @nicknamelog) && ($1 !== $null) { set %d $1 | set %dl $read(nicklog.txt, $1) | echo $active 11Type /yes to delete: %d  9 %dl
    echo $active 11Type /dlog linenumber eg.(/dlog 22) to select a different line
  } 
}
alias yes { if ($active == @nicknamelog) && (%dl !== $null) { 
    set %yn1 yes
    /write -dl $+ %d nicklog.txt | echo @nicknamelog 4 %dl HAS BEEN DELETED FROM THE LOG!! refreshing in 10sec...
    echo $active 8You can undo the action by typing /undo before trying to make another change!
    .timerrefresh 1 10 showlog

  }
}
alias undo { if ($active == @nicknamelog) && (%yn1 == yes) { /write -il $+ %d nicklog.txt %dl | echo $active 9Your changes have been undone, %dl has been readded to the log. Refreshing in 10sec...
    /unset %yn1 | unset %d*
    .timerrefresh1 1 10 showlog
  }
}
alias nkb { echo $chan 7This user is known by the following names in this room:  
  echo $chan 9 $read(nicklog.txt, s, %laddr)  Line number " $+ $readn $+ " should you wish to make changes.
}
alias editlog { run nicklog.txt }
alias nlhelp { echo $active 7~~~~----~~~~----"NICKNAME LOG HELP"----~~~~----~~~~
  echo $active 8About: The nickname log keeps track of all of the user nicknames associated with a user's Passport ID. You can make changes to the log remotely. Here are a list of commands you can perform to make changes to the log:
  echo $active 9/showlog: This will open a new window and show you the entire nickname log. The View Nickname Log menu option explained below does the same thing. 
  echo $active 9/dlog +linenumber: This command with 4the line number shown in the list will que the ability to remove the selected line number from the log, reasons you would want to do this are if the line is excessively long due to ghosting (numbers being added to the end of a nickname) or just to clear up names in the log
  echo $active 9/yes: confirms you want to delete the line from the log that you entered, the log will automatically refresh to show the new change
  echo $active 9/undo: allows you to RE-ADD the LAST deleted entry from the log. 4WARNING if you attempt to delete another line before /undo your deletion will be permanent, log will automatically refresh
  echo $active 8Menu Commands: You can view the individual previous nicknames of a user by right clicking a user's name in the list, UserLog, "Nicklog For Selected Name"
  echo $active You can access the Nickname Log by right clicking the channel, Nickname Log, "View Nickname Log"
  echo $active 8/editlog: Last but not least, you can edit the log file itself by typing in /editlog at any time to open the log text file 
  echo $active You can view this Log Help at any time either the Nicklist Menu or Channel Menu "NickLog Help"
  echo $active 13If you need help or have suggestions on making this simpler please email Winz - Michael at [email protected]!
}
#log end


Comments 5

danger - Thursday, 8 October, 2020
or atleast make $read(nicklog.txt, s, $gaddy($nick)) a var on join so you aint reading the file 3 or 4 times
danger - Thursday, 8 October, 2020
winz i think you might want to swap txt file for hashtable that will work fine while your in rooms with few users but if you run in on om and 40s on buzzen it would cause mirc to lock after afew months of logging
Winz - Tuesday, 4 August, 2020
No problem! Thanks for keeping TechGear alive err0r! Don't hesitate to recommend any changes Paige and thank you!!
err0r - Tuesday, 4 August, 2020
thanks for posting it Winz grin
Paige - Tuesday, 4 August, 2020
thank you very much Winz, you are indeed a very talented coder !

Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand