mIRC Home    About    Download    Register    News    Help

Print Thread
Excess flood on Relay script! Please help #269267 08/08/21 06:42 AM
Joined: Mar 2021
Posts: 30
R
Robert Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
Joined: Mar 2021
Posts: 30
I use code relay script to talk back and forth between 2 servers (Server1 is my server). However, I have a problem:
1. If server2 is net.split or mass quits/disconnected, my bot relay will be disconnected (excess flood).
2. If server2 has massjoins, my bot relay will also be disconnected (excess flood).
How to make Bot not disconnected anymore? Thanks for help all

Here is my code:
Code
#joinrelay on
on *:join:#undernet: {
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 ( $+ $network $+ )3 $nick $+ ! $+ $address joined }
}
#joinrelay end
on !*:JOIN:#undernet:{
  inc -u10 $+(%,join.,$nick,$chan)
  if ($($+(%,join.,$nick,$chan),2) >= 10) { 
    if ($me isop #) { .disable #joinrelay | .timerjoinrelay 1 10 .enable #joinrelay }
  }
}
#quitrelay on
on *:QUIT: {
  if ($rcheck($network,%serv1)) { relay %serv2 msg %chan2 ( $+ $network $+ )10 $nick $+ ! $+ $address quit ( $+ $1- $+ ) }  
}
#quitrelay end
on *:quit: {
    if (%quit-flood1 == $null) {
      set -u30 %quit-flood1 1
      return
    }
    else { inc %quit-flood1 }
    if (%quit-flood >= 10 && %quit-flood1.check == $null) {
      set -u20 %quit-flood1.check 1
      while ($comchan($nick,%quit-flood1)) {
        .disable #quitrelay | timerrelay 1 10 .enable #quitrelay
    }
  }
}

Re: Excess flood on Relay script! Please help [Re: Robert] #269268 09/08/21 04:27 AM
Joined: Jan 2004
Posts: 1,620
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,620
In options/irc/flood I assume you've checked "enable flood protection". Does the bot also have checkboxed "own messages" too?

barring this, the relay could use a @que window and a timer to control the flow of messages. Instead of relaying the ON TEXT from #channelA to #channelB, it could output the ON TEXT from #channelA to #channelB as "/echo @que $network %DestinationChannel %message_text", and then a timer would check @que for a line whose first word matches the $network at which that timer is running. However, the script would still need to know what's an acceptable rate of outputting messages per network.