#####################################################
# Opciones:
# Establece los canales en los que quieres comprobar los usuarios
# incluye el "#" y sepáralos con un espacio. EG set checkchans "#chan1 #chan3 #otherchan"
set checkchans "#mojo-picon"
# Palabras de los canales que serán prohibidos, separadas por un espacio. Si pones set badchans "badc list"
# los canales que serán baneados son #badchan #chanbadc #listchan #chanthatlists etc ......
set badchans "#chan #chan1 #chan2 #chan3 #chan3 #chan3"
# Minutos entre cada comprobación completa de un canal. NOTA - ¡No pongas este valor bajo si tienes mucha gente!
# Esto es una gran carga para el servidor/bot, así que no seas un idiota y comprueba cada 1 minuto en un canal con 100 personas.
# El bot se retrasará (o será k-lined)
set intervalcheck 5
# Duración de la prohibición por estar en el canal equivocado (en minutos)
set idiotbantime 720
# La razón que aparece en la lista de baneos. También se utiliza cuando el bot les manda un mensaje diciendo por cuánto tiempo fueron baneados y por qué.
set banmsg "Actividad no permitida"
#####################################################
# FIN DE LAS OPCIONES
# ¡No edite nada de lo que hay aquí abajo a menos que esté haciendo un cambio de versión!
#####################################################
bind JOIN - * banchan:join
bind RAW - 319 banchan:response
bind RAW - 353 banchan:names
if {[string match "*banchan:scan*" [timers]] == 0} {
timer $intervalcheck banchan:scan
}
proc banchan:names {from keyword nicklist} {
global checkchans
set nicklist [banchan:charfilter $nicklist]
set nicklist [lrange $nicklist 3 end]
set chanfrom ""
append chanfrom "*" [lindex $nicklist 2] "*"
set chanfrom [string tolower $chanfrom]
if {[string match $chanfrom $checkchans]} {
return 1
}
set currnicknum 0
set currentnick "b4"
while {$currentnick != ""} {
set currentnick [lindex $nicklist $currnicknum]
if {[string range $currentnick 0 0] == "@" || [string range $currentnick 0 0] == "+" || [string range $currentnick 0 0] == ":"} {
set currentnick [string range $currentnick 1 end]
}
if {[string range $currentnick 0 0] == "@" || [string range $currentnick 0 0] == "+" || [string range $currentnick 0 0] == ":"} {
set currentnick [string range $currentnick 1 end]
}
putserv "WHOIS $currentnick"
incr currnicknum
}
}
proc banchan:scan { } {
global checkchans intervalcheck
set tocheck [string tolower $checkchans]
set ccnum 0
set total [llength $tocheck]
while {$ccnum < $total} {
putlog "BanChan: Scanning [lindex $tocheck $ccnum]"
putserv "NAMES [lindex $tocheck $ccnum]"
incr ccnum
}
if {[string match "*banchan:scan*" [timers]] == 0} {
timer $intervalcheck banchan:scan
}
}
proc banchan:join {nick uhost handle channel} {
global checkchans
set checkchans [string tolower $checkchans]
set channel [string tolower $channel]
set matchpattern "*$channel*"
if {[string match $matchpattern $checkchans] == 1} {
putserv "WHOIS $nick"
return 0
} else {
return 0
}
}
proc banchan:response {from keyword arg} {
global badchans banmsg idiotbantime checkchans
set badchans [string tolower $badchans]
set badchans [concat $badchans]
set arg [banchan:charfilter $arg]
set currentchannel "empty"
set chanlistnum 2
set nick [lindex $arg 1]
set matchpattern ""
while {$currentchannel != ""} {
set currentchannel [lindex $arg $chanlistnum]
set currentchannel [string tolower $currentchannel]
if {$currentchannel == ""} {
break
}
if {$chanlistnum == 2} {
set currentchannel [string range $currentchannel 1 end]
}
if {[string range $currentchannel 0 0] == "@" || [string range $currentchannel 0 0] == "+"} {
set currentchannel [string range $currentchannel 1 end]
}
set currentbannum 0
while {[llength $badchans] > $currentbannum} {
set matchpattern "*[lindex $badchans $currentbannum]*"
if {[string match $matchpattern $currentchannel]} {
set uhost [getchanhost $nick]
if {$uhost == ""} {
return 0
}
set tempi [expr [string first @ $uhost] + 1]
set uhost "*!*@[string range $uhost $tempi end]"
set chantomsglist [string tolower $checkchans]
set chantomsgnum 0
while {$chantomsgnum < [llength $chantomsglist]} {
set currentchantomsg [lindex $chantomsglist $chantomsgnum]
if {[onchan $nick $currentchantomsg] == 1} {
putserv "PRIVMSG $currentchantomsg"
}
incr chantomsgnum
}
utimer 5 [banchan:delayedban $uhost]
putserv "PRIVMSG $nick :no eres bien recibid@ ($currentchannel)."
return 0
}
incr currentbannum
}
incr chanlistnum
}
return 0
}
proc banchan:delayedban { banhost } {
global banmsg idiotbantime
newban $banhost "BanChan3.2" "$banmsg" $idiotbantime
}
proc banchan:charfilter {x {y ""}} {
for {set i 0} {$i < [string length $x]} {incr i} {
switch -- [string index $x $i] {
"\"" {append y "\\\""}
"\\" {append y "\\\\"}
"\[" {append y "\\\["}
"\]" {append y "\\\]"}
"\{" {append y "\\\{"}
"\}" {append y "\\\}"}
default {append y [string index $x $i]}
}
}
return $y
}
putlog "Anticanales Cargado Correctamente"
#####################################################
# Opciones:
# Establece los canales en los que quieres comprobar los usuarios
# incluye el "#" y sepáralos con un espacio. EG set checkchans "#chan1 #chan3 #otherchan"
set checkchans "#mojo-picon"
# Palabras de los canales que serán prohibidos, separadas por un espacio. Si pones set badchans "badc list"
# los canales que serán baneados son #badchan #chanbadc #listchan #chanthatlists etc ......
set badchans "#chan #chan1 #chan2 #chan3 #chan3 #chan3"
# Minutos entre cada comprobación completa de un canal. NOTA - ¡No pongas este valor bajo si tienes mucha gente!
# Esto es una gran carga para el servidor/bot, así que no seas un idiota y comprueba cada 1 minuto en un canal con 100 personas.
# El bot se retrasará (o será k-lined)
set intervalcheck 5
# Duración de la prohibición por estar en el canal equivocado (en minutos)
set idiotbantime 720
# La razón que aparece en la lista de baneos. También se utiliza cuando el bot les manda un mensaje diciendo por cuánto tiempo fueron baneados y por qué.
set banmsg "Actividad no permitida"
#####################################################
# FIN DE LAS OPCIONES
# ¡No edite nada de lo que hay aquí abajo a menos que esté haciendo un cambio de versión!
#####################################################
bind join - * ON:Join:AccessChecK
bind RAW - 319 banchan:response
bind RAW - 353 banchan:names
proc ON:Join:AccessChecK {nick uhost hand chan} {
after [expr {2*1000*1}] [list banchan:join $nick $uhost $hand $chan]
}
if {[string match "*banchan:scan*" [timers]] == 0} {
timer $intervalcheck banchan:scan
}
proc banchan:names {from keyword nicklist} {
global checkchans
set nicklist [banchan:charfilter $nicklist]
set nicklist [lrange $nicklist 3 end]
set chanfrom ""
append chanfrom "*" [lindex $nicklist 2] "*"
set chanfrom [string tolower $chanfrom]
if {[string match $chanfrom $checkchans]} {
return 1
}
set currnicknum 0
set currentnick "b4"
while {$currentnick != ""} {
set currentnick [lindex $nicklist $currnicknum]
if {[string range $currentnick 0 0] == "@" || [string range $currentnick 0 0] == "+" || [string range $currentnick 0 0] == ":"} {
set currentnick [string range $currentnick 1 end]
}
if {[string range $currentnick 0 0] == "@" || [string range $currentnick 0 0] == "+" || [string range $currentnick 0 0] == ":"} {
set currentnick [string range $currentnick 1 end]
}
putserv "WHOIS $currentnick"
incr currnicknum
}
}
proc banchan:scan { } {
global checkchans intervalcheck
set tocheck [string tolower $checkchans]
set ccnum 0
set total [llength $tocheck]
while {$ccnum < $total} {
putlog "BanChan: Scanning [lindex $tocheck $ccnum]"
putserv "NAMES [lindex $tocheck $ccnum]"
incr ccnum
}
if {[string match "*banchan:scan*" [timers]] == 0} {
timer $intervalcheck banchan:scan
}
}
proc banchan:join {nick uhost handle channel} {
global checkchans
set checkchans [string tolower $checkchans]
set channel [string tolower $channel]
set matchpattern "*$channel*"
if {[string match $matchpattern $checkchans] == 1 && ![isop $nick $channel] && ![ishalfop $nick $channel] && ![isvoice $nick $channel] && ![isbotnick $nick] && ![matchattr [nick2hand $nick] of|of $channel]} {
putserv "WHOIS $nick"
return 0
} else {
return 0
}
}
proc banchan:response {from keyword arg} {
global badchans banmsg idiotbantime checkchans
set badchans [string tolower $badchans]
set badchans [concat $badchans]
set arg [banchan:charfilter $arg]
set currentchannel "empty"
set chanlistnum 2
set nick [lindex $arg 1]
set matchpattern ""
while {$currentchannel != ""} {
set currentchannel [lindex $arg $chanlistnum]
set currentchannel [string tolower $currentchannel]
if {$currentchannel == ""} {
break
}
if {$chanlistnum == 2} {
set currentchannel [string range $currentchannel 1 end]
}
if {[string range $currentchannel 0 0] == "@" || [string range $currentchannel 0 0] == "+"} {
set currentchannel [string range $currentchannel 1 end]
}
set currentbannum 0
while {[llength $badchans] > $currentbannum} {
set matchpattern "*[lindex $badchans $currentbannum]*"
if {[string match $matchpattern $currentchannel]} {
set uhost [getchanhost $nick]
if {$uhost == ""} {
return 0
}
set tempi [expr [string first @ $uhost] + 1]
set uhost "*!*@[string range $uhost $tempi end]"
set chantomsglist [string tolower $checkchans]
set chantomsgnum 0
while {$chantomsgnum < [llength $chantomsglist]} {
set currentchantomsg [lindex $chantomsglist $chantomsgnum]
if {[onchan $nick $currentchantomsg] == 1} {
putserv "PRIVMSG $currentchantomsg"
}
incr chantomsgnum
}
if {![isop $nick $chan] && ![ishalfop $nick $chan] && ![matchattr $hand o|o $chan]} { return 0 }
utimer 5 [banchan:delayedban $uhost]
putserv "PRIVMSG $nick :no eres bien recibid@ ($currentchannel)."
return 0
}
incr currentbannum
}
incr chanlistnum
}
return 0
}
proc banchan:delayedban { banhost } {
global banmsg idiotbantime
newban $banhost "BanChan3.2" "$banmsg" $idiotbantime
}
proc banchan:charfilter {x {y ""}} {
for {set i 0} {$i < [string length $x]} {incr i} {
switch -- [string index $x $i] {
"\"" {append y "\\\""}
"\\" {append y "\\\\"}
"\[" {append y "\\\["}
"\]" {append y "\\\]"}
"\{" {append y "\\\{"}
"\}" {append y "\\\}"}
default {append y [string index $x $i]}
}
}
return $y
}
putlog "Anticanales Cargado Correctamente"
#####################################################
# Opciones:
# Establece los canales en los que quieres comprobar los usuarios
# incluye el "#" y sepáralos con un espacio. EG set checkchans "#chan1 #chan3 #otherchan"
set checkchans "#mojo-picon"
# Palabras de los canales que serán prohibidos, separadas por un espacio. Si pones set badchans "badc list"
# los canales que serán baneados son #badchan #chanbadc #listchan #chanthatlists etc ......
set badchans "#chan #chan1 #chan2 #chan3 #chan3 #chan3"
# Minutos entre cada comprobación completa de un canal. NOTA - ¡No pongas este valor bajo si tienes mucha gente!
# Esto es una gran carga para el servidor/bot, así que no seas un idiota y comprueba cada 1 minuto en un canal con 100 personas.
# El bot se retrasará (o será k-lined)
set intervalcheck 5
# Duración de la prohibición por estar en el canal equivocado (en minutos)
set idiotbantime 720
# La razón que aparece en la lista de baneos. También se utiliza cuando el bot les manda un mensaje diciendo por cuánto tiempo fueron baneados y por qué.
set banmsg "Actividad no permitida"
#####################################################
# FIN DE LAS OPCIONES
# ¡No edite nada de lo que hay aquí abajo a menos que esté haciendo un cambio de versión!
#####################################################
bind JOIN - * ON:Join:AccessChecK
bind RAW - 319 banchan:response
bind RAW - 353 banchan:names
proc ON:Join:AccessChecK {nick uhost hand chan} {
after [expr {2*1000*1}] [list banchan:join $nick $uhost $hand $chan]
}
if {[string match "*banchan:scan*" [timers]] == 0} {
timer $intervalcheck banchan:scan
}
proc banchan:names {from keyword nicklist} {
global checkchans
set nicklist [banchan:charfilter $nicklist]
set nicklist [lrange $nicklist 3 end]
set chanfrom ""
append chanfrom "*" [lindex $nicklist 2] "*"
set chanfrom [string tolower $chanfrom]
if {[string match $chanfrom $checkchans]} {
return 1
}
set currnicknum 0
set currentnick "b4"
while {$currentnick != ""} {
set currentnick [lindex $nicklist $currnicknum]
if {[string range $currentnick 0 0] == "@" || [string range $currentnick 0 0] == "+" || [string range $currentnick 0 0] == ":"} {
set currentnick [string range $currentnick 1 end]
}
if {[string range $currentnick 0 0] == "@" || [string range $currentnick 0 0] == "+" || [string range $currentnick 0 0] == ":"} {
set currentnick [string range $currentnick 1 end]
}
putserv "WHOIS $currentnick"
incr currnicknum
}
}
proc banchan:scan { } {
global checkchans intervalcheck
set tocheck [string tolower $checkchans]
set ccnum 0
set total [llength $tocheck]
while {$ccnum < $total} {
putlog "BanChan: Scanning [lindex $tocheck $ccnum]"
putserv "NAMES [lindex $tocheck $ccnum]"
incr ccnum
}
if {[string match "*banchan:scan*" [timers]] == 0} {
timer $intervalcheck banchan:scan
}
}
proc banchan:join {nick uhost handle channel} {
global checkchans
set checkchans [string tolower $checkchans]
set channel [string tolower $channel]
set matchpattern "*$channel*"
if {[string match $matchpattern $checkchans] == 1 && ![isop $nick $channel] && ![ishalfop $nick $channel] && ![isvoice $nick $channel] && ![isbotnick $nick] && ![matchattr [nick2hand $nick] of|of $channel]} {
putserv "WHOIS $nick"
return 0
} else {
return 0
}
}
proc banchan:response {from keyword arg} {
global badchans banmsg idiotbantime checkchans
set badchans [string tolower $badchans]
set badchans [concat $badchans]
set arg [banchan:charfilter $arg]
set currentchannel "empty"
set chanlistnum 2
set nick [lindex $arg 1]
set matchpattern ""
while {$currentchannel != ""} {
set currentchannel [lindex $arg $chanlistnum]
set currentchannel [string tolower $currentchannel]
if {$currentchannel == ""} {
break
}
if {$chanlistnum == 2} {
set currentchannel [string range $currentchannel 1 end]
}
if {[string range $currentchannel 0 0] == "@" || [string range $currentchannel 0 0] == "+"} {
set currentchannel [string range $currentchannel 1 end]
}
set currentbannum 0
while {[llength $badchans] > $currentbannum} {
set matchpattern "*[lindex $badchans $currentbannum]*"
if {[string match $matchpattern $currentchannel]} {
set uhost [getchanhost $nick]
if {$uhost == ""} {
return 0
}
set tempi [expr [string first @ $uhost] + 1]
set uhost "*!*@[string range $uhost $tempi end]"
set chantomsglist [string tolower $checkchans]
set chantomsgnum 0
while {$chantomsgnum < [llength $chantomsglist]} {
set currentchantomsg [lindex $chantomsglist $chantomsgnum]
if {[onchan $nick $currentchantomsg] == 1} {
putserv "PRIVMSG $currentchantomsg"
}
incr chantomsgnum
}
utimer 5 [banchan:delayedban $uhost]
putserv "PRIVMSG $nick :no eres bien recibid@ ($currentchannel)."
return 0
}
incr currentbannum
}
incr chanlistnum
}
return 0
}
proc banchan:delayedban { banhost } {
global banmsg idiotbantime
newban $banhost "BanChan3.2" "$banmsg" $idiotbantime
}
proc banchan:charfilter {x {y ""}} {
for {set i 0} {$i < [string length $x]} {incr i} {
switch -- [string index $x $i] {
"\"" {append y "\\\""}
"\\" {append y "\\\\"}
"\[" {append y "\\\["}
"\]" {append y "\\\]"}
"\{" {append y "\\\{"}
"\}" {append y "\\\}"}
default {append y [string index $x $i]}
}
}
return $y
}
putlog "Anticanales Cargado Correctamente"
hello simo
I killed eggdrop again, made the changes you recommended and now it's back to how it was at the beginning, it kicks everything, it doesn't distinguish, I even removed @ from the eggdrop and with the voice it sends the message
and it does not release an error in the partyline
all i did really was add a delay on join for the bot to determine if nick isn an chanop/halfop or not and send a whois if not an chanop/halfop or any access to bot.
Simo. thanks for answering
I understand but it doesn't work, this last help you provide doesn't do anything at all, kick it and send the message without further ado.
I had a look to the script... It could be better.
I think I can redo it, just need to be sure:
The users which are in $checkchans must not be in $badchans, and check is performed on join and each 5 minutes.
And you want to exclude ops (and halfops ?) of the check/ban ?
hello crazycat i did what you suggested and after a while of starting the eggdrop in the partyline i got an error :
Warning: over maximum server queue!
Tcl error [::badchan::respnames]: invalid command name ‘lmap’.
Tcl error [::badchan::respnames]: can't read "cusers": no such variable
I also get this list of nicknames that are not in any of the rooms where bccheck was activated and the test nickname is not in those rooms either.
you also have to consider too much use of commands: names and whois may result in disconnecting due to exceeding server commands limits, so not sure what the max stackable value is wich can be used to send whois in a line on the network you use it on, if you can provide those limits it may be integrated into the code to stay within server limits.
not to belittle the help, but the tcl that i presented at the beginning works great. just add that it does not ban the ops because that is what it lacks and i am happy that it works well.
Tcl error in file 'Rebujado.conf':
can't read "from": no such variable
while executing
"putlog "$from - $kw - $text""
(in namespace eval "::badchan" script line 113)
invoked from within
"namespace eval badchan {
# .chanset #channel +bccheck to enable
# lista de canales "malos"
variable bclist "#chan #chan1 #chan2..."
(file "scripts/maloscanales.tcl" line 1)
invoked from within