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.

Excess flood !!!!

Old posts that have not been replied to for several years.
Locked
F
Fluxizm

Excess flood !!!!

Post by Fluxizm »

A friend wrote this simple script for me, which has a public trigger which prvmsg's the requester with a list of the clans rules, in total there are 10 individual rules or prvmsg's.

Code: Select all

set our_chan "#hgh"

bind pub - %clanrules clanruleshandler

proc clanruleshandler {nick uhost hand chan text} {

  global our_chan

  if {$chan != $our_chan} {
    return 0
  }
  putserv "privmsg $nick : 1......."
  putserv "privmsg $nick : 10......."
But if too many people trigger the request, then the bot quits due to excess flood, which isn't too clever really. I know that to an extent I could get round this by having one block of text to encompass all 10 rules, but would rather have the 10 individual rules, each on their own. Is there a simple way I can get round this excess flood problem?
[/code]
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

just add a utimer which disables the command for a certain number of seconds
Elen sila lúmenn' omentielvo
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

That or use the puthelp rather than putserv command.

tcl-commands.doc lightly explains this situation.
F
Fluxizm

Post by Fluxizm »

Thanks for the replies. I opted for the easier method of the puthelp, which so far has worked a treat.

However, Papillon, can u give me a small example of your solution? For my future referance please?

:)
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

There are three timers provided by eggdrop.

timer, utimer and the time bind.

Both timer and the time bind are called/check once per min, on a definable scale (IE, 2 mins, 3 mins, 50 mins). The time bind has more control over when it is first called.

utimer is a secondly timer, which again, can be called on a definable scale (1 second, 2 seconds, 50 seconds).


The time bind is used mainly in scripts that want to do somthing often, but do not need to manage the next time it is called.

timer and utimer are setup on the fly, and are ideal to call a single command, in a short time, mainly once.

Both timer and utimer use the same format
call <time> <command>
Where "call" is either timer or utimer.

To post your messages above, you could use

Code: Select all

utimer 1 [list putserv "privmsg $chan :hello all 1"]
utimer 2 [list putserv "privmsg $chan :hello all 2"]
utimer 3 [list putserv "privmsg $chan :hello all 3"]
utimer 4 [list putserv "privmsg $chan :hello all 4"]
This sends the message once per second.

However, these messages will be put in the queue like all other messages, and may not display right away.

It is far simpler and quicker to use puthelp, which is likely to display the messages just as quick as the timer method.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

I agree with ppslim... puthelp is the better solution..
btw that was not what I meant ppslim.. the utimer solution :)
I thought about something like:

Code: Select all

set our_chan "#hgh" 

bind pub - %clanrules clanruleshandler 

proc clanruleshandler {nick uhost hand chan text} { 

  global our_chan 
  
  if {$chan != $our_chan} { 
    return 0 
  } 
  unbind pub - %clanrules clanruleshandler 
  utimer 30 [ bind pub - %clanrules clanruleshandler ]
  putserv "privmsg $nick : 1......." 
  putserv "privmsg $nick : 10......." 

this should unbind the %clanrules command for 30 secs...
Elen sila lúmenn' omentielvo
F
Fluxizm

Post by Fluxizm »

Once again, thank you both for the replies

:)
Locked