sYpHx
16.07.2006, 18:10
also ich hab n badword script
an sich funzt auch alles gut
nur spamt der mich dauernd mit ner fehler meldung zu und ich finde die ursache nich
und ich dreh noch durch bei den ganzen meldungen ^^
also der fehler is der:
Tcl error [word_fct]: can't read "kill": no such variable
# description: Kicks/Bans people who says bad words. Words are stored in file. Op protect is allowed. You can add new words without rehash/restart.
# Author: Tomekk
# e-mail: tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.2
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html
# default ban type is: *!*ident*@some.domain.com [4]
# added: 4 ban types
# fixed: some code fixes
# sets ban type
# 1) *!*@*.domain.com
# 2) *!*@some.domain.com
# 3) *nick*!*@some.domain.com
# 4) *!*ident*@some.domain.com
set btype 4
# 1 - protect ops, 0 - dont
set protectops "1"
# 1 - enable ban, 0 - disable ban
set want_ban "1"
# wait $wait times before ban
set wait "0"
# base directory
set dirname "badwords.db"
# kick message
set msg "bad word!"
# users directory
set usersdir "$dirname/lusers"
# dbase with bad words
set dbase "words_bank.db"
if {[file exists $dirname] == 0} {
file mkdir $dirname
set crtdb [open $dirname/$dbase a+]
puts $crtdb "fuck\nshit"
close $crtdb
}
if {[file exists $usersdir] == 0} {
file mkdir $usersdir
}
proc create_db { dbname definfo } {
if {[file exists $dbname] == 0} {
set crtdb [open $dbname a+]
puts $crtdb "$definfo"
close $crtdb
}
}
proc readdb { rdb } {
global ident times
set fs_open [open $rdb r]
gets $fs_open dbout
close $fs_open
set separate [split $dbout "&"]
set ident [lindex $separate 0]
set times [lindex $separate 1]
}
bind pubm - * word_fct
proc word_fct { nick uhost hand chan arg } {
global botnick dbase dirname protectops usersdir times ident wait want_ban msg
set f [open $dirname/$dbase]
set allwords [read $f]
close $f
set nasty_words [split $allwords "\n"]
if {[isop $botnick $chan]} {
foreach i [string tolower $nasty_words] {
if {$i != ""} {
if {[string match *$i* [string tolower $arg]]} {
if {$protectops == "0"} {
set kill "1"
} {
if {[isop $nick $chan] == "1"} {
continue
} {
set kill "1"
}
}
}
}
}
if {$kill == "1"} {
if {$want_ban == "1"} {
if {[file exists $usersdir/$nick] == 0} {
create_db "$usersdir/$nick" "$uhost&1"
} {
readdb "$usersdir/$nick"
file delete $usersdir/$nick
set overall [expr $times + 1]
create_db "$usersdir/$nick" "$ident&$overall"
readdb "$usersdir/$nick"
set player_ident "[banmask $uhost $nick]"
if {"$uhost" == "$ident"} {
if {$times >= $wait} {
putquick "MODE $chan +b $player_ident"
file delete $usersdir/$nick
}
} {
file delete $usersdir/$nick
create_db "$usersdir/$nick" "$uhost&1"
}
}
}
putkick $chan $nick $msg
}
}
}
proc banmask {host nick} {
global btype
switch -- $btype {
1 {
set mask "*!*@[lindex [split [maskhost $host] "@"] 1]"
}
2 {
set mask "*!*@[lindex [split $host @] 1]"
}
3 {
set mask "*$nick*!*@[lindex [split $host "@"] 1]"
}
4 {
set mask "*!*[lindex [split $host "@"] 0]*@[lindex [split $host "@"] 1]"
}
return $mask
}
}
putlog "tkbadword.tcl ver 0.2 by Tomekk loaded :: ficken? xD"
wäre echt gut wen mir wer helfen könnt :)
mfg
an sich funzt auch alles gut
nur spamt der mich dauernd mit ner fehler meldung zu und ich finde die ursache nich
und ich dreh noch durch bei den ganzen meldungen ^^
also der fehler is der:
Tcl error [word_fct]: can't read "kill": no such variable
# description: Kicks/Bans people who says bad words. Words are stored in file. Op protect is allowed. You can add new words without rehash/restart.
# Author: Tomekk
# e-mail: tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.2
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html
# default ban type is: *!*ident*@some.domain.com [4]
# added: 4 ban types
# fixed: some code fixes
# sets ban type
# 1) *!*@*.domain.com
# 2) *!*@some.domain.com
# 3) *nick*!*@some.domain.com
# 4) *!*ident*@some.domain.com
set btype 4
# 1 - protect ops, 0 - dont
set protectops "1"
# 1 - enable ban, 0 - disable ban
set want_ban "1"
# wait $wait times before ban
set wait "0"
# base directory
set dirname "badwords.db"
# kick message
set msg "bad word!"
# users directory
set usersdir "$dirname/lusers"
# dbase with bad words
set dbase "words_bank.db"
if {[file exists $dirname] == 0} {
file mkdir $dirname
set crtdb [open $dirname/$dbase a+]
puts $crtdb "fuck\nshit"
close $crtdb
}
if {[file exists $usersdir] == 0} {
file mkdir $usersdir
}
proc create_db { dbname definfo } {
if {[file exists $dbname] == 0} {
set crtdb [open $dbname a+]
puts $crtdb "$definfo"
close $crtdb
}
}
proc readdb { rdb } {
global ident times
set fs_open [open $rdb r]
gets $fs_open dbout
close $fs_open
set separate [split $dbout "&"]
set ident [lindex $separate 0]
set times [lindex $separate 1]
}
bind pubm - * word_fct
proc word_fct { nick uhost hand chan arg } {
global botnick dbase dirname protectops usersdir times ident wait want_ban msg
set f [open $dirname/$dbase]
set allwords [read $f]
close $f
set nasty_words [split $allwords "\n"]
if {[isop $botnick $chan]} {
foreach i [string tolower $nasty_words] {
if {$i != ""} {
if {[string match *$i* [string tolower $arg]]} {
if {$protectops == "0"} {
set kill "1"
} {
if {[isop $nick $chan] == "1"} {
continue
} {
set kill "1"
}
}
}
}
}
if {$kill == "1"} {
if {$want_ban == "1"} {
if {[file exists $usersdir/$nick] == 0} {
create_db "$usersdir/$nick" "$uhost&1"
} {
readdb "$usersdir/$nick"
file delete $usersdir/$nick
set overall [expr $times + 1]
create_db "$usersdir/$nick" "$ident&$overall"
readdb "$usersdir/$nick"
set player_ident "[banmask $uhost $nick]"
if {"$uhost" == "$ident"} {
if {$times >= $wait} {
putquick "MODE $chan +b $player_ident"
file delete $usersdir/$nick
}
} {
file delete $usersdir/$nick
create_db "$usersdir/$nick" "$uhost&1"
}
}
}
putkick $chan $nick $msg
}
}
}
proc banmask {host nick} {
global btype
switch -- $btype {
1 {
set mask "*!*@[lindex [split [maskhost $host] "@"] 1]"
}
2 {
set mask "*!*@[lindex [split $host @] 1]"
}
3 {
set mask "*$nick*!*@[lindex [split $host "@"] 1]"
}
4 {
set mask "*!*[lindex [split $host "@"] 0]*@[lindex [split $host "@"] 1]"
}
return $mask
}
}
putlog "tkbadword.tcl ver 0.2 by Tomekk loaded :: ficken? xD"
wäre echt gut wen mir wer helfen könnt :)
mfg