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 

Changing Massmsg Script (by SilentStorm)

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
Psyfire
Voice


Joined: 05 Nov 2006
Posts: 36

PostPosted: Sun Jan 20, 2008 6:27 am    Post subject: Changing Massmsg Script (by SilentStorm) Reply with quote

Hello,

I downloaded this script here and it works, but there is one mistake.

Code:

#################################################
#                                    #
#     Anti Mass Letter Script by SilentStorm    #
#                                    #
#################################################
#
# Version 1.1
#
#################################################
#
# If a User writes more then x letters of the
# same type in a row (i.e spaaaaaaaaaaaam) then
# the User will be warned and after y warnings
# the User will be kicked out of the channel.
# Allows you to set Exceptions too so specified
# nicks wont be affected by this.
# Also offers a 'Hardcore Violation Mode' which
# will kick the User without any warnings. Useful
# for extreme violations and Spamming.
#
#################################################
#                                    #
#                 CONFIGURATION                 #
#                                    #
#################################################
#
# Every Nickname entered here will NOT be affected by this Script. So choose the Nicks you enter here carefully!
# Nicknames has to be seperated by a Space (i.e. User1 User2 User3)
set massmsg(except) "SilentStorm blueshadow"

# Here you can specify all channels which should be protected by this script.
# Make sure your Bot has at least HalfOp in all the channels you enter here in order to be able to kick
# Channels has to be seperated by a Space (i.e. Chan1 Chan2 Chan3) and must be entered without the preceding #
set massmsg(chans) "x-tec hellgate"

# This controls wether digits are punished as well or not. If set to 1 then 6666666 wont be treated as Spam
# and Users wont be warned (and therefore not kicked) when spamming lines full of digits
# Possible Settings are (0/1)
set massmsg(ignint) 0

# Here you can specify how often the users are warned before they receive a kick
set massmsg(warnings) 3

# Here you can specify how many following characters of the same type are allowed (if User exceeds this they'll be warned)
set massmsg(maxchr) 3

# This sets the amount of same characters in a row which will trigger the Hardmode (User will be kicked regardless of warnings)
set massmsg(hmchr) 10

# Here you can specify the messages for the warnings as well as for the kick message.
# %nick will be replaced by the nick of the warned/kicked user
# %cnt will be replaced by the amount of warnings the User received
set massmsg(warnmsg) "%nick du bist hiermit verwarnt. Dies ist deine %cnt Verwarnung."
set massmsg(kickmsg) "oO Stop Spamming. You've been warned %cnt times already."


####################################################
#         !!DO NOT CHANGE ANYTHING BELOW!!         #
####################################################
set massmsg(version) "V 1.1"
set massmsg(author) "SilentStorm"

####################
# Application Part #
####################

bind pubm - * check_massletter

proc check_massletter {nick uhost hand chan arg} {
   global usrwarn
   global massmsg
   set maxstr 0
   set spam 0
   set check 0
   set laststr ""
   foreach n $massmsg(chans) {
      if {([string tolower $chan] == [string tolower \#$n])} {
         set check 1
      }
   }
   if {$check != 1} {
#      putlog "Aborting MassLetter. May not check for Channel $chan"
      return
   }
   foreach n $massmsg(except) {
      if {([string tolower $nick] == [string tolower $n])} {
#         putlog "Aborting MassLetter. User $nick is on ExceptionsList"
         return
      }
   }
   if {![info exists usrwarn([nick2hand $nick])]} {
      set usrwarn([nick2hand $nick]) 0
   }
   regsub -all "%nick" $massmsg(warnmsg) "$nick" wmsg
   regsub -all "%nick" $massmsg(kickmsg) "$nick" kmsg
   for {set cnt 0} {$cnt <= [string length $arg]} {incr cnt} {
      if {([string index $arg $cnt] == $laststr)} {
         if {$massmsg(ignint) == 1} {
            if {([string match [string index $arg $cnt] 0] == 0) && ([string match [string index $arg $cnt] 1] == 0) && ([string match [string index $arg $cnt] 2] == 0) && ([string match [string index $arg $cnt] 3] == 0) && ([string match [string index $arg $cnt] 4] == 0) && ([string match [string index $arg $cnt] 5] == 0) && ([string match [string index $arg $cnt] 6] == 0) && ([string match [string index $arg $cnt] 7] == 0) && ([string match [string index $arg $cnt] 8] == 0) && ([string match [string index $arg $cnt] 9] == 0)} {
               incr maxstr
            }
         } else {
            incr maxstr
         }
      } else {
         set maxstr 1
         set laststr [string index $arg $cnt]
      }
      if {$maxstr > $massmsg(maxchr)} {
         set spam 1
      }
      if {$maxstr > $massmsg(hmchr)} {
         set spam 2
      }
   }
   if {($spam == 1)} {
      incr usrwarn([nick2hand $nick])
      regsub -all "%cnt" $wmsg "$usrwarn([nick2hand $nick])" wmsg
      putchan $chan $wmsg
   }
   if {($spam == 2)} {
      incr usrwarn([nick2hand $nick])
      regsub -all "%cnt" $wmsg "$usrwarn([nick2hand $nick])" wmsg
      regsub -all "%cnt" $kmsg "$usrwarn([nick2hand $nick])" kmsg
      putchan $chan $wmsg
      putkick $chan $nick $kmsg
   }
   if {($usrwarn([nick2hand $nick]) > $massmsg(warnings))} {
      putserv "PRIVMSG $chan : Kicking $nick (Kept Spamming)"
      regsub -all "%cnt" $kmsg "$usrwarn([nick2hand $nick])" kmsg
      set usrwarn([nick2hand $nick]) 0
      putkick $chan $nick $kmsg
      return
   }
}

putlog "Anti Mass Letter Spam $massmsg(version) by $massmsg(author) loaded (SilentStorm)"




I set the warnings to "2" and I was warned 2 times, but at the third time I got kicked and then got warned again.

Means, the person who will spam, gets a third warning after he got kicked. Can somebody fix this ?[/code]
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun Jan 20, 2008 9:41 am    Post subject: Reply with quote

Just put a "return" after the putkick

eg:

putkick $chan $nick $kmsg
return
Back to top
View user's profile Send private message
Psyfire
Voice


Joined: 05 Nov 2006
Posts: 36

PostPosted: Sun Jan 20, 2008 4:27 pm    Post subject: Reply with quote

Doesnt work
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Mon Jan 21, 2008 12:39 am    Post subject: Reply with quote

Psyfire wrote:
Doesnt work

Very informative. Rolling Eyes
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Mon Jan 21, 2008 1:30 am    Post subject: Reply with quote

"It's broke, buy a new one"
Back to top
View user's profile Send private message
Psyfire
Voice


Joined: 05 Nov 2006
Posts: 36

PostPosted: Tue Jan 22, 2008 3:08 pm    Post subject: Reply with quote

Alchera wrote:
Psyfire wrote:
Doesnt work

Very informative. Rolling Eyes


What should I even say? There is no error message and it appears the same problem, like I explained it in my first posting.
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Wed Jan 23, 2008 1:08 am    Post subject: Reply with quote

Psyfire wrote:
Alchera wrote:
Psyfire wrote:
Doesnt work

Very informative. Rolling Eyes


What should I even say? There is no error message and it appears the same problem, like I explained it in my first posting.

Code:
.set errorInfo

_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases 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