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 

Help with flood script - just need help to fix something :)

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Moti
Voice


Joined: 20 Sep 2013
Posts: 15

PostPosted: Mon Dec 30, 2013 11:35 am    Post subject: Help with flood script - just need help to fix something :) Reply with quote

Hi,

I downloaded the script floodcontrol.tcl 1.0.1 and change some things.
I change that if someone flood the channel at the first time he only lose his +v for 20 seconds and recived some messages.

If he continue to flood the bot kick + ban him and send him another messages.

My problem is that in the second part (When user flood again) the bot really kick + ban him and send the messages - but send him the 2 kinds of messages.

This is the part of the code with the messages.
Hope to some help Smile

Code:
      if {[lsearch -exact [channel info $chan] "+repeat"] != -1} {
        if {![info exists srepeat_count($uhost:$chan:$arg)]  && [lsearch -exact $srepeat 0] == -1} {set srepeat_count($uhost:$chan:$arg) 0}
        if {![info exists lrepeat_count($uhost:$chan:$arg)] && [lsearch -exact $lrepeat 0] == -1} {set lrepeat_count($uhost:$chan:$arg) 0}
        incr srepeat_count($uhost:$chan:$arg) 1; utimer [lindex $srepeat 1] [list unset -nocomplain srepeat_count($uhost:$chan:$arg)]
        incr lrepeat_count($uhost:$chan:$arg) 1; utimer [lindex $lrepeat 1] [list unset -nocomplain lrepeat_count($uhost:$chan:$arg)]
        if {$lrepeat_count($uhost:$chan:$arg) >= [lindex $lrepeat 0]} {
          if {![info exists chan_flooded($chan)]} {
            lock:chan $chan
            newchanban $chan *!$uhost \002violation\002 "Repeated Violation of Chat Rules: Spamming/Flooding" $repeatban
            putquick "KICK $chan $nick :Repeated Violation of Chat Rules: Spamming/Flooding"
            putserv "privmsg $nick :\00305WARNING:\00300 Please stop spamming/flooding the chat."
            putserv "privmsg $nick :\00303STATUS:\00300 Banned (5 minutes)."
            putserv "privmsg $nick :\00304REASON:\00300 Repeated violation of chat rules - spamming/flooding."
            putserv "privmsg $nick :\00312MESSAGE:\00300 Hello again, $nick. You have been temporarily banned from the chat. This means for the next 5 minutes, you wil$
            putserv "privmsg $nick :* You will be notified when the 5 minute ban is expired"
            putlog "punishing offensive repeat flooders: $nick ($uhost) on $chan."
            utimer 330 "putserv \"privmsg $nick :\00303STATUS:\00300\ In good standing.\""
            utimer 331 "putserv \"privmsg $nick :\00312MESSAGE:\00300 Good news $nick, your 5 minute ban has expired and you are welcome to re-enter the chat. Please r$
          }
        } elseif {$srepeat_count($uhost:$chan:$arg) == [lindex $srepeat 0]} {
          putquick "mode $chan -v $nick"
          putserv "privmsg $nick :\00305WARNING:\00300 Please stop spamming/flooding the chat."
          putserv "privmsg $nick :\00303STATUS:\00300 Muted (20 seconds)."
          putserv "privmsg $nick :\00304REASON:\00300 Violation of chat rules - spamming/flooding."
          putserv "privmsg $nick :\00312MESSAGE:\00300 Dear $nick, you have been muted. this means for the next 20 seconds, you will not be able to send messages to th$
          utimer 20 "putquick \"MODE $chan +v $nick\""
        }
      }
    }
  }


Really thanks ! Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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