| View previous topic :: View next topic |
| Author |
Message |
joke Voice
Joined: 19 Aug 2005 Posts: 13 Location: Karlsruhe
|
Posted: Mon Oct 16, 2006 9:41 am Post subject: User specific timer |
|
|
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 |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon Oct 16, 2006 11:20 am Post subject: |
|
|
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 |
|
 |
|
|
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
|
|