This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Logging Verbose to a txt file?

Old posts that have not been replied to for several years.
Locked
G
Gothic-Angel
Op
Posts: 109
Joined: Mon Sep 23, 2002 9:46 pm

Logging Verbose to a txt file?

Post by Gothic-Angel »

I found a tcl by WCC to send verbose's done in a channel to an email. However I was wondering if someone could help me modify it to log it to a text file?

here is the tcl

Code: Select all

set verbosemail_setting(address) "wcc@techmonkeys.org"
set verbosemail_setting(subject) "\[%date %time\] VerboseMail"
set verbosemail_setting(bold) 1
set verbosemail_setting(VERBOSEMAIL:) 1


if {![string match 1.6.* $version]} { putlog "\002VERBOSEMAIL:\002 \002WARNING:\002 This script is intended to run on eggdrop 1.6.x or later." }
if {[info tclversion] < 8.2} { putlog "\002VERBOSEMAIL:\002 \002WARNING:\002 This script is intended to run on Tcl Version 8.2 or later." }

bind notc - "*\[VERBOSE\]*" verbosemail_mail

proc verbosemail_dopre {} {
	if {!$::verbosemail_setting(VERBOSEMAIL:)} { return "" }
	if {!$::verbosemail_setting(bold)} { return "VERBOSEMAIL: " }
	return "\002VERBOSEMAIL:\002 "
}
proc verbosemail_mail {nick uhost hand text dest} {
	if {[string compare [string tolower $nick] chanserv] != 0} { return }
	if {[catch {exec which mail}]} { putlog "[verbosemail_dopre]Error: This system does not support 'mail'." ; return }
	if {[catch {open verbosemail.temp w} mail]} { putlog "[verbosemail_dopre]Error: Could not open verbosemail.temp." ; return }
	puts $mail $text ; close $mail
	regsub -all -- "%botnick" $::verbosemail_setting(subject) $::botnick subject
	regsub -all -- "%date" $subject [clock format [clock seconds] -format "%D"] subject
	regsub -all -- "%time" $subject [clock format [clock seconds] -format "%I:%M %p"] subject
	if {[catch {exec mail $::verbosemail_setting(address) -s $subject < verbosemail.temp} error]} { putlog "[verbosemail_dopre]Error: $error" }
	if {[catch {file delete -force verbosemail.temp}]} { putlog "[verbosemail_dopre]Error: Could not delete verbosemail.temp." }
}
S
Speak-ezy

Post by Speak-ezy »

Did you find a solution?
Locked