This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

"Advanced" floodprotect

Help for those learning Tcl or writing their own scripts.
Post Reply
c
cakemonster
Voice
Posts: 2
Joined: Sat Mar 25, 2006 4:44 am

"Advanced" floodprotect

Post by cakemonster »

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. :P 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. :D 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?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

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...
User avatar
sKy
Op
Posts: 194
Joined: Thu Apr 14, 2005 5:58 pm
Location: Germany

Post by sKy »

I wrote a lot about.
flood protections
Hope it is helpfuly for you.
socketapi | Code less, create more.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

sKy wrote:I wrote a lot about.
flood protections
Hope it is helpfuly for you.
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: Select all

 tag when posting logs, code
User avatar
sKy
Op
Posts: 194
Joined: Thu Apr 14, 2005 5:58 pm
Location: Germany

Post by sKy »

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.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Or you can implement the [timer] command in Tcl.
Post Reply