xecho -b Log script loaded! xecho -b Written by gircobain 02/12/2001 assign LOG_ON 0 @LOGCHANS = [#Alternative #trivia #Help #S+G #Admins] @SERVERMSG_LOGFILE = [~/logs/servermsg] @MSG_LOGFILE = [~/logs/msg] alias log (toggle) { if (toggle != []) { switch ($toggle) { (on) { if (LOG_ON) { xecho -b Logging already on! }{ xecho -b Starting logging... ^assign LOG_ON 1 @:fd = open($SERVERMSG_LOGFILE\.$strftime(%b)\.log w) @write($fd * Logging started on $strftime(%x) at $strftime(${time() + TIME_DIFF * 3600} %H:%M:%S)) @close($fd) @:fd = open($MSG_LOGFILE\.$strftime(%b)\.log w) @write($fd * Logging started on $strftime(%x) at $strftime(${time() + TIME_DIFF * 3600} %H:%M:%S)) @close($fd) fe ($LOGCHANS) chan { @:fd = open(~/logs/$chan\.$strftime(%b)\.log w) @write($fd * Logging started on $strftime(%x) at $strftime(${time() + TIME_DIFF * 3600} %H:%M:%S)) @close($fd) } } } (off) { if (!LOG_ON) { xecho -b Logging already off! }{ xecho -b Logging finished! ^assign LOG_ON 0 @:fd = open($SERVERMSG_LOGFILE\.$strftime(%b)\.log w) @write($fd * Logging finished on $strftime(%x) at $strftime(${time() + TIME_DIFF * 3600} %H:%M:%S)) @close($fd) @:fd = open($MSG_LOGFILE\.$strftime(%b)\.log w) @write($fd * Logging finished on $strftime(%x) at $strftime(${time() + TIME_DIFF * 3600} %H:%M:%S)) @close($fd) fe ($LOGCHANS) chan { @:fd = open(~/logs/$chan\.$strftime(%b)\.log w) @write($fd * Logging finished on $strftime(%x) at $strftime(${time() + TIME_DIFF * 3600} %H:%M:%S)) @close($fd) } } } } }{ xecho -b Logging is currently ${LOG_ON ? [on] : [off]} xecho -b Usage: /log [ on | off ] } } on #-627 589 "*" if (LOG_ON) { @:fd = open($SERVERMSG_LOGFILE\.$strftime(%b)\.log w) @write($fd \[$strftime(${time() + TIME_DIFF * 3600} %H:%M)\] $0 \[Admins\]: $1-) @close($fd) } on #-628 764 "*" if (LOG_ON) { @:fd = open($SERVERMSG_LOGFILE\.$strftime(%b)\.log w) @write($fd \[$strftime(${time() + TIME_DIFF * 3600} %H:%M)\] $0 \[Announcement\]: $1-) @close($fd) } on #-404 259 "*" if (LOG_ON) { @:fd = open($SERVERMSG_LOGFILE\.$strftime(%b)\.log w) @write($fd \[$strftime(${time() + TIME_DIFF * 3600} %H:%M)\] $*) @close($fd) } on #-msg 984 "*" if (LOG_ON) { @:fd = open($MSG_LOGFILE\.$strftime(%b)\.log w) @write($fd \[$strftime(${time() + TIME_DIFF * 3600} %H:%M)\]\[From $0\] $1-) @close($fd) } on #-send_msg 308 "*" if (LOG_ON) { @:fd = open($MSG_LOGFILE\.$strftime(%b)\.log w) @write($fd \[$strftime(${time() + TIME_DIFF * 3600} %H:%M)\]\[To $0\] $1-) @close($fd) } on #-public 739 "*" if (LOG_ON) { if (match($1 $LOGCHANS)) { @:chanfile = [~/logs/] ## [$1\.] ## strftime(%b) ## [.log] if (fexist($chanfile) != 1) { @:fd = open($chanfile w) @write($fd * Logging started on $strftime(%x) at $strftime(${time() + TIME_DIFF * 3600} %H:%M:%S)) @close($fd) } @:fd = open($chanfile w) @write($fd \[$strftime(${time() + TIME_DIFF * 3600} %H:%M)\] <$0> $2-) @close($fd) } } on #-action 385 "*" if (LOG_ON) { if (match($0 $LOGCHANS)) { @:chanfile = [~/logs/] ## [$0\.] ## strftime(%b) ## [.log] if (fexist($chanfile) != 1) { @:fd = open($chanfile w) @write($fd * Logging started on $strftime(%x) at $strftime(${time() + TIME_DIFF * 3600} %H:%M:%S)) @close($fd) } @:fd = open($chanfile w) @write($fd \[$strftime(${time() + TIME_DIFF * 3600} %H:%M)\] * $1-) @close($fd) } } on #-join 578 "*" if (LOG_ON) { if (match($0 $LOGCHANS)) { @:chanfile = [~/logs/] ## [$0\.] ## strftime(%b) ## [.log] if (fexist($chanfile) != 1) { @:fd = open($chanfile w) @write($fd * Logging started on $strftime(%x) at $strftime(${time() + TIME_DIFF * 3600} %H:%M:%S)) @close($fd) } @:fd = open($chanfile w) @write($fd \[$strftime(${time()+3600*TIME_DIFF} %H:%M)\] $1 \($Word($3 $LS)\) \[sharing $2 files\] has joined.) @close($fd) } } on #-leave 853 "*" if (LOG_ON) { if (match ($0 $LOGCHANS)) { @:chanfile = [~/logs/] ## [$0\.] ## strftime(%b) ## [.log] if (fexist($chanfile) != 1) { @:fd = open($chanfile w) @write($fd * Logging started on $strftime(%x) at $strftime(${time() + TIME_DIFF * 3600} %H:%M:%S)) @close($fd) } @:fd = open($chanfile w) @write($fd \[$strftime(${time()+3600*TIME_DIFF} %H:%M)\] $1 \($Word($3 $LS)\) \[sharing $2 files\] has left.) @close($fd) } } on #-timer 363 "00:00" if (LOG_ON) { @:fd = open($SERVERMSG_LOGFILE\.$strftime(%b)\.log w) @write($fd * $strftime(%x)) @close($fd) @:fd = open($MSG_LOGFILE\.$strftime(%b)\.log w) @write($fd * $strftime(%x)) @close($fd) fe ($LOGCHANS) chan { @:fd = open(~/logs/$chan\.$strftime(%b)\.log w) @write($fd * $strftime(%x)) @close($fd) } }