| View previous topic :: View next topic |
| Author |
Message |
cakemonster Voice
Joined: 25 Mar 2006 Posts: 2
|
Posted: Sat Mar 25, 2006 5:21 am Post subject: "Advanced" floodprotect |
|
|
Hi everyone! I've visited these forums for a long while as a guest and found answers to everything I was looking for, until now.
I stomped into a bigger problem and with my level of tcl scripting it's hard to resolve. I would appreciate it if someone could help me out with this.
Ok, I have this tcl with a bunch of public triggers. I'll try to explain this as simply as possible, bear with me. I'll do it the classic <nick> <bot> way :E
(11:00) <nick>: !trigger
(11:00) <bot>: bla bla
(11:01) <nick>: !trigger
(11:01) <bot>: Flood detected from <nick>! Ignoring for $ignoretime mins!
In that example the flood protection time is 2 mins (yeah pretty long but I actually want 2 mins) and the nick said !trigger without waiting 2 mins.
I would like to assign this flood protection to only certain triggers in my tcl.
Can anyone help me with this? |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Mon Mar 27, 2006 7:39 am Post subject: |
|
|
store the hostmark in an array and set unsets via utimer 120. you can then simply check if exists the array element and and return 0 (if he continues to try to !trigger with return 0 he will be kicked for repeating as example, if such a script is loaded). _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
sKy Op

Joined: 14 Apr 2005 Posts: 194 Location: Germany
|
Posted: Mon Mar 27, 2006 8:42 pm Post subject: |
|
|
I wrote a lot about.
flood protections
Hope it is helpfuly for you. _________________ socketapi | Code less, create more. |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Tue Mar 28, 2006 1:32 am Post subject: |
|
|
your remarks about timer- vs non-timer flood detect solution are plain wrong; the latter is ALWAYS better than the former for this particular purpose (what is "memory lag" anyway?) _________________ connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code |
|
| Back to top |
|
 |
sKy Op

Joined: 14 Apr 2005 Posts: 194 Location: Germany
|
Posted: Tue Mar 28, 2006 10:10 am Post subject: |
|
|
memory lag ~
Well i try to explain (not easy in english) how i mean this. You just write an array, but you never release memory afer he informations in the memory ain`t longer important. If you have to less free memory you will get system isuses.
The main idea of this protections was to safe some coding work. Imho it saves more work then using somthing like every time.
if { [info exists ::varname] } { return }
set ::varname 1
after 10000 [list unset ::varname]
I should edit my comments and maybe change timer to after to make it compatible with plain tcl aswell too. _________________ socketapi | Code less, create more. |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue Mar 28, 2006 12:33 pm Post subject: |
|
|
Or you can implement the [timer] command in Tcl. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|