Code: Select all
set timelmtvar ""
bind dcc m bugreport away:bugreport
proc away:bugreport {hand idx arg} {
global botname botnick galaxy_away timelmtvar version server
if {$arg == ""} {
putdcc $idx "Syntax: .bugreport <msg>"
return 1
}
if {[llength $arg] <=8} {
putdcc $idx "** Your Bug Report/Help Request or Suggestion is too short, message not sent! For more information, you may use ".ahelp bugreport" for assistance."
return 1
}
if {[expr $timelmtvar + 120] >= [unixtime]} {
putdcc $idx "** You cannot send more than 1 bug report/help request or suggestion every 2 minutes. For more information, you may use ".ahelp bugreport" for assistance."
return 0
}
set timelmtvar [unixtime]
set x [open ".sendrpt" w]
catch {set email [getuser $hand XTRA email]}
set hostname ""
set uname ""
catch {set hostname "on [info hostname] "}
catch {set uname "[unames] "}
puts $x "$arg"
puts $x "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
puts $x "This message is from $hand@$botnick ($email)"
puts $x "Running $galaxy_away(script) $galaxy_away(version) on Eggdrop[lindex $version 0] $hostname$unamew/ tcl[info tclversion]"
puts $x "Online as $botname on $server"
puts $x "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
close $x
set bug [open "|mail -s "BugReport from $hand@$botnick ($email)" plexus@purehype.net < .sendrpt" r]
while {![eof $bug]} {
catch {set responce [gets $bug]}
if {$responce == ""} {
putdcc $idx "Bug Report, Help Request Or Suggestion Sent Successfully."
} else {
putdcc $idx "Mail returned message/error: $responce"
putdcc $idx "For more information, you may use ".ahelp bugreport" for assistance."
}
}
catch {close $bug}
return 1
}
<font size=-1>[ This Message was edited by: Stafford on 2002-03-14 08:35 ]</font>