;remote
alias atp remini $mircini nicklist $chan | flushini $mircini
on 1:active:#:{ $iif($readini($mircini,nicklist,$chan),atp,halt) }
on 1:part:#:{ $iif($readini($mircini,nicklist,$chan),atp,halt) }
on 1:nick:{
  %new.nick = $newnick 
  %new.chan = $comchan(%new.nick,1)
  set %temp 0
  :nickchange
  inc %temp 1
  if ($comchan($newnick,%temp)) { 
    goto nickchange
  }
  unset %temp
  haltdef
  if ($me isop $comchan($newnick,1)) && (%badnick == ON) { newnickcheck }
}
alias ntime {
  if (%extimestamp == OFF) { haltdef }
  if (%extimestamp == ON) { return $timestamp } 
}
on 1:DISCONNECT: {
  { /echo -s 0,2 Bağlandığınız irc serverdan koptunuz tekrar bağlanmayı deneyin ! | dsback }
}

on @1:BAN:#: { 
  if (%ip.ban == ON) { 
    unset %bip.no 
    :ipbanpro 
    inc %bip.no 
    if $ialchan($banmask,$chan,%bip.no).nick == $null goto ipbanend 
    if $ialchan($banmask,$chan,%bip.no).nick == $me goto ipbanpro
    if ($ialchan($banmask,$chan,%bip.no).nick ison $chan) && ($ialchan($banmask,$chan,%bip.no).nick !isop $chan) { kick $chan $ialchan($banmask,$chan,%bip.no).nick %ipkmsg Banlayan: $nick %isim
    }
    goto ipbanpro
    :ipbanend 
  }
}
on *:join:*: { 
  if (%clonetespit == ON) { 
    %clones = $ialchan($wildsite,#,0) 
    if ( %clones > 1 ) {
      var %count = 1 
      set %clone.nicks --> 
      while (%count <= %clones) {
        %clone.nicks = %clone.nicks $ial($wildsite,%count).nick 
      inc %count }
    /echo $chan $timestamp *  %clones Adet Clone : 4 $remove(%clone.nicks,-->)  1 ( $wildsite )  }
    ;  set %change $read -s $+ $address($nick,4) OzlemSohbet/Jiyan/notes.ini 
    ;    if (%change == $null) {
    ;      haltdef 
    ;     write OzlemSohbet/Jiyan/notes.ini $address($nick,4) $nick 
    ;   halt }
  }
}
on @1:text:*:#: {
  if (%repeat == ON) && ($nick !isop $chan) {
    if (%>reps_XXX [ $+ [ $nick ] $+ [ $chan ] ] == $1- ) { inc %>repsa_XXX [ $+ [ $nick ] $+ [ $chan ] ] }
    if (%>reps_XXX [ $+ [ $nick ] $+ [ $chan ] ] == $null)  { set -u20 %>reps_XXX [ $+ [ $nick ] $+ [ $chan ] ] $1- | inc -u20 %>repsa_XXX [ $+ [ $nick ] $+ [ $chan ] ] }
    if (%>repsa_XXX [ $+ [ $nick ] $+ [ $chan ] ] == 2) {
      repeatkick
      goto end
    } 
    :end
  }
}

on @^1:action:*:#: {
  if (%repeat == ON) && ($nick !isop $chan) {
    if (%>reps_XXX [ $+ [ $nick ] $+ [ $chan ] ] == $1- ) { inc %>repsa_XXX [ $+ [ $nick ] $+ [ $chan ] ] }
    if (%>reps_XXX [ $+ [ $nick ] $+ [ $chan ] ] == $null)  { set -u20 %>reps_XXX [ $+ [ $nick ] $+ [ $chan ] ] $1- | inc -u20 %>repsa_XXX [ $+ [ $nick ] $+ [ $chan ] ] }
    if (%>repsa_XXX [ $+ [ $nick ] $+ [ $chan ] ] == 2) {
      repeatkick
      goto end
    } 
    :end
  }
}
alias newnickcheck {
  set %i 0
  :checking
  inc %i 1
  set %currentsword $read -l $+ %i $mircdirOzlemSohbet\Jiyan\badnick.mrc
  if (%currentsword == $null) { .unset %i | goto end }
  else {
    if (%currentsword isin $newnick) { goto offense }
    else { goto checking }
  }
  :offense
  notice $newnick  $newnick  0,2 Nickini değiş adam ol.
  newbadnickkick
  .goto end  
  :end
  halt
}

alias badnickcheck {
  set %i 0
  :checking
  inc %i 1
  set %currentsword $read -l $+ %i $mircdirOzlemSohbet\Jiyan\badnick.mrc
  if (%currentsword == $null) { .unset %i | goto end }
  else {
    if (%currentsword isin %bnick) { goto offense }
    else { goto checking }
  }
  :offense
  badnickkick
  .goto end  
  :end
}

dialog OzlemSohbetnick {
  title "OzlemCafe mIRC - Yeni Nick"
  size -1 -1 105 43
  option dbu
  box Yeni Nickinizi  Aşağıdaki Bölüme Yazın, 20, 0 0 104 42
  text "Yeni Nick:", 4, 3 11 30 8
  edit "", 6, 38 10 60 10
  button "&Tamam", 1, 29 24 30 11, ok
  button "İ&ptal", 2, 64 24 30 11, cancel
}

on 1:dialog:OzlemSohbetnick:sclick:1: {
  if ($did(OzlemSohbetnick,6)) .nick $did(OzlemSohbetnick,6)
}

alias nick.ghost { /.remote on | /dialog -m nick.ghost nick.ghost }
dialog nick.ghost {
  title "OzlemCafe mIRC  Nick Kurtarma (Ghost)"
  size -1 -1 320 90
  box "" ,1, 5 2 310 50
  text "Nick:" ,2, 18 23 30 30
  edit "",3, 48 20 100 20, autohs
  text "Şifre:" ,4, 175 23 30 30
  edit "",5, 203 20 100 20, autohs
  button "Tamam" ,6, 85 60 60 25, ok
  button "İptal" ,7, 165 60 60 25, cancel
}
on 1:dialog:nick.ghost:sclick:6:{
  if ($did(3) != $null) || ($did(3) != $null) /nickserv ghost $did(3) $did(5)
}
