# Daily Logs Written by Snoop_911 # Idea supplied by Gueat # Stunt Coordinater (-_-) and Yellowsuit xecho -b ** Daily Logs Written by Snoop_911 ** # Change the Folder to one of your choice (Make sure it exists) ^assign FOLDER //d/teknap/roomlogs/ # Part of the On/Off function ^assign TRUE 1 ^assign FALSE 0 timer 10 logall_on # Saves all Public Text to File on #^public 44534 "*" { if ([$allow_log]==[1]) { ^assign date $strftime(%Y_%m_%d-) ^assign log_chan $1 ^local log_text $2- ^local fd @ fd = open($LOG_ROOMS($log_chan) w) @ write($fd [$strftime(%B %d %Y %X)] $1:$0:$log_text) @ close($fd) } } # Saves all Emotes to File on #^824 44535 "*" { if ([$allow_log]==[1]) { ^assign date $strftime(%Y_%m_%d-) ^assign log_chan_me $0 ^local log_text $2- ^local fdme @ fdme = open($LOG_ROOMS(log_chan_me) w) @ write($fdme [$strftime(%B %d %Y %X)] Emote\] $0 \/ $1 $tr(/"//$log_text)) @ close($fdme) } } # Saves all Recieved Private Messages to File on #^msg 44536 "*" { if ([$allow_msglog]==[1]) { ^assign date_msgs $strftime(%Y_%m_%d-msgs) ^local log_text $1- ^local fdpms @ fdpms = open($LOG_ROOMS(convert_msgs) w) @ write($fdpms [$strftime(%B %d %Y %X)] Msg Recieved From $0 : $log_text) @ close($fdpms) } } # Saves all Sent Private Messages to File on #^send_msg 44537 "*" { if ([$allow_msglog]==[1]) { ^assign date_msgs $strftime(%Y_%m_%d-msgs) ^local log_text $1- ^local fdpms @ fdpms = open($LOG_ROOMS(convert_msgs) w) @ write($fdpms [$strftime(%B %d %Y %X)] Msg Sent To $0 : $log_text) @ close($fdpms) } } # Saves all Joins to File on #^join 44538 "*" { if ([$allow_log]==[1]) { ^assign date $strftime(%Y_%m_%d-) ^assign log_chan_join $0 ^local fdjoin @ fdjoin = open($LOG_ROOMS(log_chan_join) w) @ write($fdjoin [$strftime(%B %d %Y %X)] ** $1 has joined $0 \($2\/$convert_linespeed($3)\) ** ) @ close($fdjoin) } } # Saves all Leaves to File on #^leave 44539 "*" { if ([$allow_log]==[1]) { ^assign date $strftime(%Y_%m_%d-) ^assign log_chan_part $0 ^local fdpart @ fdpart = open($LOG_ROOMS(log_chan_part) w) @ write($fdpart [$strftime(%B %d %Y %X)] ** $1 has parted $0 \($2\/$convert_linespeed($3)\) ** ) @ close($fdpart) } } # Saves all Ops messages to file on #^404 44540 "% [ops/%]: *" { if ([$allow_log]==[1]) { ^assign date $strftime(%Y_%m_%d-) ^assign log_chan_ops $after(\/ $tr(/:]//$1)) ^local fdops @ fdops = open($LOG_ROOMS(log_chan_ops) w) @ write($fdops [$strftime(%B %d %Y %X)] $tr(/://$1) $0: $2- ) @ close($fdops) } } # Saves all Wallops to file on #^627 44541 "*" { if ([$allow_log]==[1]) { ^assign date_wall $strftime(%Y_%m_%d-Wallop) ^local fdwall @ fdwall = open($LOG_ROOMS(log_chan_wall) w) @ write($fdwall [$strftime(%B %d %Y %X)] *WALLOP* $0 - $1- ) @ close($fdwall) } } # Saves All Announcements to file on #^628 44542 "*" { if ([$allow_log]==[1]) { ^assign date_wall $strftime(%Y_%m_%d-Wallop) ^local fdwall @ fdwall = open($LOG_ROOMS(log_chan_wall) w) @ write($fdwall [$strftime(%B %d %Y %X)] * [Announcement] $0: $1- ) @ close($fdwall) } } # Converts the file name to a useable format alias LOG_ROOMS (chan, void) { switch ($chan) { (convert_msgs) { @ function_return = [$folder$date_msgs\.txt] } (log_chan_me) { @ function_return = [$folder$date$tr(/#//$log_chan_me)\.txt] } (log_chan_join) { @ function_return = [$folder$date$tr(/#//$log_chan_join)\.txt] } (log_chan_part) { @ function_return = [$folder$date$tr(/#//$log_chan_part)\.txt] } (log_chan_ops) { @ function_return = [$folder$date$tr(/#//$log_chan_ops)\.txt] } (log_chan_wall) { @ function_return = [$folder$date_wall\.txt] } (*) { @ function_return = [$folder$date$tr(/#//$log_chan)\.txt] } } } # Converts the line Speed for Parts and Joins alias convert_linespeed (speed, void) { switch ($speed) { (0) {@ function_return = [Unknown]} (1) {@ function_return = [14.4]} (2) {@ function_return = [28.8]} (3) {@ function_return = [33.6]} (4) {@ function_return = [56K]} (5) {@ function_return = [ISDN-64K]} (6) {@ function_return = [ISDN-128K]} (7) {@ function_return = [Cable]} (8) {@ function_return = [DSL]} (9) {@ function_return = [T1]} (10) {@ function_return = [T3+]} (*) {@ function_return = []} } } # On and Off switches for RoomLog alias roomlog_on { ^assign allow_log $true xecho -b Room Log On } alias roomlog_off { ^assign allow_log $false xecho -b Room Log Off } # On and Off switches for MsgLog alias msglog_on { ^assign allow_msglog $true xecho -b Message Log On } alias msglog_off { ^assign allow_msglog $false xecho -b Message Log Off } # On and Off switches for All Logs alias logall_on { ^assign allow_msglog $true ^assign allow_log $true xecho -b Message Log On xecho -b Room Log On } alias logall_off { ^assign allow_msglog $false ^assign allow_log $false xecho -b Message Log Off xecho -b Room Log Off }