Code: Select all
# Author: tomekk
# e-mail: tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.1
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html
# if you want to use this script on your chan, type in eggdrop console (via telnet or DCC chat)
# .chanset #channel_name +tb
# and later .save
# kick message
set kick_msg "bye bye"
# bad words (case insensitive, line-by-line)
set bad_topic_words {
*anus*
*something*
*word1*
*word2*
}
# ban type
# 1) *!*@*.domain.com
# 2) *!*@some.domain.com
# 3) *nick*!*@some.domain.com
# 4) *!*ident*@some.domain.com
set ban_type 1
######################################################
bind topc -|- "*" topc_proc
setudef flag tb
proc topc_proc { nick uhost handle chan topic } {
global bad_topic_words kick_msg botnick
if {![channel get $chan tb]} {
return
}
set kick_fag 0
foreach b_word [split $bad_topic_words "\n"] {
if {[string match -nocase [join $b_word] $topic]} {
set kick_fag 1
break
}
}
if {$kick_fag == 1} {
if {$botnick != $nick} {
putquick "MODE $chan +b [banmask $uhost $nick]"
putkick $chan $nick $kick_msg
}
}
}
proc banmask { host nick } {
global ban_type
switch -- $ban_type {
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 "topic-ban.tcl ver 0.1 by tomekk loaded"
Code: Select all
# Author: tomekk
# e-mail: tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.1
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html
# if you want to use this script on your chan, type in eggdrop console (via telnet or DCC chat)
# .chanset #channel_name +tb
# and later .save
# kick message
set kick_msg "bye bye"
# bad words (case insensitive)
set bad_topic_words {
*anus*
*something*
*word1*
*word2*
}
# ban type
# 1) *!*@*.domain.com
# 2) *!*@some.domain.com
# 3) *nick*!*@some.domain.com
# 4) *!*ident*@some.domain.com
set ban_type 1
######################################################
bind topc -|- "*" topc_proc
setudef flag tb
proc topc_proc { nick uhost handle chan topic } {
global bad_topic_words kick_msg botnick
if {![channel get $chan tb]} {
return
}
if {[string trim $topic] != "" } {
set kick_fag 0
foreach b_word [split $bad_topic_words "\n"] {
if {[string match -nocase [join $b_word] $topic]} {
set kick_fag 1
break
}
}
if {$kick_fag == 1} {
if {$botnick != $nick} {
putquick "MODE $chan +b [banmask $uhost $nick]"
putkick $chan $nick $kick_msg
}
}
}
}
proc banmask { host nick } {
global ban_type
switch -- $ban_type {
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 "topic-ban.tcl ver 0.1 by tomekk loaded"
Code: Select all
if {$botnick != $nick} {
Code: Select all
if {[isbotnick $nick]} return
Code: Select all
if {![channel get $chan tb]} {
Code: Select all
# Author: tomekk
# e-mail: tomekk/@/oswiecim/./eu/./org
# home page: http://tomekk.oswiecim.eu.org/
#
# Version 0.1
#
# This file is Copyrighted under the GNU Public License.
# http://www.gnu.org/copyleft/gpl.html
# if you want to use this script on your chan, type in eggdrop console (via telnet or DCC chat)
# .chanset #channel_name +tb
# and later .save
# kick message
set kick_msg "bye bye"
# bad words (case insensitive)
set bad_topic_words {
*anus*
*something*
*word1*
*word2*
}
# topics
set topics {
"#chan1\ntopic for channel #chan1"
"#chan2\ntopic for channel #chan2"
}
# ban type
# 1) *!*@*.domain.com
# 2) *!*@some.domain.com
# 3) *nick*!*@some.domain.com
# 4) *!*ident*@some.domain.com
set ban_type 1
######################################################
bind topc -|- "*" topc_proc
setudef flag tb
proc topc_proc { nick uhost handle chan topic } {
global bad_topic_words kick_msg botnick topics
if {![channel get $chan tb]} {
return
}
if {$botnick == $nick} {
return
}
if {[string trim $topic] != "" } {
set kick_fag 0
foreach b_word [split $bad_topic_words "\n"] {
if {[string match -nocase [join $b_word] $topic]} {
set kick_fag 1
break
}
}
if {$kick_fag == 1} {
putquick "MODE $chan +b [banmask $uhost $nick]"
putkick $chan $nick $kick_msg
foreach topic $topics {
if {$topic != ""} {
set topic_data [split $topic "\n"]
set topic_chan [lindex $topic_data 0]
set topic_topic [lindex $topic_data 1]
if {$topic_chan == $chan} {
putquick "TOPIC $chan :$topic_topic"
break
}
}
}
}
}
}
proc banmask { host nick } {
global ban_type
switch -- $ban_type {
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 "topic-ban.tcl ver 0.1 by tomekk loaded"
Code: Select all
setudef flag tb
setudef str tb-words
setudef str tb-topic
setudef str tb-kickmsg
proc topc_proc {nick uhost handle chan topic} {
if {![channel get $chan tb] || [isbotnick $nick] || [string trim $topic] == "" } {
return
}
foreach word [split [channel get $chan tb-words] ,] {
if {[string match -nocase [join $b_word] $topic]} {set match 1}
}
if {[info exists $match]} {
set banmask [maskhost $nick!$uhost [channel get $chan ban-type]]
newchanban $chan $banmask TOPICBAN [channel get $chan tp-kickmsg] [channel get $chan ban-time]
pushmode $target_chan "+b" $banmask
flushmode $chan
putkick $chan $nick [channel get $chan tp-kickmsg]
}
}
bind topc -|- "*" topc_proc
putlog "Topic badword banner thingy hack"