Well, this was a request from a friend. He wanted a script that would put logs files into a certain folder, depending on what month it is. (I.E. If it was the month of July, all log files would be put in a July folder) I haven't had much time to test the script(Made it yesterday) but i think its been done pretty well. Tell me if you find any errors because, as said before, I didn't have much time to test it.
on *:START: {
if ($readini(logging.ini,logging,logging) == Yes) {
echo -a Logging script initialized
if ($readini(Logging.ini,Logging,Logmonth) != $time(mmmm)) {
mkdir Mlogs
echo -a Log for the new month has been created.
mkdir MLogs\ $+ $time(mmmm)
writeini Logging.ini Logging Logmonth $time(mmmm)
}
}
}
on *:LOAD: {
mkdir MLogs
.timer 1 2 mkdir Mlogs\ $+ $time(mmmm)
writeini Logging.ini Logging Logmonth $time(mmmm)
}
menu * {
-
...Logging
..On:logging on | echo -a Logging initialized
..Off:logging off | echo -a Logging turned off
}
alias logging {
if ($1 == on) {
writeini Logging.ini Logging Logging Yes
if ($readini(Logging.ini,Logging,Logmonth) != $time(mmmm)) {
mkdir $time(mmmm)
writeini Logging.ini Logging Logmonth $time(mmmm)
}
}
if ($1 == off) {
writeini Logging.ini Logging Logging No
}
}
on *:JOIN:#: {
if ($nick == $me) && ($readini(logging.ini,logging,logging) == Yes) {
write Mlogs\ $+ $readini(Logging.ini,Logging,Logmonth) $+ \ $+ $chan $+ . $+ $network $+ .txt [New Session start at $fulldate on $network on $chan $+ ]
}
if ($nick != $me) && ($readini(logging.ini,logging,logging) == yes) {
write Mlogs\ $+ $readini(Logging.ini,Logging,Logmonth) $+ \ $+ $chan $+ . $+ $network $+ .txt $timestamp ** Joins: $nick
}
}
on *:OPEN:?: {
if ($readini(logging.ini,logging,logging) == Yes) {
write Mlogs\ $+ $readini(Logging.ini,Logging,Logmonth) $+ \ $+ $chan $+ . $+ $network $+ .txt [New Session start at $fulldate on $network with $nick $+ ]
}
}
on *:INPUT:*: {
if ($1 == /me) { write Mlogs\ $+ $readini(Logging.ini,Logging,Logmonth) $+ \ $+ $iif($chan != $null,$chan,$nick) $+ . $+ $network $+ .txt $timestamp * $me $1- }
if (/ == $left($1,1)) { return }
if ($readini(logging.ini,logging,logging) == yes) {
write Mlogs\ $+ $readini(Logging.ini,Logging,Logmonth) $+ \ $+ $iif($chan != $null,$chan,$active) $+ . $+ $network $+ .txt $timestamp [ $+ $me $+ ]: $1-
}
}
on *:TEXT:*:*: {
if ($readini(logging.ini,logging,logging) == yes) {
write Mlogs\ $+ $readini(Logging.ini,Logging,Logmonth) $+ \ $+ $iif($chan != $null,$chan,$nick) $+ . $+ $network $+ .txt $timestamp [ $+ $nick $+ ]: $1-
}
}
on *:NICK: {
if ($readini(logging.ini,logging,logging) == yes) {
write Mlogs\ $+ $readini(Logging.ini,Logging,Logmonth) $+ \ $+ $chan $+ . $+ $network $+ .txt $timestamp ** $nick is now known as $newnick
}
}
on *:RAWMODE:#: {
if ($readini(logging.ini,logging,logging) == yes) {
write Mlogs\ $+ $readini(Logging.ini,Logging,Logmonth) $+ \ $+ $chan $+ . $+ $network $+ .txt $timestamp ** $nick sets mode: $1-
}
}
on *:ACTION:*:*: {
if ($readini(logging.ini,logging,logging) == yes) {
write Mlogs\ $+ $readini(Logging.ini,Logging,Logmonth) $+ \ $+ $iif($chan != $null,$chan,$nick) $+ . $+ $network $+ .txt $timestamp * $nick $1-
}
}
on *:INVITE:#: {
if ($readini(logging.ini,logging,logging) == yes) {
write Mlogs\ $+ $readini(Logging.ini,Logging,Logmonth) $+ \ $+ $chan $+ . $+ $network $+ .txt $timestamp * You were invited to join $chan
}
}
on *:Kick:*: {
if ($readini(logging.ini,logging,logging) == yes) {
write Mlogs\ $+ $readini(Logging.ini,Logging,Logmonth) $+ \ $+ $chan $+ . $+ $network $+ .txt $timestamp $knick was kicked by $nick ( $+ $1- $+ )
}
}
on *:NOTICE:*:*: {
if ($readini(logging.ini,logging,logging) == yes) {
write Mlogs\ $+ $readini(Logging.ini,Logging,Logmonth) $+ \ $+ $iif($chan != $null,$chan,$nick) $+ . $+ $network $+ .txt $timestamp *** Notice from $nick $+ : $1-
}
}
on *:QUIT: {
if ($readini(logging.ini,logging,logging) == yes) {
write Mlogs\ $+ $readini(Logging.ini,Logging,Logmonth) $+ \ $+ $chan $+ . $+ $network $+ .txt $timestamp *** $nick has quit IRC ( $+ $1- $+ )
}
}
on *:PART:#: {
if ($readini(logging.ini,logging,logging) == yes) {
write Mlogs\ $+ $readini(Logging.ini,Logging,Logmonth) $+ \ $+ $chan $+ . $+ $network $+ .txt $timestamp *** $nick has left $chan ( $+ $iif($1- != $null,$1-,No Reason) $+ )
}
}
It wont work with the file names in the /write\'s as you have them. Instead of:
write Mlogs\\ $+ %logmonth $+ \\ $+ $chan $+ . $+ $network $+ .txt [New Session start at $fulldate on $network on $chan $+ ]
it should be:
write $+(Mlogs\\,%logmonth,\\,$chan,.,$network,.txt) [New Session start at $fulldate on $network on $chan $+ ]