| View previous topic :: View next topic |
| Author |
Message |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Sun Jun 28, 2020 11:49 pm Post subject: Very Simplistic Flood Kick Script |
|
|
So looking for a very simple flood kick script to add to my script
searched through the archive, none that i want
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
cheers to all in advanced _________________ ComputerTech |
|
| Back to top |
|
 |
Carlin0 Voice

Joined: 04 Dec 2018 Posts: 24 Location: Italy
|
Posted: Mon Jun 29, 2020 4:37 am Post subject: |
|
|
In partyline type
|
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Mon Jun 29, 2020 8:25 am Post subject: |
|
|
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  _________________ ComputerTech |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Mon Jun 29, 2020 8:31 am Post subject: |
|
|
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.  _________________ 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 |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Mon Jun 29, 2020 9:03 am Post subject: |
|
|
Cheers willyw, will check that out right away  _________________ ComputerTech |
|
| Back to top |
|
 |
simo Owner
Joined: 22 Mar 2015 Posts: 941
|
Posted: Mon Jun 29, 2020 9:04 am Post subject: |
|
|
| 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:
|
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Wed Aug 19, 2020 6:39 pm Post subject: |
|
|
Thanks Simo  _________________ ComputerTech |
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Tue Mar 16, 2021 12:04 am Post subject: |
|
|
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]
}
|
 _________________ ComputerTech |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Tue Mar 16, 2021 2:45 am Post subject: |
|
|
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 |
|
 |
CrazyCat Revered One

Joined: 13 Jan 2002 Posts: 1032 Location: France
|
|
| Back to top |
|
 |
ComputerTech Master

Joined: 22 Feb 2020 Posts: 393
|
Posted: Tue Mar 16, 2021 11:53 am Post subject: |
|
|
I am trying to try make my own Flood Protection Script, like some others have
and thanks @caesar for your suggestion, will change that
and i haven't planned how to track things as you said yet, of course if you have any more ideas, do share  _________________ ComputerTech |
|
| Back to top |
|
 |
|