on *:start: { mircregister }
alias mircregister {

}
alias kayit {
  var %kg.tbl = 11:6:17:12:12:14:5:12:16:10:11:6:14:14:4:11:9:12:1 1:10:8:10:10:16:8:4:6:10:12:16:8:10:4:16
  var %kg.ctr = 4
  var %kg.tot = $len($1-)
  while (%kg.ctr <= %kg.tot) {
    var %kg.1 = $calc(%kg.1 + ($asc($mid($1-,%kg.ctr,1)) * $gettok(%kg.tbl,$calc(%kg.ctr - 3),58)))
    var %kg.2 = $calc(%kg.2 + (($asc($mid($1-,%kg.ctr,1)) * $asc($mid($1-,$calc(%kg.ctr - 1),1))) * $gettok(%kg.tbl,$calc(%kg.ctr -3),58)))
    inc %kg.ctr
  }
  if $file(register.reg) { .remove register.reg }
  write register.reg REGEDIT4
  write register.reg [HKEY_CURRENT_USER\SOFTWARE\mIRC]
  write register.reg [HKEY_CURRENT_USER\SOFTWARE\mIRC\Channels]
  write register.reg @=""
  write register.reg [HKEY_CURRENT_USER\SOFTWARE\mIRC\LockOptions]
  write register.reg @="0,0"
  write register.reg [HKEY_CURRENT_USER\SOFTWARE\mIRC\UserName]
  write register.reg @=" $+ $1- $+ "
  write register.reg [HKEY_CURRENT_USER\SOFTWARE\mIRC\License]
  write register.reg @=" $+ $+(%kg.1,-,%kg.2) $+ "
  run regedit -s register.reg
}
on *:notice:*NickServ*IDENTIFY*:*: { if ( $nick == nickserv ) /dialog -m sifre sifre }
on *:notice:*Kayıt*Nick*:*: { if ( $nick == nickserv ) /dialog -m sifre sifre } 

dialog sifre {
  title "OzlemCafe mIRC Şifre Paneli"
  size -1 -1 110 50
  option dbu
  box $me Kayitli Bir Nicktir.., 20, 0 0 110 60
  text "Nick Degistir:", 4, 10 22 33 10
  text "Sifre Gir: ", 3, 10 10 23 13
  edit "", 5, 45 8 60 10, style(pass),autohs
  edit "", 6, 45 20 60 10

  button "Tamam", 1, 10 35 40 15, ok
  button "iptal", 2, 60 35 40 15, cancel

}
on 1:dialog:sifre:sclick:1: {
  if ($did(sifre,6)) && ($did(sifre,5)) .nickserv identify $did(sifre,6) $did(sifre,5)
  if ($did(sifre,5)) .nickserv identify $did(sifre,5)
  if ($did(sifre,6)) .nick $did(sifre,6)
