;remote8
alias deopkick {
  if (%reop == ON) { if (%csstop != OFF)  cs deop $chan $nick | if (%csstop != OFF) cs op $chan $me }
  elseif (%revenge == ON) { if (%csstop != OFF) cs deop $chan $nick | if (%csstop != OFF) cs op $chan $me | .timer 1 3 ban2 $chan $nick %Bantype2 | .timer 1 4 kick $chan $nick %deopkmsg %isim }
  else goto nop
  :nop
}
dialog pref.deop {
  title "OzlemCafe mIRC"
  size -1 -1 230 125
  box "Deop Kick ",4, 20 15 190 72
  radio "ReOp",5, 35 34 52 12, group 
  radio "ReOp Kickban",6, 35 54 89 12
  button "&Tamam", 200, 15 97 200 20, ok 
}
on 1:dialog:pref.deop:*:*: {
  if ($devent == init) {
    if (%reop == ON) { did -c pref.deop 5 }
    if (%revenge == ON) { did -c pref.deop 6 }
  }
  if ($devent == sclick) {
    if ($did == 5) { set %reop ON | set %revenge OFF }
    if ($did == 6) { set %reop OFF | set %revenge ON }
  }
}
alias kickprotkick {
  if (%banflood != OFF) {
    set %banflood OFF
    if (%csstop != OFF) cs unban $chan $me
    if (%csstop != OFF) cs invite $chan $me
    if (%csstop != OFF) cs deop $chan %meandude
    .timer 1 3 join $chan
    .timer 1 3 cs op $chan $me
    .timer 1 7 kick $chan %meandude %kickprotkmsg %isim
    unset %meandude
    .timer 1 20 set %banflood ON
  }
  else {
    if (%csstop != OFF) cs unban $chan $me
    if (%csstop != OFF) cs invite $chan $me
    .timer 1 3 join $chan
    .timer 1 3 cs op $chan $me
    unset %meandude
    .timer 1 15 set %banflood ON
  }
}

alias -l _buser { .guser blacklist $1 3 }
alias -l _rbuser { .ruser blacklist $1 3 }
alias -l _luser { dialog -m _blacklist _blacklist }
alias -l _blist {
  did -r _blacklist 11
  var %_btotal = $ulist(*,blacklist,0) , %_b = 0
  while (%_b < %_btotal) {
    inc %_b
    did -a _blacklist 11 $ulist(*,blacklist,%_b)
  }
}
dialog _blacklist {
  title "OzlemCafe mIRC Kara Liste"
  size -1 -1 150 110
  option dbu
  text "Nicki Yazıp Ekle Deyin:" , 10 , 10 5 95 10 , left
  combo 11 , 10 15 95 85 , extsel sort autohs autovs
  edit "" , 12 , 10 95 95 10 , read autohs

  button "Ekle" , 20 , 115 35 30 20 , default 
  button "Sil" , 30 , 115 60 30 20 , default 

  button "Tamam" , 40 , 115 85 30 20 , ok 
}

on *:dialog:_blacklist:init:*: {
  _blist
}

on *:dialog:_blacklist:sclick:*: {
  if ($did == 20) {
    if ($did(11).text != $null && $level($did(11).text) != blacklist) {
      var %_badd = $did(11).text
      .auser blacklist %_badd
      _blist
      did -o $dname 12 1 %_badd Kara Listeye Alındı...
    }
  }
  if ($did == 30) {
    if ($did(11).text != $null && $level($did(11).text) == blacklist) {
      var %_brem = $did(11).text
      .ruser blacklist %_brem
      _blist
      did -o $dname 12 1 %_brem Kara Listeden Silindi...
    }    
  }
}

on @blacklist:join:#: {
  ban2 # $nick %Bantype2
  kick # $nick %klkmsg %isim
}


on @1:TEXT:*:#: {
  if ($len($strip($1-)) <= 29) { goto end }
  if ($capsop($1-) >= 0.5) && (%capskick == on) { /capskick }
  else { goto end }
  :end
}
on @1:ACTION:*:#: {
  if ($len($strip($1-)) <= 29) { goto end }
  if ($capsop($1-) > 0.5) && (%capskick == on) { /capskick }
  else { goto end }
  :end
}
