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 

"Advanced" floodprotect

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


Joined: 25 Mar 2006
Posts: 2

PostPosted: Sat Mar 25, 2006 5:21 am    Post subject: "Advanced" floodprotect Reply with quote

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. Razz 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. Very Happy 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
View user's profile Send private message
De Kus
Revered One


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Mon Mar 27, 2006 7:39 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
sKy
Op


Joined: 14 Apr 2005
Posts: 194
Location: Germany

PostPosted: Mon Mar 27, 2006 8:42 pm    Post subject: Reply with quote

I wrote a lot about.
flood protections
Hope it is helpfuly for you.
_________________
socketapi | Code less, create more.
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Tue Mar 28, 2006 1:32 am    Post subject: Reply with quote

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] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
sKy
Op


Joined: 14 Apr 2005
Posts: 194
Location: Germany

PostPosted: Tue Mar 28, 2006 10:10 am    Post subject: Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Mar 28, 2006 12:33 pm    Post subject: Reply with quote

Or you can implement the [timer] command in Tcl.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
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