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 

User specific timer

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


Joined: 19 Aug 2005
Posts: 13
Location: Karlsruhe

PostPosted: Mon Oct 16, 2006 9:41 am    Post subject: User specific timer Reply with quote

Hi!

I want to write a script which post a helpline to a user on demand. To simplify the problem the helpline should only be "HELP", command should be !help.

But now my two problems: at first I need a timer which allows only one request per minute PER USER.

My second problem is, that in reality the helpline is not one line but something about 15 lines. When 2 users make a request at the same time, the 2nd user has to wait. Is there a commandto tell the bot to make 2 outputs at the same time?
Back to top
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Oct 16, 2006 11:20 am    Post subject: Reply with quote

Problem #1:
Since you say "user", I assume they're added to your bot's userlist.
In this case, I'd just use an XTRA-field (setuser <handle> XTRA help-last [unixtime]) to store a timestamp, and then compare it whenever a user calls your help-command (getuser <handle> XTRA)

Problem #2:
This is usually more a server-limitation, as ircd's generally has a throttling control to prevent flooding. Eggdrop uses several different queues and keeps track of "punishment points" in order to avoid beeing flooded off.
These queues have different priorities and are generally fifo (first in, first out).
At the same time, tcl is generally not multithreaded, specifically; only one command will be executed at a time in an interpreter (hence if you call a proc, it will run to the end before anything else can be called). So unless you wish to create 14 timers for each time an user types !help, you'll have to live with that...
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
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