Stop bumping the thread.... If someone wants to make this, they will. Otherwise, learn to code yourself and stop bothering everyone.SmasHinG wrote:Someone please make this tcl.
Somebody alive ?
Thank You
It will be compatible with UTF-8 yet for cirilic i don`t know and im still guessing if it will work with utf-8 (i will use that fix script for utf-8 because i can`t compile on my server)!badword -add word/phrase
!badword -del word/phrase
!badword -list
!badword ban-type 1/2/3/4/5
!badword -ban-reason REASON
Okay Madalin give this code who you have and ThanksMadalin wrote:And finally i have the mood for this script
Commands:
It will be compatible with UTF-8 yet for cirilic i don`t know and im still guessing if it will work with utf-8 (i will use that fix script for utf-8 because i can`t compile on my server)!badword -add word/phrase
!badword -del word/phrase
!badword -list
!badword ban-type 1/2/3/4/5
!badword -ban-reason REASON
So im waiting for reply if you want it like this if not i won`t do it
Code: Select all
#### ++++ Author: MadaliN <madalinmen28@yahoo.com
### ++++ Script name: Badwords
## ++++ Version: 1.0 (2/9/2013)
#
# Commands
# !badwords on/off
# !badwords ban-reason REASON
# !badwords ban-type 1/2/3/4 (!badwords ban-type 1)
# !badwords add WORD/PHRASE
# !badwords del WORD/PHRASE
# !badwords list
setudef flag badwords
bind PUB n !badwords badwords:pub
bind PUBM - * badwords:pubm
proc mh {nuhost type} {
set user [lindex [split $nuhost !] 0]
set host [lindex [split $nuhost !] 1]
switch $type {
1 {return $nuhost}
2 {return *!*@$host}
3 {return *!*$user@$host}
4 {return *!*$user@*}
}
}
proc badwords:pubm {nick uhost hand chan arg} {
global badwords tempbw
if {[channel get $chan badwords]} {
foreach b [array names badwords $chan,*] {
if {[string match -nocase "*[lindex [split $b ,] 1]*" $arg] && ![matchattr $hand n] && ![isop $nick $chan]} {
if {![info exists tempbw($chan,ban-type)]} { set tempbw($chan,ban-type) 2 }
if {![info exists tempbw($chan,reason)]} { set tempbw($chan,reason) "Hit the door ya ;" }
newchanban $chan [mh $nick!$uhost $tempbw($chan,ban-type)] $nick $tempbw($chan,reason) 0
putserv "KICK $chan $nick :$tempbw($chan,reason)"
}
}
}
}
proc badwords:pub {nick uhost hand chan arg} {
global badwords tempbw
set what [join [lrange [split $arg] 1 end]]
switch -exact -- [lindex [split $arg] 0] {
ban-type -
-ban-type {
if {[lindex [split $arg] 1] == ""} { putserv "PRIVMSG $chan :\002$nick\002 - You have to specify ban-type (1/2/3/4)"; return }
if {![regexp {^(1|2|3|4)$} [lindex [split $arg] 1]]} { putserv "PRIVMSG $chan :\002$nick\002 valid types are 1/2/3 or 4 (!badwords ban-type 2)"; return }
set tempbw($chan,ban-type) $what
badwords:save
putserv "PRIVMSG $chan :\002$nick\002 - 'ban-type' has been SET"
}
-r -
-reason {
if {[lindex [split $arg] 1] == ""} { putserv "PRIVMSG $chan :\002$nick\002 - You have to specify ban-reason"; return }
set tempbw($chan,reason) $what
badwords:save
putserv "PRIVMSG $chan :\002$nick\002 - 'ban-reason' has been SET"
}
on -
-on {
channel set $chan +badwords
putserv "PRIVMSG $chan :\002$nick\002 - Succesfully activated \00303badwords\003 script on this channel"
}
off -
-off {
channel set $chan -badwords
putserv "PRIVMSG $chan :\002$nick\002 - Succesfully deactivated \00303badwords\003 script on this channel"
}
add -
-add {
if {[info exists badwords($chan,$what)]} {
putserv "PRIVMSG $chan :\002$nick\002 - '\00312$what\003' already exists in the database."
return
} else {
set badwords($chan,$what) "[unixtime]"
badwords:save
putserv "PRIVMSG $chan :\002$nick\002 - Succesfully added '\00312$what\003' into the database."
return
}
}
del -
-del {
if {![info exists badwords($chan,$what)]} {
putserv "PRIVMSG $chan :\002$nick\002 - '\00312$what\003' was not found in the database."
return
} else {
unset -nocomplain badwords($chan,$what)
badwords:save
putserv "PRIVMSG $chan :\002$nick\002 - Succesfully removed '\00312$what\003' from the database."
return
}
}
list -
-list {
set temp(list) ""
foreach b [array names badwords $chan,*] { lappend temp(list) [lindex [split $b ,] 1] }
if {$temp(list) == ""} { putserv "PRIVMSG $chan :\002$nick\002 - Badwords database for \00303$chan\003 is \002empty\002"; return }
putserv "PRIVMSG $chan :\002$nick\002 - Badwords: [join $temp(list) ", "]"
}
reset -
-reset {
foreach b [array names badwords $chan,*] {
unset -nocomplain badwords($chan,[lindex [split $b ,] 1])
}
badwords:save
putserv "PRIVMSG $chan :\002$nick\002 - Succesfully RESET badwords"
}
}
}
proc badwords:save {} {
global badwords tempbw
set ofile [open badwords w]
puts $ofile "array set badwords [list [array get badwords]]"
puts $ofile "array set tempbw [list [array get tempbw]]"
close $ofile
}
catch {source badwords}
putlog "++++ Succesfully loaded: \00312Badwords TCL Script"
??putserv "PRIVMSG $chan :\002$nick\002 - '\00312$what\003' already exists in the database."