#author Ha0
set validchannel "#mychan"
set abuselogfile "Abuse.txt"
if {![info exists validchannel]} {die "ERROR:Check back again in set validchannel settings.."}
set arg.v "Abuse User Report"
bind kick - * bot_abuse_kick
bind pub n !report abuse_user_report
proc bot_abuse_kick {nick host handle chan who excuse} {
global abuselogfile botnick validchannel
if {$who != $botnick} {return 0}
set data "$nick ($handle) kicked me from $chan for: $excuse"
if {$abuselogfile != ""} {set r [open $abuselogfile a+]; puts $r "[strftime "%d %b %Y, %H:%M %z"]: $data"; close $r}
putserv "privmsg $validchannel :\[$nick\] (\002$handle\002) kicked me from \002$chan\002 for: \002$excuse\002"
return 0
}
proc abuse_user_report {nick host handle channel var} {
global abuselogfile botnick validchannel
set fd [open $abuselogfile r]
set abuselist { }
while {![eof $fd]} {
set tmp [gets $fd]
if {[eof $fd]} {break}
set abuselist [lappend abuselist [string trim $tmp]]
}
close $fd
if {[llength $abuselist] == 0} {
putserv "notice $nick :No such list of abuse in database."
return 0
}
putserv "notice $nick :List Of Abuse\n"
foreach tmp $abuselist {
putserv "notice $nick :- $tmp"
}
putserv "notice $nick : End of Abuselist\n"
return 0
}
putlog "${arg.v} loaded Successfuly..."
Thanks in advance
Last edited by elisca on Thu Feb 01, 2007 6:18 pm, edited 1 time in total.
Since validchannel is only used as target for a privmsg, I guess you could put any valid target according to rfc1459; such as multiple targets (think most servers these days permit up to 5):