dialog kk {
  title "kickcounter"
  size -1 -1 121 102
  option dbu
  box "counter", 1, 3 2 115 39
  text "you had kick", 2, 16 13 32 8
  text "time(s)", 3, 73 13 18 8
  edit %kick.count, 4, 49 12 22 10, disable, center
  button "unset", 5, 49 26 23 10
  button "ok", 6, 90 87 27 12, ok
  check "show kicknumber when you kick", 7, 9 57 91 10
  button "msg", 8, 6 70 23 10
  text "msg active chan your kickcount", 9, 33 71 77 8
  check "activate kickcounter", 10, 9 47 61 10
  box "option", 11, 3 41 115 43
  text "kickcounter by:z3a0s", 12, 4 89 70 8, disable
}

On *:Dialog:kk:sclick:5:{ if ($did == 5) { set %kick.count 0 } | if ($did == 5) did -ra kk 4 %kick.count }
On *:Dialog:kk:sclick:7:{ if ($did(7).state == 1) { set %show.kc On } | else { set %show.kc Off } }
On *:Dialog:kk:sclick:8:{ if ($active = Status Window) { halt } | else msg $active I have kicked %kick.count people Today [kickcounter] } }
On *:Dialog:kk:sclick:10:{ if ($did(10).state == 1) { set %ac.kc On } | else { set %ac.kc Off } }
On *:Dialog:kk:init:*:{ if (%show.kc == On) { did -c kk 7 } | if (%ac.kc == On) { did -c kk 10 } }

alias kick {
  if (%ac.kc == Off) { raw -q kick $1 $2 : $+ $3- | halt }
  else {
    if (!%kick.count) {
      set %kick.count 0
    }
    inc %kick.count 
    if (%show.kc == On) { raw -q kick  $1 $2 : $+ $3-   You are Kick Number: %kick.count $+ }
    else { raw -q kick $1 $2 : $+ $3- }
  }
}
alias kickcounter { dialog -m kk kk }

menu status,channel, {
  Kickcounter
  .total kicks ( $+ %kick.count $+ ):halt
  .unset:set %kick.count 0 
  .dialog:/kickcounter
}
on *:LOAD:{ echo -a Loaded [kickcounter v1.0]
  if ($version < 5.71) {
    echo -a You must use mIRC v5.71 or higher for this addon to work.
    echo -a Please upgrade to mIRC v5.71, and try again.
    .timer 1 3 unload -rs $script
    halt
  }
}
