mIRC Homepage
Posted By: MRic3 My script floods user.. how to stop/change? - 16/08/04 08:07 PM
I have a script that reads from a (big) hash table and the notice's the chatter...

The hash tableis big so it wil flood the user... frown
How to time the notice's
Code:
  [color:green] alias flitsers {
  %rss.nummer = 2
  :nextflits
  if $hget(rssfeed,<description> $+ %rss.nummer) {
    timer 1 2 notice %rss.nick $hget(rssfeed,<description> $+ %rss.nummer) 
    inc %rss.nummer
    goto nextflits  
  }
  unset %rss.* 
}
 [/color]  


Why does the timer not work properly???

p.s. i did a search on this forum on flood but there was nothing i think i could use....
Posted By: Sigh Re: My script floods user.. how to stop/change? - 16/08/04 08:12 PM
All the /timer commands are performed in the same process almost instantaneously, so all notices will occur within 2 seconds of performing that alias. You can use %rss.nummer to generate a delay, so if you want a two second delay between each notice use the following:

.timer 1 $calc(2*(%rss.nummer -2)) .notice %rss.nick $hget(rssfeed,<description> $+ %rss.nummer)

So the first notice is sent after 0 seconds (after the alias finishes processing) and the next occurs 2 seconds after that and so on. The . in .timer and .notice makes the commands quiet, you will not see the output i.e. you will not see all those timers being initiated and you will not see the notice being sent
Posted By: Iori Re: My script floods user.. how to stop/change? - 17/08/04 08:49 AM
Another way would be to make use of /play smile

alias flitsers {

  • var %i = 2,%a = $ticks $+ .txt
    [color:green] ; %i is the loop counter
    ; %a is a unique filename for the output (similar to 123456.txt)

    while $hget(rssfeed,<description> $+ %i) { write %a $v1 | inc %i }
    ; ^ writes all the output to the file

    .play -n %rss.nick %a 1500
    ; /play -n sends the lines via /notice
    .remove %a
}[/color]

This will send the results with a 1500ms (1.5 second) delay between lines sent.
I tried both variantions and they do work ..
but still many clients block the bot because it floods...
maybe their timers are to tight ???

I increased the timers drasticly to 5 sec per line.. no effect..
I think i have to find a different way to push the info....
Maybe i'll just DCC the info (file) wink
© mIRC Discussion Forums