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 

Very Simplistic Flood Kick Script

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


Joined: 22 Feb 2020
Posts: 393

PostPosted: Sun Jun 28, 2020 11:49 pm    Post subject: Very Simplistic Flood Kick Script Reply with quote

So looking for a very simple flood kick script to add to my script

searched through the archive, none that i want Rolling Eyes

so if someone could make one for me, well that would be brilliant

and of course i'll add their nick to the script credits Cool

cheers to all in advanced
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Carlin0
Voice


Joined: 04 Dec 2018
Posts: 24
Location: Italy

PostPosted: Mon Jun 29, 2020 4:37 am    Post subject: Reply with quote

In partyline type
Code:

.help chaninfo
Back to top
View user's profile Send private message
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Mon Jun 29, 2020 8:25 am    Post subject: Reply with quote

Umm hehe thanks but i kind of already know that, was asking for a small Piece of code rather, i'll try the archive again Rolling Eyes
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Mon Jun 29, 2020 8:31 am    Post subject: Reply with quote

If you are writing it yourself, you might like to have a look at:
https://docs.eggheads.org/mainDocs/tcl-commands.html
and find:
bind flud

Read the description carefully.


Perhaps you can use that and come up with something that is exactly what you want. Smile
_________________
For a fun (and popular) Trivia game, visit us at: irc.librairc.net #science-fiction . Over 300K Q & A to play in BogusTrivia !
Back to top
View user's profile Send private message
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Mon Jun 29, 2020 9:03 am    Post subject: Reply with quote

Cheers willyw, will check that out right away Wink
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Mon Jun 29, 2020 9:04 am    Post subject: Reply with quote

Code:

bind flud - pub flud:ban

proc flud:ban { n u h t c } {
  pushmode $c +b *!$u
  putkick $c $n "text_flood"
}


took this from:

Quote:

http://forum.egghelp.org/viewtopic.php?t=15217&highlight=flood
Back to top
View user's profile Send private message
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Wed Aug 19, 2020 6:39 pm    Post subject: Reply with quote

Thanks Simo Very Happy
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Tue Mar 16, 2021 12:04 am    Post subject: Reply with quote

Just thought i'd share some Code a friend of mine(Nando) made
Code:

# configure the text flood tolerance lines per seconds
set text_tolerance "4:10"

# end of config
bind pubm - * chan_flood

proc chan_flood {nick uhost hand chan text} {
  global text_tolerance nick_last_message_time nick_lines nick_time

  set time_now [unixtime]
  set lines [lindex [split $text_tolerance :] 0]
  set seconds [lindex [split $text_tolerance :] 1]

  if {[info exists nick_last_message_time($nick:$chan)]} {
    if {[expr ($time_now - $nick_last_message_time($nick:$chan))] > $seconds} {
      set nick_lines($nick:$chan) 0
    }
  }

  incr nick_lines($nick:$chan)

  if {$nick_lines($nick:$chan) == 1} {
    set nick_time($nick:$chan) [unixtime]
  }

  if {($nick_lines($nick:$chan) > $lines) && ([expr ($time_now - $nick_time($nick:$chan))] <= $seconds)} {
    putserv "PRIVMSG $chan :kick $nick flood"
    unset nick_lines($nick:$chan)
  }
  set nick_last_message_time($nick:$chan) [unixtime]
}

Smile
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Tue Mar 16, 2021 2:45 am    Post subject: Reply with quote

Why bother re-inventing the wheel when you got bind flud to trigger for whatever you wanted?

Instead of:
Code:

set lines [lindex [split $text_tolerance :] 0]
set seconds [lindex [split $text_tolerance :] 1]

I would go with:
Code:

scan [split $text_tolerance :] {%d%d} lines seconds

There are a couple of other things I would change, like instead of relying on two separate arrays would use just one and have all the info in there. Do you track and update nick changes, parts, quits and so on?
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1032
Location: France

PostPosted: Tue Mar 16, 2021 3:39 am    Post subject: Reply with quote

Why dont use the flood-chan setting ?
Code:
.chanset #foo flood-chan 4:10

_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
ComputerTech
Master


Joined: 22 Feb 2020
Posts: 393

PostPosted: Tue Mar 16, 2021 11:53 am    Post subject: Reply with quote

I am trying to try make my own Flood Protection Script, like some others have Wink

and thanks @caesar for your suggestion, will change that Wink

and i haven't planned how to track things as you said yet, of course if you have any more ideas, do share Razz
_________________
ComputerTech
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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