All pastes #1417419 Raw Edit

Netsplit Detection

public text v1 · immutable
#1417419 ·published 2009-05-09 15:45 UTC
rendered paste body
/*
Netsplit Detection script.
Version 1.00
Relased into the Public Domain on May 9th, 2009
Written by: Joshua C
This comment must be left intact for the legal use of this script.
*/

on *:QUIT: {
 if ($nick != $me) {
  if (*.*.*.* iswm $1 && *.*.*.*.* iswm $2) || (*.*.*.*.* iswm $1 && *.*.*.* iswm $2) || (*.*.*.* iswm $1 && *.*.*.* iswm $2) {
   if (%netsplit == 1) {
    netsplit $1 $2
    inc %Netsplit. $+ $network
    inc %netsplit
    .timer 1 120 set %netsplit 1
   }
  }
 }
}

alias netsplit {
 var %c 1,%channels #mIRC #IRCHelp #support #idle #rsidle #idlerpg
 while ($chan(%c)) {
  if (!$istok(%channels,$v1,32)) {
   var %o $addtok(%o,$chan(%c),44)
   echo $color(text) -t $chan(%c) $+($chr(60),$chr(03),$nick($chan(%c),$me).color,$nick($chan(%c),$me).pnick,$chr(03),$chr(62)) 1,8/!\04Netsplit1,8/!\ There has been a 04NetSplit detected between12 $1 and12 $2 $+($chr(15),$chr(03),14,$chr(91),$chr(15),Seen:,,$chr(32),$chr(03),04,%Netsplit. [ $+ [ $network ] ],,$chr(32),$chr(15),Netsplits,$chr(03),14,$chr(93))
  }
  inc %c
 }
 .msg %o 1,8/!\04Netsplit1,8/!\ There has been a 04NetSplit detected between12 $1 and12 $2 $+($chr(15),$chr(03),14,$chr(91),$chr(15),Seen:,,$chr(32),$chr(03),04,%Netsplit. [ $+ [ $network ] ],,$chr(32),$chr(15),Netsplits,$chr(03),14,$chr(93))
}