on *:start:if ($isfile(nick.zurna)) { hmake nick 50 | hload -i nick nick.zurna }
dialog ns {
  title "Sifre Paneli"
  size -1 -1 115 87
  option dbu
  icon 1, 3 3 108 25, icons/giris2.png, noborder
  text "Nickiniz:", 2, 17 43 25 8
  text "Sifresi:", 3, 17 53 25 8
  edit "", 4, 44 52 54 10, pass
  text "", 5, 45 43 52 8, center
  button "Gir", 6, 17 63 38 10, ok
  button "Nick degis", 7, 57 63 40 10
  text "Sunucu:", 8, 17 33 25 8
  text "", 9, 45 33 52 8, center
  link "Otomatik sistem icin tiklayiniz.", 10, 21 76 73 8
  list 11, 8 93 100 50, size vsbar 
  button "Sil", 13, 60 144 48 10
  check "Nick-imin guest olmasina izin verme.", 14, 10 157 100 10
  button "Kapat", 15, 37 169 37 12
  button "Yeni ekle", 16, 8 144 48 10
  text "", 17, 9 80 97 8, center
}
on ^*:notice:*:?: {
  if ($nick = nickserv) { 
    if (bu nick kayitli ve korumalidir. isin $1-) { 
      if ($group(#auto).status = on && $hget(nick,$me)) { ns identify $hget(nick,$me) }
      else _opendlg 
    }
  }
}
alias _opendlg $iif(!$dialog(ns),dialog -m ns ns)
on *:dialog:ns:*:*: {
  if ($devent = init) { 
    $iif($group(#auto).status = on,did -c $dname 14)
    did -ra $dname 5 $me | did -ra $dname 9 $network | did -h $dname 17 
  } 
  if ($devent = sclick) {
    if ($did = 15) dialog -x ns ns
    if ($did = 6) { 
      $iif(!$did($dname,4) || $len($did($dname,4)) < 5,$iif($input(sifre girmediniz veya girdiginiz sifre 5 karakterden az.,ow,HATA!) = $true,return,return),ns identify $did($dname,4))
      dialog -x ns ns 
    }
    if ($did = 7) nick $iif($input(Yeni nick giriniz.,oqe,Yeni nick.),$v1,$+(Guest,$ticks))
    if ($did = 10) { 
      var %s = 1 | while ($hget(nick,%s).item) { did -a $dname 11 $+($str($chr(160),20),$v1)) | inc %s }
      var %1 = 1 | while (%1 <= 96) { dialog -sb $dname -1 $calc($dialog(ns).y - 1) 115 $calc(87 + %1) | inc %1 } 
      did -v $dname 17 | did -b $dname 4,6,7 | did -h $dname 10 | did -ra $dname 17 - Otomatik sistem -
    }
    if ($did = 16) {
      var %_n = $?="Nick giriniz."
      if (!%_n) { echo -caet info Nick girmediniz. | return }
      if ($hget(nick,%_n)) { echo -caet info %_n nick-i listede zaten var. | return }
      else { 
        var %_s = $?=" %_n nickine ait sifreyi giriniz."
        if (!%_s) { echo -acte info %_n nickine ait sifreyi girmediniz. Ýslem iptal edildi. | return }
        else { hadd -m nick %_n %_s | hsave -i nick nick.zurna | did -a $dname 11 $+($str($chr(160),20),%_n) }
      }
    }
    if ($did = 13) {
      if (!$did($dname,11).sel) $iif($input(Listeden nick secmediniz.,ow,HATA!) = $true,return,return)
      else {
        var %_ni = $regsubex($did($dname,11).seltext,/ $+ $chr(160) $+ /g,)
        hdel nick %_ni | hsave -i nick nick.zurna | did -d $dname 11 $did($dname,11).sel
        echo -acte info %_ni nick-i ve ona ait veriler listeden silindi.
      }
    }
    if ($did = 14) $iif($did($dname,14).state,.enable #auto,.disable #auto)
  }
}
#auto on
-
#auto end
