on *:text:*:*: {
if ($me isin $1-) {
if (!$window(@NickWatch)) {
window -kn @NickWatch
}
if ($chan != $null) {
aline @NickWatch $chr(91) $+ $time(hh:nntt) $+ $chr(93) $chr(123) $+ $network $+ $chr(125) $chr(91) $+ $chan $+ $chr(93) < $+ $nick $+ > $1-
}
else {
aline @NickWatch $chr(91) $+ $time(hh:nntt) $+ $chr(93) PM: < $+ $nick $+ > $1-
}
}
}
This should do what you need. If the output is within a channel, you will log something like this:
[5:23pm] {EFnet} [#mychan] <mynick> Hello Draco.
If it's said anywhere else (like private message), you'll get an output like:
[5:23pm] PM: <mynick> Hello Draco.
Note that you can easily remove the $time, $network and $chan sections from the output if you don't like those. You can also add any coloring that you need.