I'm working with the abuse script that H@0 made, I was looking to make some additions to it like OnDeop and OnBan here's what I have so far..
I'm not 100% sure with the OnDeop or OnBan as I don't know the args or the bind to use =x
Code: Select all
# abuse user report by H@0 ver 1.0.
# configuration
# variables
set validchannel "#reportcentre"
set abuselogfile "logs/abuse.log"
if {![info exists validchannel]} {die "ERROR:Check back again in set validchannel settings.."}
set arg.v "Abuse User Report"
# bindings
bind KICK - * abuse_kick
bind NEED - "* -o" abuse_deop
bind PUB n -history abuse_report
# source (again DO NOT change anything if you are not 100% sure)
# process kicked
proc abuse_kick {nick host handle chan who excuse} {
global abuselogfile botnick validchannel
if {$who != $botnick} {return 0}
set data "Info: Kick $botnick by $nick from $chan with excuse ($excuse)"
if {$abuselogfile != ""} {set r [open $abuselogfile a+]; puts $r "[strftime "%d %b %Y, %H:%M %z"]: $data"; close $r}
putquick "privmsg $validchannel :Important: (Bot: $botnick) (Action: Kicked) (Channel: $chan) (Reason: $excuse) (User: $nick)"
return 0
}
# process deopped
proc abuse_deop {nick uhost handle chan arg} {
global abuselogfile botnick validchannel
if {$who != $botnick} {return 0}
set data "Info: Deop $botnick by $nick in $chan"
if {$abuselogfile != ""} {set r [open $abuselogfile a+]; puts $r "[strftime "%d %b %Y, %H:%M %z"]: $data"; close $r}
putquick "privmsg $validchannel :Important: (Bot: $botnick) (Action: Deopped) (Channel: $chan) (User: $nick)"
return 0
}
# process report
proc abuse_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 "privmsg $validchannel :Error: There is no history for $botnick."
return 0
}
putserv "privmsg $validchannel :Log History for $botnick:"
foreach tmp $abuselist {
putserv "privmsg $validchannel :$tmp"
}
putserv "privmsg $validchannel : End of Abuselist\n"
return 0
}