alias otooper { if ($dialog(otooper)) dialog -v otooper | else dialog -m otooper otooper }
dialog otooper {
  size -1 -1 251 145
  title "OzlemCafe mIRC Operator Ýslemi"
  button "Ok",1, 160 110 85 20, OK
  box "",2, 5 8 240 97
  text "Sunucu :",3, 15 20 45 20
  edit "",4, 70 20 115 20, autohs
  text "Nickiniz :",5, 15 50 55 20
  edit "",6, 70 48 115 20, autohs
  text "Sifeniz :",7, 15 80 55 20
  edit "",8, 70 78 115 20, autohs %oper.pass
  button "SiL",10, 190 20 40 20
  button "SiL",11, 190 48 40 20
  button "SiL",12, 190 78 40 20
  radio "Ac",13, 5 110 35 20,
  radio "Kapat",14, 45 110 45 20,
}
on *:DIALOG:otooper:edit:*: {
  if ($did == 6) { set %oper.nick $did(6) }
  if ($did == 8) { set %oper.pass $did(8).text }
  if ($did == 4) { set %oper.serv $did(4) }
}
on *:dialog:otooper:init:0:{
  laurellrenk
  did -o otooper 6 1 %oper.nick $did(6)
  did -o otooper 8 1 %oper.pass $did(8).text
  did -o otooper 4 1 %oper.serv $did(4)
  if (%oto.oper == on) { did -c otooper 13 1 %oto.oper $did(13) }
  if (%oto.oper == off) { did -c otooper 14 1 %oto.oper $did(14) }
  if (%oto.oper == off) { did -b $dname 3,4,5,6,7,8 }
  if (%oto.oper == on) { did -e $dname 3,4,5,6,7,8 }
}
on *:dialog:otooper:sclick:*:{
  if ($did == 10) { unset %oper.serv | did -o otooper 4 1 %oper.serv }
  if ($did == 11) { unset %oper.nick | did -o otooper 6 1 %oper.nick }
  if ($did == 12) { unset %oper.pass | did -o otooper 8 1 %oper.pass }
  if ($did == 13) { set %oto.oper on | did -e $dname 3,4,5,6,7,8 }
  if ($did == 14) { set %oto.oper off | did -b $dname 3,4,5,6,7,8 }
}
on *:connect: {
  if (%oper.nick != $null) && (%oper.pass != $null) && ($server == %oper.serv) && (%oto.oper == on) { oper %oper.nick %oper.pass }
}
alias laurellrenk {
  mdxdll SetMircVersion $version
  mdxdll MarkDialog $dname
  mdxdll SetDialog [ $dname ] bgcolor [ $rgb(190,190,190) ]
  mdxdll SetColor 3,5,7,13,14 textbg [ $rgb(190,190,190) ]
  mdxdll SetColor 3,5,7,13,14 background [ $rgb(190,190,190) ]
  mdxdll SetColor $dname 3,5,7,13,14 text $rgb(178,0,0)
  mdxdll SetColor $dname 4,6,8 text $rgb(200,200,200)
  mdxdll SetColor 4,6,8 textbg [ $rgb(0,64,128) ]
  mdxdll SetColor 4,6,8 background [ $rgb(0,64,128) ]
}
alias mdxdll { return (DLL\mdx.dll,$1,$2-) }
