| View previous topic :: View next topic |
| Author |
Message |
Arkadietz Halfop

Joined: 14 Jul 2006 Posts: 67 Location: cat /dev/zero > /dev/null;
|
Posted: Tue Jan 22, 2013 10:43 am Post subject: Bad phrase or word |
|
|
Hi, there! I need a tcl where i can add my bad words or phrases. To support UTF && cp1251 (cyrlic).
To catch also words and phrases where is used /me
Also should has public and partyline commands like:
TO DO:
1. Public commands:
!addbw - add some phrase or word ( where they are stored in some file like badword.txt )
!rembw - remove some phrase or word
!showbw - show all added bad words or phrases
2. Partyline commands
Pretty much same like public
.addbw - add some phrase or word ( where they are stored in some file like badword.txt )
.rembw - remove some phrase or word
.showbw - show all added bad words or phrases
3. A specific flag for adding or remove bad words ( can be set only from perm owner )
4. Sets ban type:
# 1) *!*@some.domain.com
# 2) *!*@*.domain.com
# 3) *!*ident@some.domain.com
# 4) *!*ident@*.domain.com
# 5) Nick!*@*
5. Exempt: ( in tcl you can add nick or host eggdrop don't check exempts )
P.S Should don't check bots by default.
Example:
.addbw "bad word or phrase" reason for ban
.addbw "wanna [censored] ya?" please die!
6. Check for already exist words or phrases. If the words or phrase exist bot should back to you message like: The word or phrase already exist! _________________ On a unix system everything is a file ; if something is not a file , it is a proccess. |
|
| Back to top |
|
 |
SmasHinG Voice
Joined: 29 Aug 2011 Posts: 29
|
Posted: Sat Feb 02, 2013 4:34 am Post subject: |
|
|
Someone please make this tcl.
Somebody alive ?
Thank You _________________ SmasHinG® |
|
| Back to top |
|
 |
Get_A_Fix Master

Joined: 07 May 2005 Posts: 206 Location: New Zealand
|
Posted: Sat Feb 02, 2013 3:19 pm Post subject: |
|
|
| SmasHinG wrote: | Someone please make this tcl.
Somebody alive ?
Thank You |
Stop bumping the thread.... If someone wants to make this, they will. Otherwise, learn to code yourself and stop bothering everyone. _________________ We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals. |
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Sat Feb 09, 2013 8:22 am Post subject: |
|
|
And finally i have the mood for this script
Commands:
| Quote: | !badword -add word/phrase
!badword -del word/phrase
!badword -list
!badword ban-type 1/2/3/4/5
!badword -ban-reason REASON |
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)
So im waiting for reply if you want it like this if not i won`t do it _________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
Arkadietz Halfop

Joined: 14 Jul 2006 Posts: 67 Location: cat /dev/zero > /dev/null;
|
Posted: Sat Feb 09, 2013 8:46 am Post subject: |
|
|
yeah i'm waiting for your code  _________________ On a unix system everything is a file ; if something is not a file , it is a proccess. |
|
| Back to top |
|
 |
SmasHinG Voice
Joined: 29 Aug 2011 Posts: 29
|
Posted: Fri Feb 15, 2013 5:38 am Post subject: |
|
|
| Madalin wrote: | And finally i have the mood for this script
Commands:
| Quote: | !badword -add word/phrase
!badword -del word/phrase
!badword -list
!badword ban-type 1/2/3/4/5
!badword -ban-reason REASON |
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)
So im waiting for reply if you want it like this if not i won`t do it |
Okay Madalin give this code who you have and Thanks _________________ SmasHinG® |
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Fri Feb 15, 2013 6:41 pm Post subject: |
|
|
If you want the script to work with UTF-8 you have 2 choices:
1. Recompile the eggdrop and read this http://eggwiki.org/Bugs/Utf-8 (you have to change an setting when you compile the eggdrop)
2. Load http://forum.egghelp.org/viewtopic.php?t=18879&highlight=utf8 this script before the badwords script (it should work yet i recommand recompile)
Here is the script:
| Code: |
#### ++++ 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"
|
If any problems regarding the script please post here.
If someone tested the script please post so i know its ok.
Every channel can have its own database _________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
SmasHinG Voice
Joined: 29 Aug 2011 Posts: 29
|
Posted: Sat Feb 16, 2013 4:31 am Post subject: |
|
|
To this script maybe missing check for already exist word/phrase. Can you make this ? _________________ SmasHinG® |
|
| Back to top |
|
 |
Madalin Master

Joined: 24 Jun 2005 Posts: 310 Location: Constanta, Romania
|
Posted: Sat Feb 16, 2013 6:16 am Post subject: |
|
|
Have you atleast tested the script ?
Have you seen
| Quote: |
putserv "PRIVMSG $chan :\002$nick\002 - '\00312$what\003' already exists in the database."
|
?? _________________ https://github.com/MadaliNTCL - To chat with me: https://tawk.to/MadaliNTCL |
|
| Back to top |
|
 |
SmasHinG Voice
Joined: 29 Aug 2011 Posts: 29
|
Posted: Sat Feb 16, 2013 10:37 am Post subject: |
|
|
Sorry my mistake
Catch /me tex ? in tcl ACTION i want catch pubmsg and action.
Make to work badwords cmds to pubmsg and dcc
Can you make for every bad word reason example: !badword [censored] you using bad word out !
example2: !badword somebad you are stupid to use this word
and etc. _________________ SmasHinG® |
|
| Back to top |
|
 |
juanamores Master
Joined: 15 Mar 2015 Posts: 317
|
Posted: Mon Jun 27, 2016 9:38 pm Post subject: |
|
|
How you can modify the code to add bad words by private message to BoT ? _________________ If you do not understand my ideas is because I can not think in English, I help me with Google Translate. I only speak Spanish. Bear with me. Thanks  |
|
| Back to top |
|
 |
Mariio1692 Voice
Joined: 03 Feb 2017 Posts: 5 Location: students
|
Posted: Mon Feb 06, 2017 2:12 pm Post subject: channel debug |
|
|
Can you add words from the bot debug channel and the ifractor be expelled where the protection is active? _________________ I love industrial engineering... |
|
| Back to top |
|
 |
|