########################################################################
# AbuseReport 1.0
#
#This TCL shows the channel where the bot has problems
#!report abused ( shows the channels where the bot is not on chan )
#!report deoped ( shows the channels where the bot has no op )
#!report users ( shows the channels where the limit of the users is not # achived. You can set the limit of users in the TCL)
#
# BLaCkShaDoW ProductionS
#######################################################################
#Here you can set the first char of the command
set report(char) "~"
#Here you set the limit of users. If a chan doesent have a number a #users higher than the one you set , you will see the chan on #executing the !report users command
set report(minusers) "15"
#Here you can set the flags to use this command
set report(flags) "n"
#######################################################################
setudef flag report
setudef flag chanserv
bind pub $report(flags) $report(char)report reporting
proc reporting {nick host hand chan arg} {
if {(![authed $hand])} {return 0}
global report botnick
set sta ""
set ::chan $chan
set ew [lindex [split $arg] 0]
set number [llength [channels]]
if {[channel get $chan report]} {
if {$arg == ""} { puthelp "NOTICE $nick :Please use : $report(char)report <abused> | <deoped> | <users> ."
return 0
}
if {([regexp -nocase -- {(#[0-9]+|abused|deoped|users)} $ew tmp reported]) && (![regexp -nocase -- {\S#} $ew])} {
switch $reported {
abused {
foreach c [channels] {
if {[onchan $botnick $c]} {set sta 1} else { lappend ab $c }
}
if {[info exists ab]} {
puthelp "PRIVMSG $chan :I am not on this channels :\002[join $ab ", "]\002."
} else {
puthelp "PRIVMSG $chan :I dont have any chan in my list."
}
}
deoped {
foreach c [channels] {
if {[onchan $botnick $c]} {
if {[botisop $c]} { set sta 1 } else { lappend noopchans $c }
}
}
if {[info exists noopchans]} {
puthelp "PRIVMSG $chan :Channels where i am not OP are: \002[join $noopchans ", "]\002."
} else {
puthelp "PRIVMSG $chan :I dont have any chan in my list"
}
}
users {
foreach c [channels] {
if {[onchan $botnick $c]} {
set usersnumber [llength [chanlist $c]]
if {$usersnumber < $report(minusers)} {
lappend minuserschans $c
}
}
}
if {[info exists minuserschans]} {
puthelp "PRIVMSG $chan :The channels with a number of users lower than $report(minusers) are: \002[join $minuserschans ", "]\002."
} else {
puthelp "PRIVMSG $chan :I dont have any chan in my list."
}
}
}
}
}
}
putlog "AbuseReport Tcl 1.0 by BLaCkShaDoW Loaded"
What I'm trying to do is to add an exception list for some channels that i would specify, only for the part report users. (Thats the part where it reports if the minimum user count on channels is below a set value.)
I have tried to set a list of channels, and then to let the script perform an lsearch with a foreach when i realized, that I had no idea how to make exempts. :p
If this is not too complicated, i would appreciate some help on this.
########################################################################
# AbuseReport 1.0
#
#This TCL shows the channel where the bot has problems
#!report abused ( shows the channels where the bot is not on chan )
#!report deoped ( shows the channels where the bot has no op )
#!report users ( shows the channels where the limit of the users is not # achived. You can set the limit of users in the TCL)
#
# BLaCkShaDoW ProductionS
#######################################################################
#Here you can set the first char of the command
set report(char) "~"
#Here you set the limit of users. If a chan doesent have a number a #users higher than the one you set , you will see the chan on #executing the !report users command
set report(minusers) "15"
#Here you can set the flags to use this command
set report(flags) "n"
setudef flag except
#######################################################################
setudef flag report
setudef flag chanserv
bind pub $report(flags) $report(char)report reporting
proc reporting {nick host hand chan arg} {
if {(![authed $hand])} {return 0}
global report botnick
set sta ""
set ::chan $chan
set ew [lindex [split $arg] 0]
set number [llength [channels]]
if {[channel get $chan report]} {
if {$arg == ""} { puthelp "NOTICE $nick :Please use : $report(char)report <abused> | <deoped> | <users> ."
return 0
}
if {([regexp -nocase -- {(#[0-9]+|abused|deoped|users)} $ew tmp reported]) && (![regexp -nocase -- {\S#} $ew])} {
switch $reported {
abused {
foreach c [channels] {
if {[onchan $botnick $c]} {set sta 1} else { lappend ab $c }
}
if {[info exists ab]} {
puthelp "PRIVMSG $chan :I am not on this channels :\002[join $ab ", "]\002."
} else {
puthelp "PRIVMSG $chan :I dont have any chan in my list."
}
}
deoped {
foreach c [channels] {
if {[onchan $botnick $c]} {
if {[botisop $c]} { set sta 1 } else { lappend noopchans $c }
}
}
if {[info exists noopchans]} {
puthelp "PRIVMSG $chan :Channels where i am not OP are: \002[join $noopchans ", "]\002."
} else {
puthelp "PRIVMSG $chan :I dont have any chan in my list"
}
}
users {
foreach c [channels] {
if {![channel get $c except]} {
if {[onchan $botnick $c]} {
set usersnumber [llength [chanlist $c]]
if {$usersnumber < $report(minusers)} {
lappend minuserschans $c
}
}
}
}
if {[info exists minuserschans]} {
puthelp "PRIVMSG $chan :The channels with a number of users lower than $report(minusers) are: \002[join $minuserschans ", "]\002."
} else {
puthelp "PRIVMSG $chan :I dont have any chan in my list."
}
}
}
}
}
}
putlog "AbuseReport Tcl 1.0 by BLaCkShaDoW Loaded"