mIRC Home    About    Download    Register    News    Help

Print Thread
#14860 10/03/03 06:50 PM
Joined: Mar 2003
Posts: 1
S
sacred Offline OP
Mostly harmless
OP Offline
Mostly harmless
S
Joined: Mar 2003
Posts: 1
How would I go about hiding "in channel" quit messages, everytime a netsplit hits, and there are like thirty quits, I freeze up. Any help would be appreciated...thank you much

#14861 10/03/03 08:19 PM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
It will depend on the format that your network uses. Some networks show the two servers that split. Others do not. Some mask the servers

* Quits: Nick (userid@host) (*.dal.net *.dal.net)
* Quits: Nick (userid@host) (*.net *.split)

What you can do is try to detect the split from the quit message...however, even this method is not infallible on some networks. EFnet, for example, doesn't insert Quit: in the quit message, so you can "fake" lots of different kinds of quit messages.
Code:

on ^*:QUIT:{
  if ($istok(%NetSplits, $1-, 2) {
    set -u600 %NetSplits %NetSplits
    halt
  }
  if ($3 == $null && *.* iswm $1 && *.* iswm $$2) {
    set -u600 %NetSplits $addtok(%NetSplits, $1-, 2)
    echo $color(quit) -sbflirt * NetSplit
    halt
  }
}

This isn't a bulletproof solutions. It doesn't take quite a few things into account.
  • It doesn't remove the netsplit message from %NetSplits when the nicks return from the split.
  • It expires after 10 minutes, regardless of whatever else happens.
  • If 2 different splits occur within that 10 miinutes, it correctly adds the netsplit quit message to %NetSplits; however on networks that mask the split, all it will do is reset the timed unset back to 10 minutes. Users can't tell which servers have split on those networks (which is the point); thus, the quit message remains the same regardless. As far as the script is concerned, it's the same split.
There are other anomalies as well, but these give you the idea of why such a thing is rather difficult to adequately script to.

Is it still possible to catch and react to this? Of course, but it would be a LOT more complex. It would require, among other things, that you track who all left on which split so the script knows when they're all back (and therefore the netsplit is healed), rather than just seeing a couple of them return slowly after they've hopped servers. In order to detect if they've hopped servers to get back to the network, you'd have to also store which server each nick is on (easily done through 352's $5).

Obviously, a hash table is the best way to track all this information, but you'd probably want some way to "manage" it built into the script. Again, it's not overly difficult to do, but it's not as simple as a one-line script. The /set -u600 helps manage that variable, but it's certainly not infallible...nowhere near.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#14862 10/03/03 09:36 PM
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
You can also turn quit messages off altogether in mIRC Options - IRC - "Events"


Link Copied to Clipboard