alias thanx { dialog -dm thanx thanx }

dialog thanx {
  title "           AUTO THANX MENU"
  size -1 -1 140 90
  icon $icodir(6.ico), 0 noborder
  option dbu
  tab "Owner", 1, 2 1 135 85 
  tab "Ops", 2
  tab "Voice", 3
  tab "Autokus + Hands", 4
  button " Aanzetten", 5, 30 20 70 10,tab1 
  button " Uitzetten", 6, 30 40 70 10,tab1
  button " Aanzetten", 7, 30 20 70 10,tab2
  button " Uitzetten", 8, 30 40 70 10,tab2
  button " Aanzetten", 9, 30 20 70 10,tab3
  button " Uitzetten", 10, 30 40 70 10,tab3
  button " Aanzetten", 11, 30 20 70 10,tab4
  button " Uitzetten", 12, 30 40 70 10,tab4
  button " Sluiten", 13, 30 60 70 10,ok
}
on *:dialog:thanx:sclick:5:{ .set %ownthnx On | echo -a 0,4 Thanx Menu 0,12 Owner Thanx Staat Nu AaN 0  }
on *:dialog:thanx:sclick:6:{ .set %ownthnx Off | echo -a 0,4 Thanx Menu 0,12 Owner Thanx Staat Nu UiT 0  }
on *:dialog:thanx:sclick:7:{ .set %opthnx On | echo -a 0,4 Thanx Menu 0,12 Ops Thanx Staat Nu AaN 0  }
on *:dialog:thanx:sclick:8:{ .set %opthnx Off | echo -a 0,4 Thanx Menu 0,12 Ops Thanx Staat Nu UiT 0  }
on *:dialog:thanx:sclick:9:{ .set %voicethnx On | echo -a 0,4 Thanx Menu 0,12 Voice Thanx Staat Nu AaN 0  }
on *:dialog:thanx:sclick:10:{ .set %voicethnx Off | echo -a 0,4 Thanx Menu 0,12 Voice Thanx Staat Nu UiT 0  }
on *:dialog:thanx:sclick:11:{ .set %kus On | echo -a 0,4 Thanx Menu 0,12 Auto Kus & Hands Staat Nu AaN 0  }
on *:dialog:thanx:sclick:12:{ .set %kus Off | echo -a 0,4 Thanx Menu 0,12 Auto Kus & Hands Staat Nu UiT 0  }

on 1:owner:#: {
  if ($opnick == $me) {  
    if (%ownthnx == On) { goto greet }
    if (%ownthnx == Off) { goto end }
    :greet
  .msg # 8,4(11:120,11(12)11,12(2)12,1(8B11e8D11a8N11k8T 11v8O11o8R 11d8E 11O8w11n8e11r..  8-11->8 $nick 12,1)1,12(11)12,11(0)8,4(11: | }
  .set %ownthnx Off
  .timer 1 5 set %ownthnx On
  halt
  :end
}
on 1:op:#: {
  if ($opnick == $me) {  
    if (%opthnx == On) { goto dankje }
    if (%opthnx == Off) { goto end }
    :dankje
  .msg # 8,4(11:120,11(12)11,12(2)12,1(8B11e8D11a8N11k8T 11v8O11o8R 11d8E 11o8P11s11..  8-11->8 $nick 12,1)1,12(11)12,11(0)8,4(11: | }
  .set %opthnx Off | .set %dank 0
  .timer 1 5 set %opthnx On | .set %dank 1
  halt
  :end
}
on *:deop:# $me: if ($opnick = $me) { .msg # 8,4)11:120,11(12)11,12(2)12,1(8W11a8a11R8o11M 8H11a8a11L 8J11e 8M11i8j11N 8@ 11W8e11G8 $nick 12,1)1,12(11)12,11(0)8,4)11: }
on *:devoice:# $me: if ($vnick = $me) { .msg # 8,4)11:120,11(12)11,12(2)12,1(8W11a8a11R8o11M 8H11a8a11L 8J11e 8M11i8j11N 8+ 11W8e11G8 $nick 12,1)1,12(11)12,11(0)8,4)11: }
on *:voice:# $me: if ($vnick = $me) && (%voicethnx == On) { .msg # 8,4(11:120,11(12)11,12(2)12,1(8B11e8D11a8N11k8T 11v8O11o8R 11d8E 11+ 8-11->8 $nick 12,1)1,12(11)12,11(0)8,4(11: | .set %voicethnx Off | .timer 1 5 set %voicethnx On }

on 1:TEXT:*:#: {
  if (%kus == On) { goto groet }
  if (%kus == Off) { goto end }
  :groet
  var %1 = $strip($1-)
  if ($me isin $strip($1-)) { goto meer }
  else { goto end }
  :meer
  if (kusss isin $strip($1-)) { kuzz }
  if (kuz isin $strip($1-)) { kuzz }
  if (kiss isin $strip($1-)) { kuzz } 
  if (kusz isin $strip($1-)) { kuzz }
  if (zoen isin $strip($1-)) { kuzz }
  if (lebber isin $strip($1-)) { kuzz }
  if (handd isin $strip($1-)) { handen }
  if (handnd isin $strip($1-)) { handen }
  if (handss isin $strip($1-)) { handen }
  else { goto end }
  :end
}
on *:ACTION:*:#:{ 
  if (%kus == On) { goto groet }
  if (%kus == Off) { goto end }
  :groet
  var %1 = $strip($1-)
  if ($me isin $strip($1-)) { goto meer }
  else { goto end }
  :meer
  if (kusss isin $strip($1-)) { kuzz }
  if (kuz isin $strip($1-)) { kuzz } 
  if (kusz isin $strip($1-)) { kuzz }
  if (kiss isin $strip($1-)) { kuzz } 
  if (zoen isin $strip($1-)) { kuzz }
  if (lebber isin $strip($1-)) { kuzz }
  if (handd isin $strip($1-)) { handen }
  if (handnd isin $strip($1-)) { handen }
  if (handss isin $strip($1-)) { handen }
  else { goto end }
  :end
}
on 1:NOTICE:*:#: {
  if (%kus == On) { goto groet }
  if (%kus == Off) { goto end }
  :groet
  var %1 = $strip($1-)
  if ($me isin $strip($1-)) { goto meer }
  else { goto end }
  :meer
  if (kusss isin $strip($1-)) { kuzz }
  if (kuz isin $strip($1-)) { kuzz }
  if (kiss isin $strip($1-)) { kuzz } 
  if (kusz isin $strip($1-)) { kuzz }
  if (zoen isin $strip($1-)) { kuzz }
  if (lebber isin $strip($1-)) { kuzz }
  if (handd isin $strip($1-)) { handen }
  if (handnd isin $strip($1-)) { handen }
  if (handss isin $strip($1-)) { handen }
  else { goto end }
  :end
}

alias kuzz {
  set -u20 %Kus.cnt. [ $+ [ $nick ] $+ . $+ [ $chan ] ] $calc( %Kus.cnt. [ $+ [ $nick ] $+ . $+ [ $chan ] ] + 1)
  if (%Kus.cnt. [ $+ [ $nick ] $+ . $+ [ $chan ] ] == 1) { .timer 1 2  msg $chan $read $mircdirdata\kus.txt | $rs(slurp.wav) }
  if (%Kus.cnt. [ $+ [ $nick ] $+ . $+ [ $chan ] ] => 2) { halt }
}

alias handen {
  set -u20 %Handen.cnt. [ $+ [ $nick ] $+ . $+ [ $chan ] ] $calc( %Handen.cnt. [ $+ [ $nick ] $+ . $+ [ $chan ] ] + 1)
  if (%Handen.cnt. [ $+ [ $nick ] $+ . $+ [ $chan ] ] == 1) { .timer 1 2  msg $chan $read $mircdirdata\hand.txt | $rs(hand.wav) }
  if (%Handen.cnt. [ $+ [ $nick ] $+ . $+ [ $chan ] ] => 2) { halt } 
}
