mIRC Home    About    Download    Register    News    Help

Print Thread
#48934 12/09/03 08:34 AM
Joined: Sep 2003
Posts: 4
D
DeVante Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Sep 2003
Posts: 4
Hello,

Is there a way/code to make mIRC ignore all join/quit messages for a certain duration after detecting a certain amount of joins/quits in a duration of time?

More specifically, I want mIRC to detect more than 5 joins or quits within a 3 second period and ignore any more for like 10 seconds.

The reason is because as of now netsplits cause a large amount of joins and quits, and freezes up mIRC for a good minute or so.


.x[ DeVante ]x.
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
This should work...
Code:
on *:START:{
  unset %netsplitc
  unset %netsplit
}
on ^*:JOIN:#:{
  inc -u3 %netsplitc
  if ( %netsplitc == 5 ) {
    set -u10 %netsplit 1
  }
  if ( %netsplit ) {
    haltdef
  }
}
on ^*:QUIT:{
  inc -u3 %netsplitc
  if ( %netsplitc == 5 ) {
    set -u10 %netsplit 1
  }
  if ( %netsplit ) {
    haltdef
  }
}


Edit: Unset variables on start incase of quit during netsplit.

Joined: Sep 2003
Posts: 4
D
DeVante Offline OP
Self-satisified door
OP Offline
Self-satisified door
D
Joined: Sep 2003
Posts: 4
Awesome.

Seems to have worked. :>

One more question. I am trying to make the code you gave me echo something like "Netsplit detected. Ignoring joins/quits for the next 10 seconds."

However, I haven't been successful.

Any ideas?


.x[ DeVante ]x.
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
Should just have to add:
echo -a Netsplit detected. Ignoring joins/quits for the next 10 seconds
after the "set -u10 %netsplit 1" lines.

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
That will only kinda work. I mean, 5 people joining the same channel could indicate a split but consider this:

I'm on #chan1,#chan2,#chan3,#chan4,#chan5.

My friend, who also goes to those same channels just connected to IRC, so he types:
/join #chan1,#chan2,#chan3,#chan4,#chan5

That script will register that as a netsplit. Imho a better way to do it would be to do something like %<thescid>.<thechannel>.<netsplitc>

The scid is because the same problem can potentially occur if 2 people join #chan1 @ DALnet and 1 joins #chan1 @ Undernet and 2 join #chan1 @ EFnet (assuming I'm on all those channels).


Link Copied to Clipboard