;=================== dialog option ==================
alias menu { 
  dialog -m menu menu
  if ($dialog(menu) != $null) {
    set %stemp 2
    :start
    inc %stemp 2
    dialog -s menu $dialog(menu).x $dialog(menu).y %stemp 149
    if (%stemp >= 198) { goto done }
    goto start 
    :done
  }
}
dialog menu {
  title "Mode Option"
  size 275 170 200 129
  option pixels
  button modeProtection, 2, 2 5 195 20, flat
  button "modeIdentify", 3, 2 25 195 20, flat
  button modeAutojoin, 10, 2 45 195 20, flat
  button modeAway, 11, 2 65 195 20, flat
  button modesetScript, 12, 2 85 195 20, flat
  button mode mp3, 13, 2 105 195 20, flat 
  button DONE!!, 14, 2 125 195 20, flat ok
}
on *:DIALOG:menu:*:*: {
  if ($devent == sclick) {
    if ($did == 2) { protection } 
    if ($did == 3) { autoien }
    if ($did == 10) { autojoin }
    if ($did == 11) { xaway }
    if ($did == 12) { MetalX }
    if ($did == 13) { player }
    if ($did == 14) { .timer -mo 1 1 fade_out $dname | halt }
  }
}
;-----------------------------Dialog Kicksystem---------------------------------
alias menukick { 
  dialog -m menukick menukick
  if ($dialog(menukick) != $null) {
    set %stemp 2
    :start
    inc %stemp 1
    dialog -s menukick $dialog(menukick).x $dialog(menukick).y %stemp 152
    if (%stemp >= 104) { goto done }
    goto start 
    :done
  }
}
dialog menukick {
  title "Menukick"
  size 83 68 52 76
  option dbu
  button Enable war, 2, 2 4 48 10, flat
  button "Disable war", 3, 2 14 48 10, flat
  button Rannick on, 4, 2 24 48 10, flat
  button Rannick off, 5, 2 34 48 10, flat
  button Stop Kick, 6, 2 44 48 10, flat
  button Clear List, 7, 2 54 48 10, flat
  button DONE!!, 8, 2 64 48 10, ok flat
  box , 17, 0 -2 52 78

}
on *:DIALOG:menukick:*:*: {
  if ($devent == sclick) {
    if ($did == 2) { wron } 
    if ($did == 3) { wroff }
    if ($did == 4) { rnon }
    if ($did == 5) { rnoff }
    if ($did == 6) { stop }
    if ($did == 7) { clearkick }
    if ($did == 8) { .timer -mo 1 1 fade_out $dname | halt }
  }
}
alias rnon { set %krn on | msg $active $sleb(mOde,rAnOn)  }
alias rnoff { set %krn off | msg $active $sleb(mOde,rAnOff)  }
alias wron { set %war à»Ô´ | msg $active $sleb(mOde,wArOn) }
alias wroff { set %war »Ô´ | msg $active $sleb(mOde,wArOff) }
;-----------------------------Dialog Joinchannel---------------------------------
alias joinchan { 
  dialog -m  joinchan  joinchan
  if ($dialog(joinchan) != $null) {
    set %stemp 2
    :start
    inc %stemp 2
    dialog -s joinchan $dialog(joinchan).x $dialog(joinchan).y %stemp 160
    if (%stemp >= 176) { goto done }
    goto start 
    :done
  }
}
dialog joinchan {
  title "Menu Channel"
  size -1 1 175 161
  option pixels
  box , 1, 0 -2 176 162
  edit , 2, 3 9 107 23, autohs
  button à¾ÔèÁ, 3, 111 9 60 22, disable flat
  list 4, 3 31 107 150, sort
  button "Åº", 5, 111 33 60 22, disable flat
  button à¢éÒ, 6, 111 55 60 22, disable flat
  button "»Ô´", 7, 111 132 60 22, ok flat
}
on 1:dialog:joinchan:*:*:{ 
  if ($devent == init) { cekchan }
  if ($devent == edit) {
    if ($did == 2) { did -e $dname 3 }
  }
  if ($devent == sclick) {
    if ($did == 3) {
      if ($chr(35) isin $did(2)) { write $mircdir\channel.exe  $did(2) | did -a $dname 4 $did(2) | did -r $dname 2 }
      else { write $mircdir\channel.exe $chr(35) $+ $did(2) | did -a $dname 4 $chr(35) $+ $did(2) | did -r $dname 2 }
    }
    if ($did == 4) { did -e $dname 5 | did -e $dname 6 }
    if ($did == 5) { write -ds $did(4,$did(4).sel) $mircdir\channel.exe | did -r $dname 4 | cekchan }
    if ($did == 6) { msg $active $logoi $did(4,$did(4).sel) $logoj | join $did(4,$did(4).sel) }
    if ($did == 7) { .timer -mo 1 1 fade_out $dname | halt }
  }
  if ($devent == dclick) {
    if ($did == 4) {
      msg $active $logoi $did(4,$did(4).sel) $logoj | join $did(4,$did(4).sel)
    }
  }
}
alias cekchan {
  %chanc = 1 
  :cekchan
  %cenel = $read -l $+ %chanc $mircdir\channel.exe
  if (%cenel == $null) { goto tamat }
  else { did -a joinchan 4 %cenel | unset %cenel | inc %chanc 1 | goto cekchan }
  :tamat
  halt 
}
;-----------------------------Dialog Query---------------------------------
alias menuzip { 
  dialog -m menuzip menuzip
  if ($dialog(menuzip) != $null) {
    set %stemp 2
    :start
    inc %stemp 1
    dialog -s menuzip $dialog(menuzip).x $dialog(menuzip).y %stemp 75
    if (%stemp >= 222) { goto done }
    goto start 
    :done
  }
}
dialog menuzip {
  title "Mode Qurity"
  size -1 -1 111 37
  option dbu
  box , 1, 0 -3 111 31
  edit "", 2, 29 2 80 11
  text "massage", 3, 3 3 22 8
  box , 6, 2 10 107 16
  button "DONE!!", 7, 0 28 111 9, flat ok
  button ÃÑº«Ôº, 4, 4 15 51 9, flat
  button "äÁèÃÑº«Ôº", 5, 56 15 51 9, flat
}
on *:dialog:menuzip:*:*: {
  if ($devent == init) {
    .did -ra menuzip 2 %äÁèÃÑº«Ôº
  }
  if ($devent == sclick) {
    %äÁèÃÑº«Ôº = $did(2)
    if ($did == 4) { openzip } 
    if ($did == 5) { closezip | msz }
    if ($did == 7) { .timer -mo 1 1 fade_out $dname | halt }
  }
}
alias openzip { set %msg on | echo -a $sleb(Mode,Zip,Enable) }
alias closezip { set %msg off | echo -a $sleb(Mode,Zip,Disable) }
alias msz {   if (%äÁèÃÑº«Ôº == $null) { set %äÁèÃÑº«Ôº  Don't Zip me in time now }  
  if (%äÁèÃÑº«Ôº != $null) { echo -a User Automesage >>> ( %äÁèÃÑº«Ôº ) }
}
;-----------------------------Dialog CallYou---------------------------------
alias Callyou { 
  dialog -m callyou callyou
  if ($dialog(callyou) != $null) {
    set %stemp 2
    :start
    inc %stemp 1
    dialog -s callyou $dialog(callyou).x $dialog(callyou).y %stemp 103
    if (%stemp >= 222) { goto done }
    goto start 
    :done
  }
}
dialog callyou {
  title "Has call You"
  size -1 -1 111 52
  option dbu
  box , 1, 0 23 111 16
  edit "", 2, 29 2 80 11
  text "massage", 3, 3 3 22 8
  box "", 6, 0 -3 111 29
  button "DONE!!", 7, 2 41 106 9, flat ok
  button "Enable", 4, 2 28 52 9, flat
  button Disable, 5, 56 28 52 9, flat
  edit , 8, 29 13 50 11
  text Yourname, 9, 3 15 25 8
  box "", 10, 0 36 111 16
  box "", 11, 79 11 30 13
  text "PrimitiveX", 12, 82 15 24 8, disable
}
on *:dialog:callyou:*:*: {
  if ($devent == init) {
    .did -ra callyou 2 %µÍºÃÑº
    .did -ra callyou 8 %name
  }
  if ($devent == sclick) {
    %µÍºÃÑº = $did(2)
    %name = $did(8)
    if ($did == 4) { openmsg | nin | ms } 
    if ($did == 5) { closemsg }
    if ($did == 7) { .timer -mo 1 1 fade_out $dname | halt }
  }
}
alias openmsg { set %accetp on | echo -a $sleb(Mode,accept,Enable) }
alias closemsg { set %accetp off | echo -a $sleb(Mode,accetp,Disable) }
alias nin { echo -a $sleb(Your,Nick,name) is ( %name )
  alias ms {   if (%µÍºÃÑº == $null) { set %µÍºÃÑº What do you want ?? $nick }  
    if (%µÍºÃÑº != $null) { echo -a User Automesage >>> ( %µÍºÃÑº )  }
  }
}
;-----------------------------Dialog Autojoin---------------------------------
alias autojoin { 
  dialog -m autojoin autojoin
  if ($dialog(autojoin) != $null) {
    set %stemp 2
    :start
    inc %stemp 2
    dialog -s autojoin $dialog(autojoin).x $dialog(autojoin).y %stemp 315
    if (%stemp >= 165) { goto done }
    goto start 
    :done
  }
}
dialog autojoin {
  title "Mode Auto Join "
  size 287 120 168 315
  option pixels
  button "&Ok", 1, 7 288 152 20, flat ok
  edit "", 3, 60 15 100 20, autohs
  text "Channel 1", 4, 7 17 50 20
  edit , 5, 60 35 100 20, autohs
  text Channel 2, 6, 7 38 50 20
  edit "", 7, 60 55 100 20, autohs
  text Channel 3, 8, 7 58 50 20
  edit "", 9, 60 75 100 20, autohs
  text "Channel 4", 10, 7 78 50 20
  edit "", 11, 60 95 100 20, autohs
  text Channel 5, 12, 7 98 50 20
  edit "", 13, 60 115 100 20, autohs
  text Channel 6, 14, 7 118 50 20
  edit "", 15, 60 135 100 20, autohs
  text Channel 7, 16, 7 138 50 20
  box Auto Join , 17, 1 1 165 260
  box "", 18, 1 258 165 55
  radio Enable, 20, 7 268 60 20
  radio Disable, 21, 102 268 60 20
  text "Channel 8", 19, 7 158 50 20
  text Chennel 9, 22, 7 178 50 20
  text Chennel10, 23, 7 198 50 20
  text Chennel11, 24, 7 217 50 20
  text Chennel12, 25, 7 238 50 20
  edit "", 26, 60 155 100 20
  edit "", 27, 60 175 100 20
  edit "", 28, 60 195 100 20
  edit "", 29, 60 215 100 20
  edit "", 30, 60 235 100 20
}
on 1:dialog:autojoin:edit:*: { 
  if ($did == 3) { set %autojoin1 $did(3,name.text) }
  if ($did == 5) { set %autojoin2 $did(5,name.text) }
  if ($did == 7) { set %autojoin3 $did(7,name.text) }
  if ($did == 9) { set %autojoin4 $did(9,name.text) }
  if ($did == 11) { set %autojoin5 $did(11,name.text) }
  if ($did == 13) { set %autojoin6 $did(13,name.text) }
  if ($did == 15) { set %autojoin7 $did(15,name.text) }
  if ($did == 26) { set %autojoin8 $did(26,name.text) }
  if ($did == 27) { set %autojoin9 $did(27,name.text) }
  if ($did == 28) { set %autojoin10 $did(28,name.text) }
  if ($did == 29) { set %autojoin11 $did(29,name.text) }
  if ($did == 30) { set %autojoin12 $did(30,name.text) }
}
on 1:dialog:autojoin:init:0: {
  if (%autojoin1 != $null) { did -a autojoin 3 %autojoin1 }
  if (%autojoin2 != $null) { did -a autojoin 5 %autojoin2 }
  if (%autojoin3 != $null) { did -a autojoin 7 %autojoin3 }
  if (%autojoin4 != $null) { did -a autojoin 9 %autojoin4 }
  if (%autojoin5 != $null) { did -a autojoin 11 %autojoin5 }
  if (%autojoin6 != $null) { did -a autojoin 13 %autojoin6 }
  if (%autojoin7 != $null) { did -a autojoin 15 %autojoin7 }
  if (%autojoin8 != $null) { did -a autojoin 26 %autojoin8 }
  if (%autojoin9 != $null) { did -a autojoin 27 %autojoin9 }
  if (%autojoin10 != $null) { did -a autojoin 28 %autojoin10 }
  if (%autojoin11 != $null) { did -a autojoin 29 %autojoin11 }
  if (%autojoin12 != $null) { did -a autojoin 30 %autojoin12 }
  if (%autojoin == ok)  { did -c autojoin 20 } | else { did -c autojoin 21 }
}
on 1:dialog:autojoin:sclick:*:{
  if ($did == 1)  { .timer -mo 1 1 fade_out $dname | halt }
  if ($did == 20) { set %autojoin ok }
  if ($did == 21) { set %autojoin ko }
}

ON 1:CONNECT: {
  if (%autojoin == ok) {
    if (%autojoin1 != $null) { .timer 1 5 join %autojoin1 }
    if (%autojoin2 != $null) { .timer 1 10 join  %autojoin2 }
    if (%autojoin3 != $null) { .timer 1 20 join  %autojoin3 }
    if (%autojoin4 != $null) { .timer 1 30 join  %autojoin4 }
    if (%autojoin5 != $null) { .timer 1 40 join  %autojoin5 }
    if (%autojoin6 != $null) { .timer 1  50 join  %autojoin6 }
    if (%autojoin7 != $null) { timer 1 60 join  %autojoin7 }
    if (%autojoin8 != $null) { .timer 1 70 join  %autojoin8 }
    if (%autojoin9 != $null) { .timer 1 80 join  %autojoin9 }
    if (%autojoin10 != $null) { .timer 1 90 join  %autojoin10 }
    if (%autojoin11 != $null) { .timer 1  100 join  %autojoin11 }
    if (%autojoin12 != $null) { timer 1 110 join  %autojoin12 }
    halt
    else { halt }
  }
  halt
}
;-----------------------------Dialog Autoiden---------------------------------
alias autoien { 
  dialog -m autoiden autoiden
  if ($dialog(autoiden) != $null) {
    set %stemp 2
    :start
    inc %stemp 2
    dialog -s autoiden $dialog(autoiden).x $dialog(autoiden).y %stemp 258
    if (%stemp >= 198) { goto done }
    goto start 
    :done
  }
}
dialog autoiden {
  title "ModeAuto identify"
  size 275 193 100 131
  option dbu
  box "", 1, 1 -2 98 130
  button "Nick1", 2, 5 5 24 10,flat 
  button "Nick2", 3, 5 15 24 10,flat 
  button "Nick3", 4, 5 25 24 10,flat 
  button "Nick4", 5, 5 35 24 10,flat 
  button "Nick5", 6, 5 45 24 10,flat 
  button "Nick6", 7, 5 55 24 10,flat 
  button "Nick7", 8, 5 65 24 10,flat 
  button "Nick8", 9, 5 75 24 10,flat 
  button "Nick9", 10, 5 85 24 10,flat 
  button "Nick10", 11, 5 95 24 10,flat 
  edit %nickauto1, 12, 47 5 50 10, autohs
  edit %nickauto2, 13, 47 15 50 10, autohs 
  edit %nickauto3, 14, 47 25 50 10, autohs 
  edit %nickauto4, 15, 47 35 50 10, autohs 
  edit %nickauto5, 16, 47 45 50 10, autohs 
  edit %nickauto6, 17, 47 55 50 10, autohs 
  edit %nickauto7, 18, 47 65 50 10, autohs 
  edit %nickauto8, 19, 47 75 50 10, autohs 
  edit %nickauto9, 20, 47 85 50 10, autohs 
  edit %nickauto10, 21, 47 95 50 10, autohs 
  button "iden", 22, 29 5 14 10,flat 
  button "iden", 23, 29 15 14 10,flat 
  button "iden", 24, 29 25 14 10,flat 
  button "iden", 25, 29 35 14 10,flat 
  button "iden", 26, 29 45 14 10,flat 
  button "iden", 27, 29 55 14 10,flat 
  button "iden", 28, 29 65 14 10,flat 
  button "iden", 29, 29 75 14 10,flat 
  button "iden", 30, 29 85 14 10,flat 
  button "iden", 31, 29 95 14 10,flat 
  button "Ok", 33, 60 113 34 10,flat, ok
  icon 32, 7 108 15 15,[P]rimitive[X].exe
  text "MetalX",34, 28 113 25 8,disable
}
on *:dialog:autoiden:*:*:{
  if ($devent == edit) {
    if ($did == 12) { set %nickauto1 $did(12) }
    if ($did == 13) { set %nickauto2 $did(13) }
    if ($did == 14) { set %nickauto3 $did(14) }
    if ($did == 15) { set %nickauto4 $did(15) }
    if ($did == 16) { set %nickauto5 $did(16) }
    if ($did == 17) { set %nickauto6 $did(17) }
    if ($did == 18) { set %nickauto7 $did(18) }
    if ($did == 19) { set %nickauto8 $did(19) }
    if ($did == 20) { set %nickauto9 $did(20) }
    if ($did == 21) { set %nickauto10 $did(21) }
  }
  if ($devent == sclick) {
    if ($did == 2) { set %passauto1 $$?="Please input Pass Nick " }
    if ($did == 3) { set %passauto2 $$?="Please input Pass Nick " }
    if ($did == 4) { set %passauto3 $$?="Please input Pass Nick " }
    if ($did == 5) { set %passauto4 $$?="Please input Pass Nick " }
    if ($did == 6) { set %passauto5 $$?="Please input Pass Nick " }
    if ($did == 7) { set %passauto6 $$?="Please input Pass Nick " }
    if ($did == 8) { set %passauto7 $$?="Please input Pass Nick " }
    if ($did == 9) { set %passauto8 $$?="Please input Pass Nick " }
    if ($did == 10) { set %passauto9 $$?="Please input Pass Nick " }
    if ($did == 11) { set %passauto10 $$?="Please input Pass Nick " }
    if ($did == 22) { /ns identify %nickauto1 %passauto1 }
    if ($did == 23) { /ns identify %nickauto2 %passauto2 }
    if ($did == 24) { /ns identify %nickauto3 %passauto3 }
    if ($did == 25) { /ns identify %nickauto4 %passauto4 }
    if ($did == 26) { /ns identify %nickauto5 %passauto5 }
    if ($did == 27) { /ns identify %nickauto6 %passauto6 }
    if ($did == 28) { /ns identify %nickauto7 %passauto7 }
    if ($did == 29) { /ns identify %nickauto8 %passauto8 }
    if ($did == 30) { /ns identify %nickauto9 %passauto9 }
    if ($did == 31) { /ns identify %nickauto10 %passauto10 }
    if ($did == 33)  { .timer -mo 1 1 fade_out $dname | halt }
  }
}
on 1:notice:If this is your nickname*:?: {
  if ($me == %nickauto1) { .msg nickserv identify %passauto1 }
  if ($me == %nickauto2) { .msg nickserv identify %passauto2 }
  if ($me == %nickauto3) { .msg nickserv identify %passauto3 }
  if ($me == %nickauto4) { .msg nickserv identify %passauto4 }
  if ($me == %nickauto5) { .msg nickserv identify %passauto5 }
  if ($me == %nickauto6) { .msg nickserv identify %passauto6 }
  if ($me == %nickauto7) { .msg nickserv identify %passauto7 }
  if ($me == %nickauto8) { .msg nickserv identify %passauto8 }
  if ($me == %nickauto9) { .msg nickserv identify %passauto9 }
  if ($me == %nickauto10) { .msg nickserv identify %passauto10 }
}
On 1:TEXT:This nick*:?:{
  if ((%nident == On) && ($nick == nickserv)) {
    if ($me == %nick.1) { .msg nickserv identify %nickpass.1 | goto end }
    if ($me == %nick.2) { .msg nickserv identify %nickpass.2 | goto end }
    if ($me == %nick.3) { .msg nickserv identify %nickpass.3 | goto end }
    if ($me == %nick.4) { .msg nickserv identify %nickpass.4 | goto end }
    if ($me == %nick.5) { .msg nickserv identify %nickpass.5 | goto end }
    :end
  }
}
-----------------------------Dialog Setup---------------------------------
alias setup { 
  dialog -m setup setup
  if ($dialog(setup) != $null) {
    set %stemp 2
    :start
    inc %stemp 1.5
    dialog -s setup $dialog(setup).x $dialog(setup).y %stemp 140
    if (%stemp >= 330) { goto done }
    goto start 
    :done
  }
}
dialog setup {
  title "PrimitiveX Connection Server"
  size -1 -1 329 142
  option pixels
  box , 2, 0 -5 330 119
  text ª×èÍ, 4, 13 13 21 18
  text "Email", 6, 11 34 30 16
  text server, 8, 11 85 30 18
  combo 5, 46 11 123 62, edit drop
  edit , 7, 45 33 236 20
  combo 9, 46 84 236 57, edit drop
  button "Connect To Server", 3, 5 117 320 20, flat ok
  text "msg", 11, 10 66 30 17
  edit , 12, 46 63 236 20
  icon 14, 290 15 32 32, [P]rimitive[X].exe, 0
  text "MetalX", 10, 289 58 36 15, disable
  edit "", 13, 200 11 81 22,password
  text "Pass", 15, 171 14 27 17
  box , 16, 6 1 280 54
  box "", 17, 287 1 40 53
  box "", 18, 6 52 280 57
  box "", 19, 0 107 330 34
}
on 1:dialog:setup:*:*: {
  if ($devent == init) {  
    did -a $dname 9 irc.webmaster.com:6667
    did -a $dname 9 irc.webmaster.com:7000
    did -a $dname 9 irc.loxinfo.co.th:6667
    did -a $dname 9 irc.chat.i-kool.com:6667
    did -a $dname 9
    did -a $dname 5 %nick
    did -a $dname 5 %nickauto1
    did -a $dname 5 %nickauto2
    did -a $dname 5 %nickauto3
    did -a $dname 5 %nickauto4
    did -a $dname 5 %nickauto5
    did -a $dname 5 %nickauto6
    did -a $dname 5 %nickauto7
    did -a $dname 5 %nickauto8
    did -a $dname 5 %nickauto9
    did -a $dname 5 %nickauto10
    did -a $dname 7 $readini mirc.ini ident userid
    did -a $dname 12 %¢éÍ¤ÇÒÁÍ¸ÔºÒÂ
    did -a $dname 13 %passnick
  }
  if ($devent == sclick) { 
    if ($did == 3) { 
      set %¢éÍ¤ÇÒÁÍ¸ÔºÒÂ $did(12)
      set %nick $did(5) | set %passnick  $did(13)
      .nick %nick
      .identd on $did(7)
      .server $did(9)
      .timer 1 7 .pass %passnick
      .timer -mo 1 1 fade_out $dname | halt 
    }
  }
  if ($did == 1) { .timer -mo 1 1 fade_out $dname | halt }
}
;-----------------------------Dialog Timersystim---------------------------------
alias - { 
  dialog -m - - 
  if ($dialog(-) != $null) {
    set %stemp 2
    :start
    inc %stemp 1
    dialog -s - $dialog(-).x $dialog(-).y %stemp 48
    if (%stemp >= 181) { goto done }
    goto start 
    :done
  }
}
dialog - {
  title "Time system"
  size 193 68 180 47
  option pixels
  text "", 8, 40 7 73 15
  box , 1, 0 -7 181 36
  box "", 3, 3 -3 131 28
  button Show, 2, 136 4 40 20, flat
  button "DONE", 4, 0 29 180 18, flat ok
}
on *:dialog:-:init:*:{
  .did -ra  - 8 | .timer666 0 0 timerclock
}
alias timerclock { 
  if ($dialog(-) == $null) { .timer666 off }
  else { did -o - 8 1 $time(hh:nn:sstt) }
}
on *:dialog:-:*:*: {
  if ($did == 4) { .timer -mo 1 1 fade_out $dname | halt }
  if ($did == 2) { timeshow | halt }
}
alias timeshow { ame This time at <  $sleb($time(hh:nn:sstt))  >    }
;=================== end ==================
