by Alexander Thomas (aka Dr. Lex)
This is a Perl script that will convert an IRC chat log in mIRC format to irssi format. The reason why you may want to use this, is to join logs of the same channel but from different loggers, together in a uniform format so the complete log can be analyzed by a statistics analyzer like pisg.
The script will try to convert practically everything I encountered in the particular log that I used as a test case, including WHOIS requests and connects/disconnects. It will also reconstruct status bytes (@ and +) by tracking the status of each nickname and the channel status. E.g. if someone performs an action that can only be done by a channel op, op status for that nickname will be inferred. (To make this as correct as possible, the output needs to be run through the script a second time with the ‘-fix’ switch.) The result should look as if it was directly logged by irssi.
There may be some things still missing and it is possible that other mIRC versions produce a different log syntax. But anyone with basic knowledge of Perl can easily update the script. If it encounters anything it cannot convert, it will write a warning “Don't know what to do” to stderr. It has also basic provisions to cope with DST changes, but if you see a warning in the output that doesn't make sense, you may want to have a look at the comments in the script itself.
You may need to make the unzipped file executable (chmod 755) to be able to run it.
The script requires the Date::Calc CPAN module.
Usage: mirc2irssi [options] mircfile.log > outfile.log
Most of the options serve to give an identity to the logger, which is entirely optional and probably irrelevant for stat analyzers. But it will make the log look more authentic.
-nick N: set nick of logger to N
-id I: set ID of logger to I
-server S: set server to S
-ip A: set IP of server to A
-port P: set port of server to P
-stat C: set initial channel status to C (currently, only 't' is relevant, to infer op status from topic changes)
-fix: for this option, the input file must be an already processed irssi-format log. It will do a reverse run through the log to fix some additional missing status bytes.
-v: enable verbose mode.
-V: print version info and exit.
1.0 (2008/09): Initial release
1.1 (2009/08): Day change fix, DST hack and some other small fixes
1.2 (2015/01): Allow date stamps without seconds
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.