Privlog

Gives the user extended configuration of how private logs are saved and most importantly sent back to the user when attaching. Made as a sister-script to log.tcl by doomie.

The main feature is that you, when attaching, get the queries as if your client were connected all along. Note that this requires not only this sBNC script, but also some handling in your client end to display the messages optimally.

Requirements

Software Version Details
sBNC (w/TCL module) 1.1 Developed and tested on 1.2-885.

Download

Date Version Download
2007-03-07 0.2 .tcl (13.5kB) .zip (3.1kB)

Install

  • Download (and unzip if needed)
  • Place privlog.tcl in scripts/
    • Check the settings
    • Check the default user settings
  • Add source scripts/privlog.tcl to sbnc.tcl
  • Rehash TCL
  • Use

Usage

Commands

/sbnc read    : Read logs according to settings.
/sbnc erase   : Erase logs
/sbnc privlog : Show overview of unique sources and lines from each.

Configuration

You can set up the default user settings, and a few global settings near the top of privlog.tcl.

The user default array define the ones listed under settings below, while the settings array determines the global settings.

logdir

logdir "~/sbnc/users/"
  • Folder to look for the private logs in.

Settings

There are several settings each user can change, all through /sbnc set

automated

/sbnc set privlog.automated <0|1>
  • 0 = Manual. You need to use ”/sbnc read” to read the logs.
  • 1 = Automated. Logs are automatically sent to you when attaching.

reply

/sbnc set privlog.reply <0|1|101>
  • 0 = Send messages from '-sBNC' (old '/sbnc read' style).
  • 1 = Separate query windows.
  • 101 = Send as RAW numeric for the client to display as it wish. See the mIRC example script.

autoerase

/sbnc set privlog.autoerase <0|1>
  • 0 = Do not erase.
  • 1 = Erase when read.

threshold

/sbnc set privlog.threshold <number>
  • number = If privlog.automated above is 1 and there are more unique queries than number; a warning will be displayed instead of automatically sending the logs. The logs are still available with ”/sbnc read ” and the other commands.

timestamp

/sbnc set privlog.timestamp <format>

mIRC example script

If you have set privlog.reply to a value other than 0 or 1, the script will send the logs to your client as a RAW numeric. This is an example of how mIRC can intercept that RAW message and display it as if your client was online all along.

  • Pay attention to the use of 101 in the script, which corresponds to using a value of 101 in privlog.reply.
raw sbnc:101 *:{
  ; Format:
  ;   :<server> sbnc <reply> <yournick> <ctime> <type> <nick!user@host> :<message>
  ;                     $1       $2        $3     $4         $5             $6-
 
  if ($4 == PRIVMSG) {
    var %nick = $gettok($5,1,33)
    if (!$query(%nick)) { query -n %nick }
    echo -lmc Normal %nick $asctime($3,$timestampfmt) < $+ %nick $+ > $6-
  }
  elseif ($4 == NOTICE) {
    var %nick = $gettok($5,1,33)
    echo -lmca Notice $asctime($3,$timestampfmt) - $+ %nick $+ - $6-
  }
 
  haltdef
}

History

Changes followed by :!: may need attention when updating from an older build/version.

v0.2 (2007-03-07)

  • First public release.

v0.1 (2007-03-03)

  • Private release.
sbnc/privlog.txt · Last modified: 2007/03/07 11:59 by zyberdog