Skip to content
General Chat Talk

Nick Logger

A TG007 community discussion started by JOhnson.

Discussion 30 posts
Page 2 of 2
Open
Topic #13303 · 30 published posts · 5,814 views

your problem could be the use of ial.. are you turning ial off for any reason... try /ial on

 

then see if it works

 

as for using txt, ini, or hash.. your choice.. txt files do have the size issue but it all depends on the server size.. spcn and buzzen prolly wont have that issue as they are no where near the size that msn was or that larger servers are in ppl

Edited Aug 23, 2009 9:17 PM by err0r

Get information about ircWx here

here is the same code using $address instead of ial

 

menu channel {
   History
   .$iif($istok(%History.Log,$chan,44),$style(1)) $chan : $iif($istok(%History.Log,$chan,44),set %History.Log $remtok(%History.Log,$chan,1,44),set %History.Log $addtok(%History.Log,$chan,44))
   .$iif($istok(%History.Msg,$chan,44),$style(1)) Message : $iif($istok(%History.Msg,$chan,44),set %History.Msg $remtok(%History.Msg,$chan,1,44),set %History.Msg $addtok(%History.Msg,$chan,44))
   .$iif(!$isfile(history.txt),$style(2)) Remove Log File : /remove -d history.txt
   .View Log File : /run history.txt
}
on !*:JOIN:#:{
   if ((!$istok(%History.Log,$chan,44)) || (%History.Join)) { halt }
   set -eu2 %History.Join on
   if ($address($nick,1) == $gettok($read(history.txt, w,*  $address($nick,1)  *),1,32)) {
     var %hs 1
     var %his $gettok($read($mircdirhistory.txt,$readn),2,32)
     while ($gettok(%his,%hs,44)) {
       if ($gettok(%his,%hs,44) isin $nick) { set %samenick $nick }
       inc %hs
     }
     if (%samenick != $nick) {
       if (!$istok($gettok($read($mircdirhistory.txt,$readn),2,32),$nick,44)) { 
         if ($istok(%History.Msg,$chan,44)) { .msg $chan $nick has made a nick change. Previous $iif($gettok($gettok($read($mircdirhistory.txt,$readn),2,32),2,44),nicks have been,nick was) $sorttok($gettok($read($mircdirhistory.txt,$readn),2,32),44,c) }
       }
       if ($numtok($gettok($read($mircdirhistory.txt,$readn),2,32),44) >= 5) { write -l $readn $mircdirhistory.txt $address($nick,1) $addtok($deltok($gettok($read($mircdirhistory.txt,$readn),2,32),1,44),$nick,44)  }
       else { write -l $readn $mircdirhistory.txt $address($nick,1) $addtok($gettok($read($mircdirhistory.txt,$readn),2,32),$nick,44) }
     }
   }
   else { 
     if ($istok(%History.Msg,$chan,44)) { .msg $chan Haven't seen you before $nick ( logged ) }
     write $mircdirhistory.txt $address($nick,1) $nick
   } 
   unset %samenick
}

Edited Aug 23, 2009 9:25 PM by err0r

Get information about ircWx here

Update:

 

Changed nicklogger to hash tables. Added option to use msg or echo. Added simple @window log viewer

 

menu channel {
     History
     .$iif($istok(%History.Log,$chan,44),$style(1)) Log $chan : $iif($istok(%History.Log,$chan,44),set %History.Log $remtok(%History.Log,$chan,1,44),set %History.Log $addtok(%History.Log,$chan,44))
     .Message
     ..$iif($istok(%History.Msg,$chan,44),$style(1)) Msg Room : $iif($istok(%History.Msg,$chan,44),set %History.Msg $remtok(%History.Msg,$chan,1,44),set %History.Msg $addtok(%History.Msg,$chan,44))
     ..$iif($istok(%History.Echo,$chan,44),$style(1)) Echo Room : $iif($istok(%History.Echo,$chan,44),set %History.Echo $remtok(%History.Echo,$chan,1,44),set %History.Echo $addtok(%History.Echo,$chan,44))
     .Settings
     ..Clear Log : hfree history | $iif($exists(historyhash.txt),/remove -d historyhash.txt) | hmake history 500
     ..View Log : historylog
     .-
   }
   on *:start: { hmake history 100 |  if ($exists(historyhash.txt)) { hload history historyhash.txt } }
   on *:exit: { hfree history }
   on !*:JOIN:#:{
     if ( (!$istok(%History.Log,$chan,44)) || (%History.Join)) { halt }
     set -eu2 %History.Join on
     if ($hget(history,$address($nick,1))) {
       if (!$istok($hget(history,$address($nick,1)),$nick,44)) {
         if ($istok(%History.Msg,$chan,44)) { msg $chan $nick has made a nick change. Previous $iif($gettok($hget(history,$address($nick,1)),2,44),nicks have been,nick was) $sorttok($hget(history,$address($nick,1)),44,c) }
         if ($istok(%History.Echo,$chan,44)) { echo $chan 7  $nick has made a nick change. Previous $iif($gettok($hget(history,$address($nick,1)),2,44),nicks have been,nick was) $sorttok($hget(history,$address($nick,1)),44,c) }
         if ($numtok($hget(history,$address($nick,1)),44) >= 5) { hadd -m history $address($nick,1) ($deltok($hget(history,$address($nick,1)),1,44),$chr(44),$nick)  }
         else { hadd -m history $address($nick,1) ($hget(history,$address($nick,1)),$chr(44),$nick) }
       } 
     } 
     else { if ($istok(%History.Msg,$chan,44)) { msg $chan Haven't seen you before $nick ( logged ) } | hadd -m history $address($nick,1) $nick }
     hsave -o history historyhash.txt
   }
   alias historylog {
    if (!$window(@historylog)) { /window -blk -t2,21 +benstx @historylog verdana 11 }
    clear @historylog | aline @historylog $chr(9) Address $chr(9) Logged Nicks | aline @historylog $chr(160)
    %hh = 1 | %hhn = $hget(history, 0).item 
    while (%hh <= %hhn) { aline -p @historylog (14,%hh,.) $chr(9) 1  $hget(history,%hh).item $chr(9) 1  $hget(history,%hh).data | aline @historylog $chr(160) | inc %hh  }
  }

 

Sidenote: now you see why i do not release things very often because i never stop changing them

Edited Aug 24, 2009 12:34 AM by err0r

Get information about ircWx here

One last little thing ( i hope ).. This is for ppl mainly on buzzen that do not want to save ghost nicks.

What i mean by ghost nicks are those nicks that when their nick is already in the room it adds a number to the end like err0r45564

This will ignore the nick if it's in the list and just has a number appended to the end.

Also added the option to ignore guest nicks..

 

All in channel menu options under settings.

 

Please report any bugs or anything you would like to see changed or added.

 

menu channel {
  History Per Chan
  .$iif($istok(%History.Log,$chan,44),$style(1)) Log $chan : $iif($istok(%History.Log,$chan,44),set %History.Log $remtok(%History.Log,$chan,1,44),set %History.Log $addtok(%History.Log,$chan,44))
  .$iif($istok(%History.Msg,$chan,44),$style(1)) Msg Room : $iif($istok(%History.Msg,$chan,44),set %History.Msg $remtok(%History.Msg,$chan,1,44),set %History.Msg $addtok(%History.Msg,$chan,44))
  .$iif($istok(%History.Echo,$chan,44),$style(1)) Echo Room : $iif($istok(%History.Echo,$chan,44),set %History.Echo $remtok(%History.Echo,$chan,1,44),set %History.Echo $addtok(%History.Echo,$chan,44))
  History Global Settings
  .$iif(%History.NoGuest,$style(1)) No Guest Log : $iif(%History.NoGuest,unset %History.NoGuest,set %History.NoGuest on)
  .$iif(%History.NoGhost,$style(1)) No Ghost Log : $iif(%History.NoGhost,unset %History.NoGhost,set %History.NoGhost on)
  .-
  .Clear Log : hfree history | $iif($exists(historyhash.txt),/remove -d historyhash.txt) | hmake history 500
  .View Log : historylog
  -
}
on *:start: { hmake history 100 |  if ($exists(historyhash.txt)) { hload history historyhash.txt } }
on *:exit: { hsave -o history historyhash.txt | hfree history }
on !*:JOIN:#:{
  if ((!$istok(%History.Log,$chan,44)) || (%History.Join)) { halt }
  if (%History.NoGuest) && ($left($nick,1) == >) { halt }
  set -eu2 %History.Join on
  if ($hget(history,$address($nick,1))) {
    if (%History.NoGhost) {
      var %hs 1
      while ($gettok($hget(history,$address($nick,1)),%hs,44)) { if ($regsubex($nick, /[0-9]+$/gi,$null) == $v1) { set %match yes } | inc %hs  }
    }
    if (!%match) {
      if (!$istok($hget(history,$address($nick,1)),$nick,44)) {
        if ($istok(%History.Msg,$chan,44)) { msg $chan $nick has made a nick change. Previous $iif($gettok($hget(history,$address($nick,1)),2,44),nicks have been,nick was) $replace($sorttok($hget(history,$address($nick,1)),44,c),$chr(44),$chr(44) $chr(32)) }
        if ($istok(%History.Echo,$chan,44)) { echo $chan 7  $nick has made a nick change. Previous $iif($gettok($hget(history,$address($nick,1)),2,44),nicks have been,nick was) $replace($sorttok($hget(history,$address($nick,1)),44,c),$chr(44),$chr(44) $chr(32)) }
        if ($numtok($hget(history,$address($nick,1)),44) >= 5) { hadd -m history $address($nick,1) $+($deltok($hget(history,$address($nick,1)),1,44),$chr(44),$nick)  }
        else { hadd -m history $address($nick,1) $+($hget(history,$address($nick,1)),$chr(44),$nick) }
      }
    }
  }
  else { if ($istok(%History.Msg,$chan,44)) { msg $chan Haven't seen you before $nick ( logged ) } | hadd -m history $address($nick,1) $nick }
  hsave -o history historyhash.txt | unset %match
}
menu @historylog {
  Search: /sline -s @historylog $fline(@historylog,* $+ $?="Search for" $+ *,1,1) 
  Remove Selected: { /hdel -s history $gettok($sline(@historylog,1),4,32) | historylog }
  Clear Log: { hfree history | $iif($exists(historyhash.txt),/remove -d historyhash.txt) | hmake history 500 | historylog }
}
alias historylog {
  if (!$window(@historylog)) { /window -blk -t2,21 +benstx @historylog verdana 11 }
  clear @historylog | aline @historylog $chr(9) Address $chr(9) Logged Nicks | aline @historylog $chr(160)
  %hh = 1 | %hhn = $hget(history, 0).item
  while (%hh <= %hhn) { aline -p @historylog $+(14,%hh,.) $chr(9) 1 $hget(history,%hh).item $chr(9) 1 $hget(history,%hh).data |  inc %hh  }
}

 

Note for some reason IPB is removing when i'm editing.. you are prolly better off getting it from the attached txt file instead.

Note: updated log menu to search, remove, and clear log

nicklogger.txt

Edited Aug 24, 2009 9:45 AM by err0r

Get information about ircWx here

Attachments 1 file
:lmaojump:I would like to thank you for the history code err0r and im very grateful for your help in the test room :D

np glad you got it going

Get information about ircWx here

:oops: err0r take a look at these two screen shots of the dropdown menu

 

 

post-27425-1251110538_thumb.jpg

 

post-27425-1251110549_thumb.jpg

 

Attachments 2 files

make sure u do not have two versions of the nicklogger in ur script..

 

if need be just delete the whole snippet from ur remotes and re-add it from http://www.tg007.net/forum/index.php?act=a...post&id=485

Edited Aug 24, 2009 10:51 AM by err0r

Get information about ircWx here

make sure u do not have two versions of the nicklogger in ur script..

 

if need be just delete the whole snippet from ur remotes and re-add it from http://www.tg007.net/forum/index.php?act=a...post&id=485

 

:lolwave: thats what it was two history.mrc ... new nick for me n00b_The_Jackass :lolwave:

Well I hope I was somewhat helpful here. I do recommend the bits of code err0r posted... but if you ever need any more help I'll gladly do so.

The Internet: where men are men, women are men, and children are FBI agents.