;Setup

alias setup nx2kDLG etr.setup | %exstate | %nbrktchk | %nbrkline1 | %nbrkline2 | csepchoice | %fillchk | %logocheck | %nlistcheck | %csepline | %csepcheck | %csepchoice | %acrostate | %pingcheck | %thxcheck | %splitcheck | %athxdef | %seendef | %brktchk | %brkline1 | %brkline2 | %w.chk | %wmain | %wmid

dialog etr.setup {
  title "n×2k² config (/setup)"
  size -1 -1 150 153
  option dbu
  tab "Status", 1, 3 1 143 135
  box "", 300, 8 17 134 113, tab 1
  text "Away Status:", 301, 13 26 50 8, tab 1
  edit "Not Away", 302, 63 24 74 11, tab 1 read multi autohs
  text "Acronyms:", 303, 13 41 50 8, tab 1
  edit "Acro Status", 304, 63 39 74 11, tab 1 read multi autohs
  text "Auto Ping:", 305, 13 56 50 8, tab 1
  edit "auto ping status", 306, 63 54 74 11, tab 1 read multi autohs
  text "Sends/Gets:", 307, 13 71 50 8, tab 1
  edit "Number of gets", 308, 63 69 74 11, tab 1 read multi autohs
  button "Refresh", 309, 81 114 30 10, tab 1
  box "Description", 27, 13 183 186 30, tab 1
  text "Network:", 74, 13 86 50 8, tab 1
  edit $network, 75, 63 84 74 11, tab 1 read multi autohs
  text "Script Version:", 76, 13 101 50 8, tab 1
  edit n×2k² version %version, 77, 63 99 74 11, tab 1 read multi autohs
  button "Upgrade", 73, 41 114 30 10, tab 1
  tab "Serving", 2
  box "Server/Request Setup ", 85, 8 17 134 113, tab 2
  button "&FServe Setup...", 86, 21 79 50 12, tab 2
  button "F&TP Ad. Setup...", 87, 78 79 50 12, tab 2
  button "T&DCC Setup...", 88, 78 100 50 12, tab 2
  box "Description", 28, 34 179 198 30, tab 2
  button "&Requester Setup...", 68, 21 100 50 12, tab 2
  text "Note: Each file server option and the Requester has its own separate dialog. Once you click on the button for the type of server you want, another dialog will popup that will allow you to set it up.", 21, 16 28 116 34, tab 2
  tab "Display", 3
  combo 102, 12 35 39 160, tab 3 sort drop
  combo 103, 55 35 39 160, tab 3 sort drop
  combo 108, 98 35 39 160, tab 3 sort drop
  text "1st Color", 104, 19 24 25 10, tab 3
  text "2nd Color", 105, 62 24 25 10, tab 3
  text "Separator", 109, 105 24 25 10, tab 3
  check "Enable Logo", 24, 17 58 44 10, tab 3
  check "Separator Icon", 25, 69 58 47 10, tab 3
  edit "", 26, 118 58 14 10, tab 3 autohs
  box "Design Customization", 8, 8 51 134 54, tab 3
  edit %lb, 18, 85 79 14 10, tab 3 autohs
  check "Script Brackets", 19, 17 80 50 10, tab 3
  edit %rb, 20, 118 80 14 10, tab 3 autohs
  box "Colors", 60, 8 17 134 33, tab 3
  text "Left", 99, 69 81 14 8, tab 3
  text "Right", 100, 101 81 16 8, tab 3
  check "Whois Display", 71, 17 91 50 10, tab 3
  text "Main", 97, 69 92 14 8, tab 3
  edit %whoart, 98, 85 91 14 10, tab 3 autohs
  text "Middle", 112, 101 92 17 8, tab 3
  edit %whoart2, 113, 118 91 14 10, tab 3 autohs
  button "Setup", 29, 56 111 37 10, tab 3
  check "Nick Brackets", 69, 17 69 50 10, tab 3
  text "Left", 70, 69 70 14 8, tab 3
  edit %lbn, 96, 85 68 14 10, tab 3 autohs
  text "Right", 101, 101 70 16 8, tab 3
  edit %rbn, 106, 118 69 14 10, tab 3 autohs
  text "Note: Disable 'Nick Brackets' for MTS nick designs.", 110, 10 123 129 8, tab 3 center
  box "MTS Themes", 107, 8 106 134 26, tab 3
  tab "Info", 4
  text "AIM SN:", 120, 14 29 50 8, tab 4
  edit %etr.AIMSN, 121, 64 28 72 11, tab 4 multi autohs
  text "ICQ UIN:", 122, 14 44 50 8, tab 4
  edit %etr.ICQUIN, 123, 64 43 72 11, tab 4 multi autohs
  text "E-Mail:", 124, 14 58 50 8, tab 4
  edit %etr.EMAIL, 125, 64 57 72 11, tab 4 multi autohs
  text "Away nick:", 126, 14 73 50 8, tab 4
  edit %etr.awaynick, 127, 64 72 72 11, tab 4 multi autohs
  text "Sleep nick:", 128, 14 88 50 8, tab 4
  edit %etr.sleepnick, 129, 64 87 72 11, tab 4 multi autohs
  box "Personal Options", 41, 8 17 134 116, tab 4
  text "Nick Password:", 78, 14 103 50 8, tab 4
  edit %password, 79, 64 102 72 11, tab 4 pass autohs
  edit %etr.web, 12, 64 117 72 11, tab 4 autohs
  text "Website:", 11, 14 118 50 8, tab 4
  tab "Extras", 5
  box "Nicklist Colors", 9, 78 17 64 28, tab 5
  button "Auto Join", 13, 20 109 33 10, tab 5
  button "MP3 Player", 14, 58 109 33 10, tab 5
  box "Acronyms", 17, 8 17 63 38, tab 5
  box "Auto Ping", 15, 78 47 64 18, tab 5
  box "Netsplit Detector", 16, 8 57 63 18, tab 5
  radio "On", 31, 18 24 22 10, group tab 5
  radio "Off", 32, 42 24 21 10, tab 5
  button "Editor", 33, 25 44 28 8, tab 5
  radio "On", 34, 88 24 22 10, group tab 5
  radio "Off", 35, 113 24 21 10, tab 5
  radio "On", 36, 88 54 22 10, group tab 5
  radio "Off", 37, 113 54 21 10, tab 5
  radio "On", 38, 88 74 22 10, group tab 5
  radio "Off", 39, 113 74 21 10, tab 5
  check "Extended", 7, 22 32 38 10, tab 5
  box "Auto Voicer", 62, 78 67 64 18, tab 5
  radio "On", 63, 18 64 22 10, group tab 5
  radio "Off", 64, 42 64 21 10, tab 5
  box "!Seen Logging", 90, 8 77 63 28, tab 5
  radio "On", 91, 18 84 22 10, group tab 5
  radio "Off", 92, 42 84 21 10, tab 5
  box "Auto Thanker", 93, 78 87 64 18, tab 5
  radio "On", 94, 88 94 22 10, group tab 5
  radio "Off", 95, 113 94 21 10, tab 5
  button "Config", 48, 96 34 28 8, tab 5
  check "Clear list when full", 49, 13 93 56 10, tab 5
  text "Note: Some options only work under certain conditions.", 65, 7 123 134 8, tab 5 center
  box "", 89, 74 18 1 85, tab 5
  button "Protection", 6, 96 109 33 10, tab 5
  text "n×2k² - Sleek. Simple. Sufficient.", 40, 3 144 80 8
  button "Done", 10, 122 140 25 12, ok
  button "About", 67, 93 140 25 12
}

alias nicklistcolors {
  if (%nlistcolors == On) {
    var %nicknametocolor ready
    var %nicknameon 1
    while ( %nicknametocolor  != $null ) {
      %nicknametocolor = $nick(#,%nicknameon)
      if ( %nicknametocolor isop # ) { cline %ocolor # %nicknameon }
      elseif ( %nicknametocolor isvo # ) { cline %vcolor # %nicknameon }
      elseif ( %nicknametocolor isreg # ) { cline %rcolor # %nicknameon }
      else { cline 1 # %nicknameon }
      inc %nicknameon
    }
  }
  if (%nlistcolors == Off) {
    var %nicknametocolor ready
    var %nicknameon 1
    while ( %nicknametocolor  != $null ) {
      %nicknametocolor = $nick(#,%nicknameon)
      if ( %nicknametocolor isop # ) { cline $color(listbox text) # %nicknameon }
      elseif ( %nicknametocolor isvo # ) { cline $color(listbox text) # %nicknameon }
      elseif ( %nicknametocolor isreg # ) { cline $color(listbox text) # %nicknameon }
      else { cline 1 # %nicknameon }
      inc %nicknameon
    }
  }
}

dialog nicklist {
  title "nicklist colors"
  size -1 -1 60 100
  option dbu
  combo 1, 5 11 50 168, size drop
  box "Ops", 2, 1 1 58 25
  box "Voices", 3, 1 31 58 25
  combo 4, 5 41 50 139, size drop
  box "Regulars", 5, 1 61 58 25
  combo 6, 5 71 50 108, size drop
  button "Done", 7, 18 88 25 10, ok
}

on *:dialog:nicklist:init:0:{
  didtok nicklist 1 46 White.Black.Blue.Green.Red.Dark Red.Purple.Orange.Yellow.Neon Green.Dark Cyan.Cyan.Light Blue.Pink.Gray.Light Gray
  didtok nicklist 4 46 White.Black.Blue.Green.Red.Dark Red.Purple.Orange.Yellow.Neon Green.Dark Cyan.Cyan.Light Blue.Pink.Gray.Light Gray
  didtok nicklist 6 46 White.Black.Blue.Green.Red.Dark Red.Purple.Orange.Yellow.Neon Green.Dark Cyan.Cyan.Light Blue.Pink.Gray.Light Gray
  if (%ocolor) did -c nicklist 1 $calc(%ocolor + 1)
  if (%vcolor) did -c nicklist 4 $calc(%vcolor + 1)
  if (%rcolor) did -c nicklist 6 $calc(%rcolor + 1)
}
on *:dialog:nicklist:sclick:1:{
  set %ocolor $calc($did(nicklist,1).sel - 1)
}
on *:dialog:nicklist:sclick:4:{
  set %vcolor $calc($did(nicklist,4).sel - 1)
}
on *:dialog:nicklist:sclick:6:{
  set %rcolor $calc($did(nicklist,6).sel - 1)
}

on 1:dialog:etr.setup:*:*: {

  ;======== EDIT =========

  if ($devent == edit) {
    if ($did == 12) { set %etr.web $did(12) }
    if ($did == 18) { set %lb $did(18) }
    if ($did == 96) { set %lbn $did(96) }
    if ($did == 106) { set %rbn $did(106) }
    if ($did == 20) { set %rb $did(20) }
    if ($did == 26) { set %sepicon $did(26) }
    if ($did == 79) { set %password $did(79) }
    if ($did == 98) { set %whoart $did(98) }
    if ($did == 113) { set %whoart2 $did(113) }
    if ($did == 121) { set %etr.AIMSN $did(121) }
    if ($did == 123) { set %etr.ICQUIN $did(123) }
    if ($did == 125) { set %etr.EMAIL $did(125) }
    if ($did == 127) { set %etr.awaynick $did(127) }
    if ($did == 129) { set %etr.sleepnick $did(129) }
  }

  ;=========SCLICK========

  if ($devent == sclick) {
    if ($did == 48) { nx2kdlg nicklist }
    if ($did == 49) {
      if ($did(49).state) { set %fillcheck On | $note(Seen list (seen.ini) will be cleared when it is full.) | set %fillchk did -c etr.setup 49 }
      else { set %fillcheck Off | $note(Seen list (seen.ini) will not be cleared when full.) | unset %fillchk }
    }
    if ($did == 69) {
      if ($did(69).state) { set %nickbrackets On | did -e etr.setup 96 | did -e etr.setup 106 | set %nbrktchk did -c etr.setup 69 | set %nbrkline1 did -e etr.setup 96 | set %nbrkline2 did -e etr.setup 106 }
      else { set %nickbrackets Off | did -b etr.setup 96 | did -b etr.setup 106 | unset %nbrktchk | set %nbrkline1 did -b etr.setup 96 | set %nbrkline2 did -b etr.setup 106 | set %lbn ( | set %rbn ) }
    }
    if ($did == 91) { .enable #write | .enable #seen | set %seen On | $note(!seen logging enabled. you are now logging user activities in channels.) | set %seendef did -c etr.setup 91 }
    if ($did == 92) { .disable #write | .disable #seen | set %seen Off | $note(!seen logging disabled. you won't log any user activities in channels.) | set %seendef did -c etr.setup 92 }
    if ($did == 94) { .enable #VoiceOpTY | $note(autothanker enabled. you will publicly thank someone for op'ing/voicing you.) | set %athxdef did -c etr.setup 94 }
    if ($did == 95) { .disable #VoiceOPTY | $note(autothanker disabled. you won't give thanks when someone op's/voices you.) | set %athxdef did -c etr.setup 95 }
    if ($did == 13) { aj }
    if ($did == 14) { mp3 }
    if ($did == 19) {
      if ($did(19).state) { did -e etr.setup 18 | did -e etr.setup 20 | set %brktchk did -c etr.setup 19 | set %brkline1 did -e etr.setup 18 | set %brkline2 did -e etr.setup 20 }
      else { did -b etr.setup 18 | did -b etr.setup 20 | unset %brktchk | set %brkline1 did -b etr.setup 18 | set %brkline2 did -b etr.setup 20 | set %lb ( | set %rb ) }
    }
    if ($did == 24) {
      set %logoshow $did(24).state
      if ($did(24).state) { .timerlogo1 -o 0 1 logo | .timerlogo2 -o 0 1 adlogo | set %logocheck did -c etr.setup 24 }
      else { .timerlogo1 off | set %logo | unset %logocheck }
    }
    if ($did == 25) {
      if ($did(25).state) { did -e etr.setup 26 | set %csepcheck did -c etr.setup 25 | set %csepline did -e etr.setup 26 }
      else { did -b etr.setup 26 | unset %csepcheck | set %csepline did -b etr.setup 26 | set %sepicon : }
    }
    if ($did == 6) { protect }
    if ($did == 7) {
      if ($did(7).state) { set %fullacro On | $note(extended mode enabled. acros will work in sentences and alone.) | set %exon did -c etr.setup 7 }
      else { set %fullacro Off | $note(extended mode disabled. acros will work only when typed alone.) | unset %exon }
    }
    if ($did == 29) { themes }
    if ($did == 31) { set %acronyms On | $note(acronyms enabled.) | set %acrostate did -c etr.setup 31 | did -e etr.setup 7 | set %exstate did -e etr.setup 7 }
    if ($did == 32) { set %acronyms Off | $note(acronyms disabled.) | set %acrostate did -c etr.setup 32 | did -b etr.setup 7 | set %exstate did -b etr.setup 7 }
    if ($did == 33) { acro }
    if ($did == 34) { set %nlistcolors On | $note(nicklist coloring enabled.) | did -e etr.setup 48 | set %nlistcheck did -c etr.setup 34 }
    if ($did == 35) { set %nlistcolors Off | $note(nicklist coloring disabled.) | did -b etr.setup 48 | set %nlistcheck did -c etr.setup 35 }
    if ($did == 36) { .enable #autoping | $note(autoping enabled.) | set %pingcheck did -c etr.setup 36 }
    if ($did == 37) { .disable #autoping | $note(autoping disabled.) | set %pingcheck did -c etr.setup 37 }
    if ($did == 38) { .enable #VoiceOp | $note(autovoicer enabled. if opped you will +v servers automatically.) | set %thxcheck did -c etr.setup 38 }
    if ($did == 39) { .disable #VoiceOp | $note(autovoicer disabled. you will not +v servers automatically.) | set %thxcheck did -c etr.setup 39 }
    if ($did == 63) { .enable #netsplit | $note(netsplit detector enabled. you will give a public msg on a netsplit.) | set %splitcheck did -c etr.setup 63 }
    if ($did == 64) { .disable #netsplit | $note(netsplit detector disabled. you will not give a msg on netsplits.) | set %splitcheck did -c etr.setup 64 }
    if ($did == 67) { about }
    if ($did == 68) { nx2kDLG requester }
    if ($did == 71) {
      if ($did(71).state) { did -e etr.setup 98 | did -e etr.setup 113 | set %w.chk did -c etr.setup 71 | set %wmain did -e etr.setup 98 | set %wmid did -e etr.setup 113 }
      else { did -b etr.setup 98 | did -b etr.setup 113 | unset %w.chk | set %wmain did -b etr.setup 98 | set %wmid did -b etr.setup 113 | set %whoart — | set %whoart2 $chr(124) }
    }
    if ($did == 73) { update }
    if ($did == 86) { fs }
    if ($did == 87) { ftp }
    if ($did == 88) { tdcc }
    if ($did == 102) {
      set %fs.ncolor $calc($did(102).sel - 1)
      if ($did(102).sel < 11) { set %pc 0 $+ $calc($did(102).sel - 1) }
      if ($did(102).sel >= 11) && ($did(102).sel != 17) { set %pc  $+ $calc($did(102).sel - 1) }
      if ($did(102).sel > 11) && ($did(102).sel == 17) { set %pc  | set %fs.ncolor $null | did -u etr.setup 34 | did -c etr.setup 35 }
    }
    if ($did == 103) {
      set %fs.icolor $calc($did(103).sel - 1)
      if ($did(103).sel < 11) { set %sc 0 $+ $calc($did(103).sel - 1) }
      if ($did(103).sel >= 11) && ($did(103).sel != 17) { set %sc  $+ $calc($did(103).sel - 1) }
      if ($did(103).sel > 11) && ($did(103).sel == 17) { set %sc  | set %fs.icolor $null | did -u etr.setup 34 | did -c etr.setup 35 }
    }
    if ($did == 108) {
      if ($did(108).sel < 11) { set %tc 0 $+ $calc($did(108).sel - 1) }
      if ($did(108).sel >= 11) && ($did(108).sel != 17) { set %tc  $+ $calc($did(108).sel - 1) }
      if ($did(108).sel > 11) && ($did(108).sel == 17) { set %tc  | did -u etr.setup 34 | did -c etr.setup 35 }
    }
    if ($did == 309) { update.status }
  }

  ;=======INIT========

  if ($devent == init) {
    update.status
    if (%nlistcheck == did -c etr.setup 35) { did -b etr.setup 48 }

    var %x = 1
    did -i etr.setup 102 %x 00  White
    %x = %x + 1
    did -i etr.setup 102 %x 01  Black
    %x = %x + 1
    did -i etr.setup 102 %x 02  Blue
    %x = %x + 1
    did -i etr.setup 102 %x 03  Green
    %x = %x + 1
    did -i etr.setup 102 %x 04  Red
    %x = %x + 1
    did -i etr.setup 102 %x 05  Dark Red
    %x = %x + 1
    did -i etr.setup 102 %x 06  Purple
    %x = %x + 1
    did -i etr.setup 102 %x 07  Orange
    %x = %x + 1
    did -i etr.setup 102 %x 08  Yellow
    %x = %x + 1
    did -i etr.setup 102 %x 09  Neon Green
    %x = %x + 1
    did -i etr.setup 102 %x 10  Dark Cyan
    %x = %x + 1
    did -i etr.setup 102 %x 11  Cyan
    %x = %x + 1
    did -i etr.setup 102 %x 12  Neon Blue
    %x = %x + 1
    did -i etr.setup 102 %x 13  Pink
    %x = %x + 1
    did -i etr.setup 102 %x 14  Gray
    %x = %x + 1
    did -i etr.setup 102 %x 15  Light Gray
    %x = %x + 1
    did -i etr.setup 102 %x -- Plain

    var %x = 1
    did -i etr.setup 103 %x 00  White
    %x = %x + 1
    did -i etr.setup 103 %x 01  Black
    %x = %x + 1
    did -i etr.setup 103 %x 02  Blue
    %x = %x + 1
    did -i etr.setup 103 %x 03  Green
    %x = %x + 1
    did -i etr.setup 103 %x 04  Red
    %x = %x + 1
    did -i etr.setup 103 %x 05  Dark Red
    %x = %x + 1
    did -i etr.setup 103 %x 06  Purple
    %x = %x + 1
    did -i etr.setup 103 %x 07  Orange
    %x = %x + 1
    did -i etr.setup 103 %x 08  Yellow
    %x = %x + 1
    did -i etr.setup 103 %x 09  Neon Green
    %x = %x + 1
    did -i etr.setup 103 %x 10  Dark Cyan
    %x = %x + 1
    did -i etr.setup 103 %x 11  Cyan
    %x = %x + 1
    did -i etr.setup 103 %x 12  Neon Blue
    %x = %x + 1
    did -i etr.setup 103 %x 13  Pink
    %x = %x + 1
    did -i etr.setup 103 %x 14  Gray
    %x = %x + 1
    did -i etr.setup 103 %x 15  Light Gray
    %x = %x + 1
    did -i etr.setup 103 %x -- Plain

    var %x = 1
    did -i etr.setup 108 %x 00  White
    %x = %x + 1
    did -i etr.setup 108 %x 01  Black
    %x = %x + 1
    did -i etr.setup 108 %x 02  Blue
    %x = %x + 1
    did -i etr.setup 108 %x 03  Green
    %x = %x + 1
    did -i etr.setup 108 %x 04  Red
    %x = %x + 1
    did -i etr.setup 108 %x 05  Dark Red
    %x = %x + 1
    did -i etr.setup 108 %x 06  Purple
    %x = %x + 1
    did -i etr.setup 108 %x 07  Orange
    %x = %x + 1
    did -i etr.setup 108 %x 08  Yellow
    %x = %x + 1
    did -i etr.setup 108 %x 09  Neon Green
    %x = %x + 1
    did -i etr.setup 108 %x 10  Dark Cyan
    %x = %x + 1
    did -i etr.setup 108 %x 11  Cyan
    %x = %x + 1
    did -i etr.setup 108 %x 12  Neon Blue
    %x = %x + 1
    did -i etr.setup 108 %x 13  Pink
    %x = %x + 1
    did -i etr.setup 108 %x 14  Gray
    %x = %x + 1
    did -i etr.setup 108 %x 15  Light Gray
    %x = %x + 1
    did -i etr.setup 108 %x -- Plain

    did -c etr.setup 102 $calc($right(%pc,2) + 1)
    did -c etr.setup 103 $calc($right(%sc,2) + 1)
    did -c etr.setup 108 $calc($right(%tc,2) + 1)
  }
}

alias update.status {
  if (%awaystatus == Return) { did -ra etr.setup 302 Away: %awayreason }
  elseif (%awaystatus == Go) { did -ra etr.setup 302 Here }

  if (%acronyms == off) { did -ra etr.setup 304 Off }
  elseif (%acronyms == on) {
    if (%fullacro == on) { did -ra etr.setup 304 On: Extended }
    if (%fullacro == off) { did -ra etr.setup 304 On: Normal }
  }
  if ($group(#autoping) == on) { did -ra etr.setup 306 Enabled }
  elseif ($group(#autoping) == off) { did -ra etr.setup 306 Disabled }
  did -ra etr.setup 308 $send(0) / $get(0)
  did -ra etr.setup 75 $network
  did -ra etr.setup 77 n×2k² version %version
}
alias about { nx2kDLG about }

dialog about {
  title "About n×2k²"
  size -1 -1 132 103
  option dbu
  button "Done", 1, 54 92 25 10, ok
  link "n×2k² Website", 2, 49 72 40 8
  box "", 3, 1 0 130 91
  text "n×2k² 1.02", 4, 6 5 120 10, center
  text "by: baby^nina", 5, 6 15 120 7, center
  text "© 2000-2002, NinaX. All rights reserved.", 9, 6 81 120 7, center
  text "Special thanks to:", 7, 6 25 120 7, center
  text "CantSeem2FindMe, myndzi, Zmodem, Jagfire,", 8, 6 32 120 7, center
  text "Eric^^, boxer`, e2x0, ex|L, Dark_Greg,", 10, 6 39 120 7, center
  icon 11, 40 56 52 12,  $shortfn($mircdircore\images\LOGOs.jpg), 0
  text "mircscripts.org, beta testers, and YOU! ^_^", 12, 6 46 120 7, center
}

on 1:dialog:about:sclick:2: { run http://www.nx2k.org }
