egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Bad phrase or word

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Arkadietz
Halfop


Joined: 14 Jul 2006
Posts: 66
Location: cat /dev/zero > /dev/null;

PostPosted: Tue Jan 22, 2013 10:43 am    Post subject: Bad phrase or word Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
SmasHinG
Voice


Joined: 29 Aug 2011
Posts: 29

PostPosted: Sat Feb 02, 2013 4:34 am    Post subject: Reply with quote

Someone please make this tcl.
Somebody alive ?
Thank You
_________________
SmasHinG®
Back to top
View user's profile Send private message
Get_A_Fix
Master


Joined: 07 May 2005
Posts: 206
Location: New Zealand

PostPosted: Sat Feb 02, 2013 3:19 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Madalin
Master


Joined: 24 Jun 2005
Posts: 300
Location: Constanta, Romania

PostPosted: Sat Feb 09, 2013 8:22 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Arkadietz
Halfop


Joined: 14 Jul 2006
Posts: 66
Location: cat /dev/zero > /dev/null;

PostPosted: Sat Feb 09, 2013 8:46 am    Post subject: Reply with quote

yeah i'm waiting for your code Smile
_________________
On a unix system everything is a file ; if something is not a file , it is a proccess.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
SmasHinG
Voice


Joined: 29 Aug 2011
Posts: 29

PostPosted: Fri Feb 15, 2013 5:38 am    Post subject: Reply with quote

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
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 300
Location: Constanta, Romania

PostPosted: Fri Feb 15, 2013 6:41 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
SmasHinG
Voice


Joined: 29 Aug 2011
Posts: 29

PostPosted: Sat Feb 16, 2013 4:31 am    Post subject: Reply with quote

To this script maybe missing check for already exist word/phrase. Can you make this ?
_________________
SmasHinG®
Back to top
View user's profile Send private message
Madalin
Master


Joined: 24 Jun 2005
Posts: 300
Location: Constanta, Romania

PostPosted: Sat Feb 16, 2013 6:16 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
SmasHinG
Voice


Joined: 29 Aug 2011
Posts: 29

PostPosted: Sat Feb 16, 2013 10:37 am    Post subject: Reply with quote

Sorry my mistake Smile
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
View user's profile Send private message
juanamores
Master


Joined: 15 Mar 2015
Posts: 317

PostPosted: Mon Jun 27, 2016 9:38 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Mariio1692
Voice


Joined: 03 Feb 2017
Posts: 5
Location: students

PostPosted: Mon Feb 06, 2017 2:12 pm    Post subject: channel debug Reply with quote

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
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber