Noticias:

Conecta vía mIRC en irc.terrachat.cl

Menú Principal

Netsplit Detector

Iniciado por TerraChat, Jul 18, 2024, 02:23 PM

Tema anterior - Siguiente tema

TerraChat

;----------------------------;
alias split { dialog -m nsplit nsplit }

dialog nsplit {
  title "Netsplit Detector"
  size -1 -1 80 60
  option dbu
  radio "On", 1, 6 9 25 10,
  radio "Off",2, 47 9 34 10
  check "All Chan",3,47 33 30 10
  check "Me",4, 6 33 20 10 
  button "OK", 5, 2 47 38 12, ok
  button "Cerrar",6,40 47 38 12,cancel
  box "Activar",7,2 2 76 20
  box "Mostrar mensaje",8,2 25 76 20

}

on 1:DIALOG:nsplit:init:*: {
  if (%split = on) { did -c  nsplit 1 }
  if (%split = off) { did -c nsplit 2 }
  if (%me.split = on) { did -c nsplit 4 }
  if (%me.split = off) { did -u nsplit 4 }
  if (%chan.split = on) { did -c nsplit 3 }
  if (%chan.split = off) { did -u nsplit 3 }
  mdxbegin
  mdx SetFont $dname 5,6 16 autohs
  mdx SetFont $dname 1,2,3,4 14  autohs
  mdx SetFont $dname 7,8 14  autohs

}


on 1:dialog:nsplit:sclick:1: { set %split on |  echo -as Split Detecter On }
on 1:dialog:nsplit:sclick:2: { set %split off |  echo -as Split Detecter Off }
on 1:dialog:nsplit:sclick:4: {
  if ($did(4).state = 1) { set %me.split on | set %chan.split off | did -u nsplit 3 }
  else { set %me.split off | set %chan.split on | did -c nsplit 3  }
}
on 1:dialog:nsplit:sclick:3: {
  if ($did(3).state = 1) { set %chan.split on | set %me.split off | did -u nsplit 4 }
  else { set %chan.split off | set %me.split on | did -c nsplit 4  }
}
on 1:dialog:nsplit:sclick:5:
on 1:dialog:nsplit:sclick:6:



on *:QUIT: { if (. isin $1) && (. isin $2) && ($3 == $null) && (%split = on) {
    if ($1 == %split.1) && ($2  == %split.2) goto end
    if (%chan.split = on) goto amsgsplit
    elseif (%me.split == on) goto echosplit 
    :amsgsplit
    amsg ␂Netsplit␂ $1 & $2 | goto next 
    :echosplit
    echo -as ␃15 $timestamp ␂Netsplit␂ $1 & $2  | goto next
    :next
    set %split.1 $1
    set %split.2 $2

    :end
  }
}