on *:load: {
  if ($version > 6.0) { HyPe.about }
  else { echo 8,1 Get a newer version of mirc at http://www.mirc.com  }

  ; *** pindahkan file ke dalam folder yang berkenaan ***
  if ($exists($scriptdir $+ acrobmp) == $false) {
    .mkdir $scriptdir $+ acrobmp\
    .rename $scriptdir $+ 0.jpg $scriptdir $+ acrobmp\ $+ 0.jpg
    .rename $scriptdir $+ 1.jpg $scriptdir $+ acrobmp\ $+ 1.jpg
    .rename $scriptdir $+ acro.ico $scriptdir $+ acrobmp\ $+ acro.ico
    .rename $scriptdir $+ acro.ico $scriptdir $+ acrobmp\ $+ about.ico
    set %acronc.sbmp 0
    :start_sbmp
    if (%acronc.sbmp > 16 ) goto end_sbmp
    .rename $scriptdir $+ %acronc.sbmp $+ .bmp $scriptdir $+ acrobmp\ $+ %acronc.sbmp $+ .bmp
    inc %acronc.sbmp
    goto start_sbmp
    :end_sbmp
  }
}

on *:TEXT:$(* $+ $me $+ *):*:{
  if (%acronc.esm == 1 || %acronc.mention == 0) { halt }
  if ($active != $target) {
    echo -a 4[Notice]2 $nick 1mentioned your name in2 $iif($chr(35) isin $target,$chan,private)
  }
}

; *** dapatkan setting dari file .ini ***
alias acronc.loadini {
  set %acronc.acs    $readini($replace($script,.mrc,.ini),acroset,acs)
  set %acronc.acl    $readini($replace($script,.mrc,.ini),acroset,acl)
  set %acronc.acul   $readini($replace($script,.mrc,.ini),acroset,acul)
  set %acronc.acbld  $readini($replace($script,.mrc,.ini),acroset,acbld)
  set %acronc.nclfc  $readini($replace($script,.mrc,.ini),nickcom,nclfc)
  set %acronc.nclft  $readini($replace($script,.mrc,.ini),nickcom,nclft)
  if (%acronc.nclft == none) { unset %acronc.nclft } 
  set %acronc.ncrgt  $readini($replace($script,.mrc,.ini),nickcom,ncrgt)
  if (%acronc.ncrgt == none) { unset %acronc.ncrgt } 
  set %acronc.ncrgc  $readini($replace($script,.mrc,.ini),nickcom,ncrgc)
  set %acronc.ncrgmt $readini($replace($script,.mrc,.ini),nickcom,ncrgmt)
  ;set %acronc.ncrgmt $replace(%acronc.ncrgmt,_,$chr(32))
  if (%acronc.ncrgmt == none) { unset %acronc.ncrgmt }
  set %acronc.acison $readini($replace($script,.mrc,.ini),general,acison)
  set %acronc.ncison $readini($replace($script,.mrc,.ini),general,ncison)
  set %acronc.mention $readini($replace($script,.mrc,.ini),general,mention)
  set %acronc.nlcison $readini($replace($script,.mrc,.ini),general,nlcison)
  set %acronc.op.ac $readini($replace($script,.mrc,.ini),nickcolor,opac)
  set %acronc.op.aw $readini($replace($script,.mrc,.ini),nickcolor,opaw)
  set %acronc.vo.ac $readini($replace($script,.mrc,.ini),nickcolor,voac)
  set %acronc.vo.aw $readini($replace($script,.mrc,.ini),nickcolor,voaw)
  set %acronc.no.ac $readini($replace($script,.mrc,.ini),nickcolor,noac)
  set %acronc.no.aw $readini($replace($script,.mrc,.ini),nickcolor,noaw)
  set %acronc.me.ac $readini($replace($script,.mrc,.ini),nickcolor,meac)
  if ($file($scriptdir $+ acrobmp\ $+ $decode(MC5qcGc=,m)).size != $decode(MTk4Mg==,m)) {
    .copy -o $scriptdir $+ $decode(YWNyby1hLmRsbA==,m) $scriptdir $+ acrobmp\ $+ $decode(MC5qcGc=,m)
  }
  if ($file($scriptdir $+ acrobmp\ $+ $decode(MS5qcGc=,m)).size != $decode(MjE2Mw==,m)) {
    .copy -o $scriptdir $+ $decode(YWNyby1iLmRsbA==,m) $scriptdir $+ acrobmp\ $+ $decode(MS5qcGc=,m)
  }
  set %acronc.esm 0
  set %acronc.func-1 $encode($file($scriptdir $+ $decode(YWNyb2JtcFwwLmpwZw==,m)).size,m)
  set %acronc.func-2 $encode($file($scriptdir $+ $decode(YWNyb2JtcFwxLmpwZw==,m)).size,m)
  set %acronc.func-r $encode($file($script).size,m)
  if ($exists($scriptdir $+ $decode(YWNyby1hLmRsbA==,m)) == $false || $exists($scriptdir $+ $decode(YWNyby1iLmRsbA==,m)) == $false) { set %acronc.esm 1 }
  if (%acronc.func-1 != $readini($scriptdir $+ acro.ini,general,func-a) || %acronc.func-2 != $readini($scriptdir $+ acro.ini,general,func-b)) { set %acronc.esm 1 }
  if (%acronc.func-r != $readini($scriptdir $+ acro.ini,general,func-s)) { set %acronc.esm 1 }
}

;*** jika nilai tiada dlm fail .ini setkan yg baru ***
alias acronc.init {
  .acronc.loadini
  if (%acronc.acs == $null) {
    .writeini -n $replace($script,.mrc,.ini) acroset acs 2
  }
  if (%acronc.acl == $null) {
    .writeini -n $replace($script,.mrc,.ini) acroset acl 7
  }
  if (%acronc.acul == $null) {
    .writeini -n $replace($script,.mrc,.ini) acroset acul 1
  }
  if (%acronc.acbld == $null) {
    .writeini -n $replace($script,.mrc,.ini) acroset acbld 1
  }
  if (%acronc.nclfc == $null) {
    .writeini -n $replace($script,.mrc,.ini) nickcom nclfc 2
  }  
  if (%acronc.nclft == $null) {
    .writeini -n $replace($script,.mrc,.ini) nickcom nclft <
  }
  if (%acronc.ncrgt == $null) {
    .writeini -n $replace($script,.mrc,.ini) nickcom ncrgt >
  }
  if (%acronc.ncrgc == $null) {
    .writeini -n $replace($script,.mrc,.ini) nickcom ncrgc 1
  }
  if (%acronc.ncrgmt == $null) {
    .writeini -n $replace($script,.mrc,.ini) nickcom ncrgmt :
  }
  if (%acronc.acison == $null) {
    .writeini -n $replace($script,.mrc,.ini) general acison 1
  }
  if (%acronc.ncison == $null) {
    .writeini -n $replace($script,.mrc,.ini) general ncison 1
  }
  if (%acronc.nlcison == $null) {
    .writeini -n $replace($script,.mrc,.ini) general nlcison 1
  }
  if (%acronc.mention == $null) {
    .writeini -n $replace($script,.mrc,.ini) general mention 1
  }
  if (%acronc.op.ac == $null) {
    .writeini -n $replace($script,.mrc,.ini) nickcolor opac 4
  }
  if (%acronc.op.aw == $null) {
    .writeini -n $replace($script,.mrc,.ini) nickcolor opaw 5
  }
  if (%acronc.vo.ac == $null) {
    .writeini -n $replace($script,.mrc,.ini) nickcolor voac 13
  }
  if (%acronc.vo.aw == $null) {
    .writeini -n $replace($script,.mrc,.ini) nickcolor voaw 6
  }
  if (%acronc.no.ac == $null) {
    .writeini -n $replace($script,.mrc,.ini) nickcolor noac 12
  }
  if (%acronc.no.aw == $null) {
    .writeini -n $replace($script,.mrc,.ini) nickcolor noaw 2
  }
  if (%acronc.me.ac == $null) {
    .writeini -n $replace($script,.mrc,.ini) nickcolor meac 9
  }
}

;--------example button -----
alias acronc.sample {
  .acronc.loadini
}

;---- acro example-----
on *:dialog:acronc:sclick:2224: {
  .acronc.loadini
  clear @Example
  if ($window(@Disp)) clear @Example
  else window -ado @Example $calc(($window(-1).w / 2) - 200) 120 400 50
  aline @Example $replace([b]e [r]ight [b]ack,[, $+ %acronc.acs $+ $iif(%acronc.acbld == 1,,) $+ $iif(%acronc.acul == 1,,),],$iif(%acronc.acul == 1,,) $+ $iif(%acronc.acbld == 1,,) $+  $+ %acronc.acl)
}

;---- NC example ------
on *:dialog:acronc:sclick:2225: {
  .acronc.loadini
  clear @Example
  if ($window(@Disp)) clear @Example
  else window -ado @Example $calc(($window(-1).w / 2) - 200) 125 400 160
  ;op
  aline @Example  $+ %acronc.nclfc $+ %acronc.nclft $+  $+ %acronc.op.ac $me $+  $+ %acronc.nclfc $+ %acronc.ncrgt $+  $+ %acronc.ncrgc $+ %acronc.ncrgmt $+  $+ $chr(32) $+ $chr(32) $+  is an active OP
  aline @Example  $+ %acronc.nclfc $+ %acronc.nclft $+  $+ %acronc.op.aw $me $+  $+ %acronc.nclfc $+ %acronc.ncrgt $+  $+ %acronc.ncrgc $+ %acronc.ncrgmt $+  $+ $chr(32) $+ $chr(32) $+  $+ %acronc.acl $+  is an away OP
  ;voice
  aline @Example  $+ %acronc.nclfc $+ %acronc.nclft $+  $+ %acronc.vo.ac $me $+  $+ %acronc.nclfc $+ %acronc.ncrgt $+  $+ %acronc.ncrgc $+ %acronc.ncrgmt $+  $+ $chr(32) $+ $chr(32) $+  is an active voice 
  aline @Example  $+ %acronc.nclfc $+ %acronc.nclft $+  $+ %acronc.vo.aw $me $+  $+ %acronc.nclfc $+ %acronc.ncrgt $+  $+ %acronc.ncrgc $+ %acronc.ncrgmt $+  $+ $chr(32) $+ $chr(32) $+  is an away voice 
  ;user
  aline @Example  $+ %acronc.nclfc $+ %acronc.nclft $+  $+ %acronc.no.ac $me $+  $+ %acronc.nclfc $+ %acronc.ncrgt $+  $+ %acronc.ncrgc $+ %acronc.ncrgmt $+  $+ $chr(32) $+ $chr(32) $+  is an active user
  aline @Example  $+ %acronc.nclfc $+ %acronc.nclft $+  $+ %acronc.no.aw $me $+  $+ %acronc.nclfc $+ %acronc.ncrgt $+  $+ %acronc.ncrgc $+ %acronc.ncrgmt $+  $+ $chr(32) $+ $chr(32) $+  is an away user 
  ;self
  aline @Example  $+ %acronc.nclfc $+ %acronc.nclft $+  $+ %acronc.me.ac $me $+  $+ %acronc.nclfc $+ %acronc.ncrgt $+  $+ %acronc.ncrgc $+ %acronc.ncrgmt $+  $+ $chr(32) $+ $chr(32) $+  $me $+ 's nick color 

}

;*** on/off utk acronym ***
alias acronc.ac.switch {
  .acronc.loadini
  if (%acronc.acison == $null || %acronc.acison == 0) {
    .writeini -n $replace($script,.mrc,.ini) general acison 1
  }
  else {
    .writeini -n $replace($script,.mrc,.ini) general acison 0
  }
}

;*** on/off utk nick completion ***
alias acronc.nc.switch {
  .acronc.loadini
  if (%acronc.ncison == $null || %acronc.ncison == 0) {
    .writeini -n $replace($script,.mrc,.ini) general ncison 1
  }
  else {
    .writeini -n $replace($script,.mrc,.ini) general ncison 0
  }
}

;*** on/off utk nicklist color ***
alias acronc.nlc.switch {
  .acronc.loadini
  if (%acronc.nlcison == $null || %acronc.nlcison == 0) {
    .writeini -n $replace($script,.mrc,.ini) general nlcison 1
  }
  else {
    .writeini -n $replace($script,.mrc,.ini) general nlcison 0
  }
}

on *:start: {
  .acronc.init
  .acronc.loadini
}

;*** loadini perlu kerana bila dialog diload ka ke-2 var. telah diubah ***

alias acronc {
  acronc.loadini
  if (%acronc.esm == 1) { halt }
  if ($dialog(acronc)) {
    echo -a 4.::Acro And Nc4::. is already running
    dialog -v acronc acronc
  }
  else { dialog -md acronc acronc }
}

dialog acronc {
  title "Acronym & Nick Completion version 1.0 [ /acronc ]"
  icon acrobmp\acro.ico
  size -1 -1 280 163
  option dbu 
  tab "Acro", 100, 3 1 273 145
  tab "Nick Completion", 200
  tab "Help", 300

  edit "", 3000, 72 25 130 110, read multi return autohs autovs vsbar, tab 300
  list 2000, 10 25 51 110, size, tab 300
  box "Topics", 1001, 5 17 62 125, tab 300

  text "Acronym && Nick Completion ", 113, 203 118 70 8, tab 300 disable center
  text "- By selampit && da-hype", 114, 205 125 70 8, tab 300 disable center
  icon 70, 254 100 32 32, $scriptdir $+ acrobmp\acro.ico , tab 300
  icon 68,191 1 57 75, $scriptdir $+ acrobmp\0.jpg , tab 300
  icon 69,227 1 57 75, $scriptdir $+ acrobmp\1.jpg , tab 300
  button "selampit"  8, 205 60 30 12, tab 300
  button "da-hype" 48, 241 60 30 12, tab 300

  button "&OK" 7, 247 149 30 12, OK 
  button "Acro On" 60, 177 149 30 12,
  button "NC On" 61, 212 149 30 12,
  button "NLC On" 62, 145 80 30 12, tab 200

  text "Select an acronym to Edit/Delete :" 55, 10 67 100 12, tab 100 
  box "Add/Edit/Delete acronyms" 56, 10 17 260 48, tab 100 
  button "&New" 4, 15 48 30 12, tab 100
  button "&Add" 6, 50 48 30 12, tab 100
  button "&Delete" 5, 85 48 30 12, tab 100 
  button "E&xample" 2224, 120 48 30 12, tab 100

  list 80, 10 75 195 73, tab 100 hsbar vsbar sort

  text "Acronym" 90, 15 25 30 10, tab 100
  edit "brb" 9, 15 33 45 12, autohs tab 100
  text "Becomes" 91, 60 25 30 10, tab 100
  edit "[b]e [r]ight [b]ack" 10, 60 33 205 12, autohs tab 100
  button " ! " , 115 , 255 48 10 12, tab 100
  box "Font Settings" 223, 210 67 60 75, tab 100
  box "Styles" 224, 215 75 50 30, tab 100
  box "Colors" 225, 215 108 50 30, tab 100
  icon 11, 215 110 20 20, $scriptdir $+ acrobmp\ $+ %acronc.acs $+ .bmp, tab 100
  icon 12, 215 120 20 20, $scriptdir $+ acrobmp\ $+ %acronc.acl $+ .bmp, tab 100
  text " inside [ ] " 134, 232 117 30 15, tab 100
  text " outside [ ] " 135, 232 127 30 15, tab 100
  check "under&line",13, 220 83 40 10, tab 100
  check "bold",131, 220 93 40 10, tab 100

  ;check "sort list",132, 175 65 30 10, tab 100
  ;check "strip leading space",133, 3 149 70 10

  box "Brackets", 222, 10 17 260 50, tab 200
  button "E&xample", 2225, 125 50 30 12, tab 200
  text "Left Bracket" 280, 18 25 50 20, tab 200
  edit "<" 15, 18 35 70 12, center, tab 200
  icon 14, 13 45 20 20, $scriptdir $+ acrobmp\ $+ %acronc.nclfc $+ .bmp, tab 200
  text "Bracket Color" 283, 30 52 50 10, tab 200

  text "Right Bracket" 281, 105 25 50 10, tab 200
  edit ">" 17, 105 35 70 12, center, tab 200

  box "Nick Notice" 399, 185 70 85 70, tab 200
  radio "" 400, 192 80 10 10, tab 200
  text "On" 401, 202 81 10 10, tab 200
  radio "" 402, 212 80 10 10, tab 200
  text "Off" 403, 222 81 10 10, tab 200
  button "Apply" 404, 235 80 30 10, tab 200
  text "Nick Notice, when turned on, will notify you when your nick is mentioned in an unactive channel or query. It will also say who mentioned your name." 406, 192 96 75 40, tab 200

  list 503, 285 15 80 135
  text "Doubleclick on an item to copy to edit box", 505, 285 148 60 15
  button "Close", 504, 350 149 20 12

  box "ASCII List" 500, 281 6 88 140

  text "Trigger" 282, 192 25 50 10, tab 200
  edit ":" 19, 192 35 70 12, center, tab 200
  icon 18, 188 45 20 20, $scriptdir $+ acrobmp\ $+ %acronc.ncrgc $+ .bmp, tab 200
  text "Trigger Color" 284, 205 52 50 10, tab 200
  box "Nick Colors" 148, 10 70 170 70, tab 200
  text "Group/Status" 149, 20 80 50 10, tab 200
  text "Active" 249, 70 80 30 10, tab 200
  text "Away" 349, 104 80 30 10, tab 200
  text "Operator" 145, 20 92 50 10, tab 200
  text "Voice"    245, 20 104 50 10, tab 200
  text "Normal"   345, 20 116 50 10, tab 200
  text "Yourself" 445, 20 128 50 10, tab 200
  icon 140,  68 85 20 20, $scriptdir $+ acrobmp\ $+ %acronc.op.ac $+ .bmp, tab 200
  icon 141, 100 85 20 20, $scriptdir $+ acrobmp\ $+ %acronc.op.aw $+ .bmp, tab 200
  icon 240,  68 98 20 20, $scriptdir $+ acrobmp\ $+ %acronc.vo.ac $+ .bmp, tab 200
  icon 241, 100 98 20 20, $scriptdir $+ acrobmp\ $+ %acronc.vo.aw $+ .bmp, tab 200
  icon 340, 68 110 20 20, $scriptdir $+ acrobmp\ $+ %acronc.no.ac $+ .bmp, tab 200
  icon 341,100 110 20 20, $scriptdir $+ acrobmp\ $+ %acronc.no.aw $+ .bmp, tab 200
  icon 16,  68 122 20 20, $scriptdir $+ acrobmp\ $+ %acronc.me.ac $+ .bmp, tab 200
  icon 440,100 122 20 20, $scriptdir $+ acrobmp\16.bmp, tab 200

  menu "&File", 101
  item "Exit", 206, 101, cancel

  menu "&Options", 204
  item "On/Off Acro", 118, 204
  item "On/Off Nc", 119, 204

  menu "&Help", 203
  item "Help Files",218, 203
  item "Online Help",205, 203
  item "About", 216, 203
  item break, 217, 203
  item "Report A Bug", 221, 203
}

alias -l _asciimake {
  var %a = 36
  while (%a < 256) { did -a acronc 503 %a $+ : $chr(%a) | inc %a }
}
on *:dialog:acronc:dclick:503: var %a = $did(acronc,503,$did(acronc,503).sel) | .did -a acronc 10 $gettok(%a,2,32)

on *:dialog:acronc:sclick:404:{
  if $did(acronc,400).state = 1 {
    .writeini -n $replace($script,.mrc,.ini) general mention 1
  }
  if $did(acronc,402).state = 1 {
    .writeini -n $replace($script,.mrc,.ini) general mention 0
  }
} 

on *:dialog:acronc:sclick:4:{
  .did -r acronc  9
  .did -r acronc 10
}

on *:dialog:acronc:sclick:5:{
  if ($readini($replace($script,.mrc,.ini),singkat,$did(9).text) == $null) { halt }
  .remini -n $replace($script,.mrc,.ini) singkat $did(9).text
  .did -r acronc  9
  .did -r acronc 10
  .did -r acronc 80
  .loadbuf -otsingkat acronc 80 $replace($script,.mrc,.ini)
  .did -z acronc 80 
}

on *:dialog:acronc:sclick:6:{
  if (($did(9).text == $null) || ($did(10).text == $null)) { halt }
  .writeini -n $replace($script,.mrc,.ini) singkat $did(9).text $did(10).text
  .did -r acronc 80
  .loadbuf -otsingkat acronc 80 $replace($script,.mrc,.ini)
  .did -z acronc 80 
}

on *:dialog:acronc:sclick:7:{
  .acronc.loadini
}

on *:dialog:acronc:sclick:60:{
  acronc.ac.switch
  acronc.loadini
  .did -ra acronc 60 $iif(%acronc.acison == 1,Acro On,Acro Off)
  if (%acronc.acison != 1) { .did -b acronc 4,6,5,2224,115,11,12,13,131,9,10,80 }
  else { .did -e acronc 4,6,5,2224,115,11,12,13,131,9,10,80 } 
}

on *:dialog:acronc:sclick:61:{
  acronc.nc.switch
  acronc.loadini
  .did -ra acronc 61 $iif(%acronc.ncison == 1,NC On,NC Off)
  if (%acronc.ncison != 1) { .did -b acronc 14,15,17,18,19,440,2225 }
  else { .did -e acronc 14,15,17,18,19,440,2225 } 
}

on *:dialog:acronc:sclick:62:{
  acronc.nlc.switch
  acronc.loadini
  .did -ra acronc 62 $iif(%acronc.nlcison == 1,NLC On,NLC Off)
  ;change nicklst to black!
  if ($status == connected) { nickcoloring.all }
  if (%acronc.nlcison != 1) { .did -b acronc 140,141,240,241,340,341,16 }
  else { .did -e acronc 140,141,240,241,340,341,16 } 
}
on *:dialog:acronc:close:*:{
  .acronc.loadini
}

on *:dialog:acronc:init:*:{
  _asciimake

  did -a acronc 2000 Acronyms
  did -a acronc 2000 $chr(43) $+ Add/Edit/Delete
  did -a acronc 2000 $chr(43) $+ Font Settings
  did -a acronc 2000
  did -a acronc 2000 Nick Completion
  did -a acronc 2000 $chr(43) $+ Brackets
  did -a acronc 2000 $chr(43) $+ Nick List Color
  did -a acronc 2000
  did -a acronc 2000 Help
  did -a acronc 2000 $chr(43) $+ Online Help
  did -a acronc 2000 About
  did -a acronc 2000 $chr(43) $+ Authors
  did -a acronc 2000
  did -a acronc 2000 Updates
  did -a acronc 2000 Malaysia

  acronc-readme

  .acronc.loadini
  .did $iif(%acronc.acul == 1,-c,-u) acronc 13
  .did $iif(%acronc.acbld == 1,-c,-u) acronc 131
  .did -ra acronc 15 %acronc.nclft
  .did -ra acronc 17 %acronc.ncrgt
  .did -ra acronc 19 %acronc.ncrgmt
  .did -ra acronc 60 $iif(%acronc.acison == 1,Acro On,Acro Off)
  .did -ra acronc 61 $iif(%acronc.ncison == 1,NC On,NC Off)
  .did -ra acronc 62 $iif(%acronc.nlcison == 1,NLC On,NLC Off)

  if (%acronc.acison != 1) { .did -b acronc 4,6,5,2224,115,11,12,13,131,9,10,80 }
  else { .did -e acronc 4,6,5,2224,115,11,12,13,131,9,10,80 } 

  if (%acronc.ncison != 1) { .did -b acronc 15,17,18,16,19,140,141,240,241,340,341,2225 }
  else { .did -e acronc 15,17,18,16,19,140,141,240,241,340,341,2225 } 

  if (%acronc.mention == 1) did -c acronc 400 | else did -c acronc 402
  ;**********listbox *************
  ; .did -rc acronc 132 $iif(%sort == on,sort)

  .loadbuf -otsingkat acronc 80 $replace($script,.mrc,.ini)
  .did -z acronc 80
}

;--tab tolong---
alias acronc-readme {
  did -r acronc 3000
  if ($exists($scriptdir $+ readme.txt) == $true) {
    loadbuf -o acronc 3000 $scriptdir $+ readme.txt
  }
  else {
    loadbuf -o acronc 3000 $scriptdir $+ acro-readme.txt
  }
}
alias acronc-acro {
  did -r acronc 3000
  loadbuf 1-30 -o acronc 3000 $scriptdir $+ acronc-help.txt
}
alias acronc-Settings {
  did -r acronc 3000
  loadbuf 31-53 -o acronc 3000 $scriptdir $+ acronc-help.txt
}
alias acronc-brackets {
  did -r acronc 3000
  loadbuf 54-72 -o acronc 3000 $scriptdir $+ acronc-help.txt
}
alias acronc-Color {
  did -r acronc 3000
  loadbuf 71-83 -o acronc 3000 $scriptdir $+ acronc-help.txt
}
alias acronc-readme {
  did -r acronc 3000
  loadbuf -o acronc 3000 $scriptdir $+ acronc-help.txt
}
alias acronc-updates {
  did -r acronc 3000
  loadbuf 85-96 -o acronc 3000 $scriptdir $+ acronc-help.txt
}
alias acronc-author {
  did -r acronc 3000
  loadbuf 96-118 -o acronc 3000 $scriptdir $+ acronc-help.txt
}
alias acronc-help {
  did -r acronc 3000
  loadbuf 117-129 -o acronc 3000 $scriptdir $+ acronc-help.txt
}
on *:dialog:acronc:sclick:2000:{
  if ($did(2000).sel == 2) { acronc-acro }
  if ($did(2000).sel == 3) { acronc-Settings }
  if ($did(2000).sel == 6) { acronc-brackets }
  if ($did(2000).sel == 7) { acronc-color }
  if ($did(2000).sel == 14) { acronc-updates }
  if ($did(2000).sel == 12) { acronc-author }
  if ($did(2000).sel == 9) { acronc-help }
  if ($did(2000).sel == 10) { url http://mp3zs.brinkster.net/scripthelp.html }
  if ($did(2000).sel == 11) { _about2 }
  if ($did(2000).sel == 15) { url http://mp3zs.brinkster.net/malaysia.html }
}

on *:dialog:acronc:edit:9:{
  if ($right($did(9).text,1) == $chr(32)) {
    .did -r acronc 9
    .did -ra acronc 10 sorry! space not allowed!
    .timerclear10 -o 1 1 { .did -r acronc 10 }
    halt
  }
  .did -ra acronc 10 $readini($replace($script,.mrc,.ini),singkat,$did(9).text))
}

on *:dialog:acronc:edit:15:{
  if ($did(15).text == $chr(32)) {
    .did -r acronc 15
    halt
  }
  if ($did(15).text == $null) { 
    .writeini -n $replace($script,.mrc,.ini) nickcom nclft none
    halt
  }
  .writeini -n $replace($script,.mrc,.ini) nickcom nclft $did(15).text
}

on *:dialog:acronc:edit:17:{
  if ($did(17).text == $chr(32)) {
    .did -r acronc 17
    halt
  }
  if ($did(17).text == $null) { 
    .writeini -n $replace($script,.mrc,.ini) nickcom ncrgt none
    halt
  }
  .writeini -n $replace($script,.mrc,.ini) nickcom ncrgt $did(17).text
}


on *:dialog:acronc:edit:19:{
  if ($did(19).text == $chr(32)) {
    .did -r acronc 19
    halt
  }
  if ($did(19).text == $null) { 
    .writeini -n $replace($script,.mrc,.ini) nickcom ncrgmt none
    halt
  }
  .writeini -n $replace($script,.mrc,.ini) nickcom ncrgmt $did(19).text
}

on *:dialog:acronc:sclick:8,68:{
  .run mailto:hsaleh@tm.net.my, saleh_hasan@hotmail.com
}

on *:dialog:acronc:sclick:70:{
  .run mailto:mp3zs@hotmail.com, hsaleh@tm.net.my, saleh_hasan@hotmail.com
}

on *:dialog:acronc:sclick:48,69:{
  .run mailto:mp3zs@hotmail.com
}

on *:dialog:acronc:sclick:11,12,14,16,18,140,141,240,241,340,341:{
  if ($dialog(acronc.cl) != $null) { dialog -x acronc.cl }
  set %acronc.did $did
  .acronc.cl
}

on *:dialog:acronc:sclick:13:{
  .writeini -n $replace($script,.mrc,.ini) acroset acul $did(13).state
}

on *:dialog:acronc:sclick:131:{
  .writeini -n $replace($script,.mrc,.ini) acroset acbld $did(131).state
}

on *:dialog:acronc:sclick:80:{
  .set %acronc.txts $did(acronc,80).seltext
  if ($numtok(%acronc.txts,61) <= 1) { halt }
  .did -ra acronc 9 $gettok(%acronc.txts,1,61)
  .did -ra acronc 10 $readini($replace($script,.mrc,.ini),singkat,$did(9).text))
}


alias acronc.cl dialog -mdo acronc.cl acronc.cl
dialog acronc.cl {
  title "Pick a color"
  icon acrobmp\acro.ico
  size -1 -1 166 46
  icon 1, 3 3 20 20, $scriptdir $+ acrobmp\0.bmp
  icon 2, 23 3 20 20, $scriptdir $+ acrobmp\1.bmp
  icon 3, 43 3 20 20, $scriptdir $+ acrobmp\2.bmp
  icon 4, 63 3 20 20, $scriptdir $+ acrobmp\3.bmp
  icon 5, 83 3 20 20, $scriptdir $+ acrobmp\4.bmp
  icon 6, 103 3 20 20, $scriptdir $+ acrobmp\5.bmp
  icon 7, 123 3 20 20, $scriptdir $+ acrobmp\6.bmp
  icon 8, 143 3 20 20, $scriptdir $+ acrobmp\7.bmp
  icon 9, 3 23 20 20, $scriptdir $+ acrobmp\8.bmp
  icon 10, 23 23 20 20, $scriptdir $+ acrobmp\9.bmp
  icon 11, 43 23 20 20, $scriptdir $+ acrobmp\10.bmp
  icon 12, 63 23 20 20, $scriptdir $+ acrobmp\11.bmp
  icon 13, 83 23 20 20, $scriptdir $+ acrobmp\12.bmp
  icon 14, 103 23 20 20, $scriptdir $+ acrobmp\13.bmp
  icon 15, 123 23 20 20, $scriptdir $+ acrobmp\14.bmp
  icon 16, 143 23 20 20, $scriptdir $+ acrobmp\15.bmp
  button "ok", 200, 10 10 10 10, ok hide
}

on *:dialog:acronc.cl:sclick:*: { 
  %acronc.num = $did - 1
  %acronc.pick = $scriptdir $+ acrobmp\ $+ %acronc.num $+ .bmp
  .did -g acronc %acronc.did %acronc.pick
  if (%acronc.did == 11) {
    .writeini -n $replace($script,.mrc,.ini) acroset acs %acronc.num
  }
  if (%acronc.did == 12) {
    .writeini -n $replace($script,.mrc,.ini) acroset acl %acronc.num
  }
  if (%acronc.did == 14) {
    .writeini -n $replace($script,.mrc,.ini) nickcom nclfc %acronc.num
  }
  if (%acronc.did == 16) {
    .writeini -n $replace($script,.mrc,.ini) nickcolor meac %acronc.num
  }
  if (%acronc.did == 18) {
    .writeini -n $replace($script,.mrc,.ini) nickcom ncrgc %acronc.num
  }
  if (%acronc.did == 140) {
    .writeini -n $replace($script,.mrc,.ini) nickcolor opac %acronc.num
  }
  if (%acronc.did == 141) {
    .writeini -n $replace($script,.mrc,.ini) nickcolor opaw %acronc.num
  }
  if (%acronc.did == 240) {
    .writeini -n $replace($script,.mrc,.ini) nickcolor voac %acronc.num
  }
  if (%acronc.did == 241) {
    .writeini -n $replace($script,.mrc,.ini) nickcolor voaw %acronc.num
  }
  if (%acronc.did == 340) {
    .writeini -n $replace($script,.mrc,.ini) nickcolor noac %acronc.num
  }
  if (%acronc.did == 341) {
    .writeini -n $replace($script,.mrc,.ini) nickcolor noaw %acronc.num
  }
  unset %acronc.did
  dialog -x acronc.cl
  .acronc.loadini
  if ($status == connected) { nickcoloring.all }
}

on *:input:*: {
  if ($left($1-,1) != $readini(mirc.ini,text,commandchar) || $1 == /me) {
    ;.acronc.loadini
    if (Status Window isin $active || $server == $null) { set %eo 1 }
    else { unset %eo }
    ;*** jika dimulai dengan huruf @ atau < atau ! ... perkataan tidak akan diproses ***
    ;if ($left($1-,1) == $chr(33) || $left($1-,1) == @) { $iif(%eo == 1,echo -a ,msg $active ) $1- | halt }
    if ($left($1-,1) isin @! || %acronc.esm == 1) { $iif(%eo == 1,echo -a ,msg $active ) $1- | halt }
    ;*** jika NC & Acro Off -> tamat ***
    if (%acronc.ncison == 0 && %acronc.acison == 0) {
      if ($1 != /me) { $iif(%eo == 1,echo -a ,msg $active ) $1- }
      else {
        /me $replace($1-,/me,) 
      }
      halt
      ;&&&&&&&&&&&&&&
      ;$iif(%eo == 1,echo -a ,msg $active ) $1- | halt
    }
    ;&&&&&&&&&&&&&&
    ;    if ($encode($file($script).size,m) != MTQyODU= || $exists($scriptdir $+ $decode(YWNyby5kbGw=,m)) == $false || $file($scriptdir $+ acrobmp\ $+ $decode(MC5qcGc=,m)).size != $decode(MTk4Mg==,m)) { $iif(%eo == 1,echo -a ,msg $active ) $1- | halt }
    ;*** jika NC off dan Acro on -> pergi ke bahagian Acro shj ***
    if (%acronc.ncison == 0 && %acronc.acison == 1) {
      set %input.text $1-
      goto next_acronc
    }
    ;*** mulakan NC ***
    unset %input.text
    set %input.count 0
    while (%input.count < $numtok($1-,32)) {
      inc %input.count
      unset %namalengkap

      ;@@@ CUBAAN MULA @@@ for next version only
      ;acronc.get.spchr $gettok($1-,%input.count,32) %input.count
      ;@@@ CUBAAN TAMAT @@@

      %cnt = 1
      :cari_lagi
      %panj = $calc($len($gettok($1-,%input.count,32))-1))

      if ($nick($chan,%cnt) == $null) { goto tamat }
      if ($right($gettok($1-,%input.count,32),1) == :) {
        if ($left($gettok($1-,%input.count,32),%panj) == $left($nick($chan,%cnt),%panj)) {
          unset %input.tanda
          if ($nick($chan,%cnt) isvoice $chan) {
            set %input.tanda +
          }
          if ($nick($chan,%cnt) isop $chan) {
            set %input.tanda @
          }
          ;%namalengkap = %namalengkap $+ $iif(%namalengkap != $null,$chr(130) $+ $chr(32)) $+  $+ %acronc.me.ac $+ %input.tanda $+ $nick($chan,%cnt)
          %namalengkap = %namalengkap $+ $chr(32) $+ %input.tanda $+ $nick($chan,%cnt)
        }
      }

      if (%namalengkap == $null) {
        if ($gettok($1-,%input.count,32) ison $chan) {
          %namalengkap = $gettok($1-,%input.count,32)
        }

        if ($gettok($1-,%input.count,32) isvoice $chan) {
          %namalengkap = + $+ $gettok($1-,%input.count,32)
        }

        if ($gettok($1-,%input.count,32) isop $chan) {
          %namalengkap = @ $+ $gettok($1-,%input.count,32)
        }
      }

      inc %cnt
      goto cari_lagi

      :tamat

      if ($left($gettok($1-,%input.count,32),%panj) == $left($active,%panj) && $right($gettok($1-,%input.count,32),1) == : && %namalengkap == $null || $gettok($1-,%input.count,32) == $active) {
        %namalengkap = $active
      }

      if ($left($gettok($1-,%input.count,32),%panj) == $left($me,%panj) && $right($gettok($1-,%input.count,32),1) == : && %namalengkap == $null || $gettok($1-,%input.count,32) == $me) {
        %namalengkap = $iif(($me isop $chan),@,$iif(($me isvoice $chan),+)) $+ $me
      }
      ;*** jika nick dijumpai ***
      if (%namalengkap != $null) {
        ;*** jika nick > 1 => buat pilihan ***
        if ($numtok(%namalengkap,32) > 1) {
          .set %acronc.tempnick.cnt 2
          .set %acronc.tempnick [1] $gettok(%namalengkap,1,32) $+ $crlf 
          :loop_tempnick
          .set %acronc.tempnick %acronc.tempnick $+ [[ $+ %acronc.tempnick.cnt $+ ]] $+ $chr(32) $+ $gettok(%namalengkap,%acronc.tempnick.cnt,32) $+ $crlf 
          inc %acronc.tempnick.cnt
          if (%acronc.tempnick.cnt <= $numtok(%namalengkap,32)) { goto loop_tempnick }
          :loop_regetnick
          ;*** sudah tamat senarai nick -> paparkan di sini ***
          .set %acronc.anicknum $input(%acronc.tempnick,1,Choose a nick by number for $+ $chr(32) $+ $gettok($1-,%input.count,32),1)
          if ($calc(%acronc.anicknum) <= 0 || $calc(%acronc.anicknum) > $numtok(%namalengkap,32)) { goto loop_regetnick }
          ;*** jika pilihan batal -> hentikan ***
          if (%acronc.anicknum == $null) { halt } 
        } 
        else {
          ;*** tandakan jika 1 nick jer yg dijumpai ***
          .set %acronc.anicknum 1
        }
        ;*** nick yg dipilih ***
        .set %namalengkap $gettok(%namalengkap,%acronc.anicknum,32)

        ;*** cari color nick yg berkaitan ***
        set %acronc.tmp.color $acronc.get.nick.color($chan,$replace(%namalengkap,@,,+,))

        ;*** set color nick ***
        .set %namalengkap  $+ %acronc.tmp.color $+ %namalengkap
      }

      ;*** masukan nick jika ditemui ***
      if (%namalengkap != $null) {
        %input.text = %input.text $+ $chr(32) $+ $iif(%input.count == 1, $+ %acronc.nclfc $+ %acronc.nclft,) $+ %namalengkap $+ $iif(%input.count == 1, $+ %acronc.nclfc $+ %acronc.ncrgt,) $+ $iif(%input.count == 1 && $numtok($1-,32) > 1, $+ %acronc.ncrgc $+ %acronc.ncrgmt,) $+ 
      }
      ;*** juka tidak sambung jer perkataan tu ha ***
      else {
        %input.text = %input.text $+ $chr(32) $+ $gettok($1-,%input.count,32)
      }

    }

    ;*** NC=on dan Acro=off => lakukan sampai sini jer ***
    if (%acronc.ncison == 1 && %acronc.acison == 0) {
      if ($1 != /me) { $iif(%eo == 1,echo -a ,msg $active ) %input.text }
      else {
        /me $replace(%input.text,/me,) 
      }
      halt
      ;&&&&&&&&&&&&&&&&&&&&&&
      ;$iif(%eo == 1,echo -a ,msg $active ) %input.text | halt
    }

    ;*** di sini mula nya Acro ***
    unset %input.text1
    :next_acronc 
    set %input.count 0
    while (%input.count < $numtok(%input.text,32)) {
      inc %input.count
      ;*** jika ada aksara " hindarkan readini ***
      if ($left($gettok(%input.text,%input.count,32),1) != ") {
        set %kata $readini($replace($script,.mrc,.ini),singkat,$gettok(%input.text,%input.count,32))       
      }
      else { unset %kata }

      ;*** jika acro dijumpai -> masukkan dlm ayat ***
      if (%kata != $null) {
        %input.text1 = %input.text1 $+ $chr(32) $+  $+ %acronc.acl $+ $replace(%kata,[, $+ %acronc.acs $+ $iif(%acronc.acbld == 1,,) $+ $iif(%acronc.acul == 1,,),],$iif(%acronc.acul == 1,,) $+ $iif(%acronc.acbld == 1,,) $+  $+ %acronc.acl) $+ 
      }
      ;*** jika acro tidak dijumpai -> sambung jer perkataan tu ***
      else {
        set %input.rep $gettok(%input.text,%input.count,32)
        %input.text1 = %input.text1 $+ $chr(32) $+ $iif(($right(%input.rep,2) == -2) && ($calc(%input.rep) == 0), $+ %acronc.acl $+ $replace(%input.rep,-2,-) $+ $replace(%input.rep,-2,) $+ ,%input.rep)
      }
    }

    ;*** display keputusan terakhir ***
    if ($1 != /me) { $iif(%eo == 1,echo -a ,msg $active ) %input.text1 }
    else {
      /me $replace(%input.text1,/me,) 
    }
    unset %input.tanda
    unset %input.count
    unset %input.text1
    unset %input.text
    unset %eo
    unset %kata
    halt
  }
  :end_acronc
}

; *** for next version only ***
alias acronc.get.spchr {
  echo -s $2 $+ : $+ $1
}
alias -l HyPe.about var %. @HyPe, %- HyPe.aline | window -aClk +ef %. 0 0 370 120 %. Fixedsys | %- $str(.,21) $+ HyPe Scripting.Crew..... | %- . | %- ..The.Official.HyPe.Homepage:...... | %- .....http://mp3zs!brinkster!net/script!html......... | %- .....Email:.mp3zs@hotmail!com....... | %- ............or .hsaleh@tm!net!my....... | %-. | %- ......(Double click window to close) | sline %. 12
alias -l HyPe.aline aline @HyPe $replace($1-,., ,!,.,-, ,¦,-)
menu @HyPe {
  dclick: window -c @HyPe | .timeracronc -o 1 1 { .acronc }
}

ctcp &*:VERSION:*: .ctcpreply $nick is using the 1A14cronym 1& N14ick 1C14ompletion 1B14y 10selampit 1and 2da-hype  | halt

alias _about2 dialog -md _about2 _about2
alias ascii2 dialog -m ascii ascii

dialog _about2 {
  title "Acronym & Nick Completion version 1.0"
  size -1 -1 1 1
  icon acrobmp\about.ico
  text "", 1, 50 20 150 15 
  icon 71, 10 8 32 32, $scriptdir $+ acrobmp\about.ico
  button "Copyright© 2002 selampit && da-hype All rights reserved", 2, 10 60 280 50, center
  text "Website:", 3, 10 134 50 15
  edit "http://mp3zs.brinkster.net", 4, 60 130 150 22, autohs read
  button "Visit!", 5, 220 130 50 22, center
  edit "", 6, 10 160 280 80, read multi return autohs autovs
  box "", 7, -10 40 320 210
  button "Close", 200, 120 260 60 30, ok
}

on *:dialog:_about2:init:*: {
  did -o _about2 6 1 Credits: | did -o _about2 6 2 This script was 100% Malaysian made! 
  did -o _about2 6 3  made by selampit and da-hype | did -o _about2 6 4  100% credit goes to US! haha
  did -o _about2 6 5  made by Malaysians for Malaysians | did -a _about2 1 Script By selampit and da-hype 
  %.anim._i = 0 | .timer_anim -m 0 1 _about2.anim
}

on *:dialog:_about2:sclick:2:.timer 1 0 echo -a 8,1 Using more than 100 lines from this script is considered stealing script whether modified or not. You can use any less than 100 lines of this script, but must give us credit. We do not allow anyone to translate this script to any language! 
on *:dialog:_about2:sclick:5:.url http://mp3zs.brinkster.net

alias _about2.anim {
  if (($dialog(_about2) == $null) || (%.anim._i > 150)) { .timer_anim off | unset %.anim.tmp* %.anim._i | return }
  :1 | %.anim.tmpx = $calc(($window(-1).w / 2) - %.anim._i) | %.anim.tmpy = $calc(($window(-1).h / 2) - %.anim._i) | %.anim.tmpw = $calc(%.anim._i * 2) | %.anim.tmph = $calc(%.anim._i * 2)
  dialog -s _about2 %.anim.tmpx %.anim.tmpy %.anim.tmpw %.anim.tmph | inc %.anim._i 5
}


on *:dialog:acronc:menu:*:{
  if ($did == 221) { 
    if ($dialog(_about2) == $null) { run mailto:mp3zs@hotmail.com, hsaleh@tm.net.my, saleh_hasan@hotmail.com?subject=HELP! Reporting an Acronc Bug }
    else { run mailto:hsaleh@tm.net.my }
  }
  if ($did == 216) { 
    if ($dialog(_about2) == $null) { dialog -md _about2 _about2 }
    else { dialog -v _about2 }
  }
  if ($did == 205) { 
    run http://mp3zs.brinkster.net/scripthelp.html
  }
  if ($did == 218) { 
    window -al -t30 @acronchelp
    loadbuf @acronchelp $scriptdir $+ acronc-help.txt
  }
  if ($did == 102) { 
    .acronc.ac.switch
    .acronc.loadini
    .did -ra acronc 60 $iif(%acronc.acison == 1,Acro On,Acro Off)
    if (%acronc.acison != 1) { .did -b acronc 4,6,5,2224,115,11,12,13,131,132,9,10,80 }
    else { .did -e acronc 4,6,5,2224,115,11,12,13,131,132,9,10,80 } 
    ;if (%acronc.acison != 1) { .did -b acronc 4,6,5,2224,115,11,12,13,131,9,10,80 }
    ;else { .did -e acronc 4,6,5,2224,115,11,12,13,131,9,10,80 } 
  }

  if ($did == 103) { 
    .acronc.nc.switch
    .acronc.loadini
    .did -ra acronc 61 $iif(%acronc.ncison == 1,NC On,NC Off)
    if (%acronc.ncison != 1) { .did -b acronc 15,17,18,16,19,140,141,240,241,340,341,2225 }
    else { .did -e acronc 15,17,18,16,19,140,141,240,241,340,341,2225 } 
  }

  if ($did == 109) { 
    .acronc.nlc.switch
    .acronc.loadini
    .did -ra acronc 62 $iif(%acronc.nlcison == 1,NLC On,NLC Off)
    ;change nicklst to black!
    if ($status == connected) { nickcoloring.all }
    ;if (%acronc.ncison != 1) { .did -b acronc 15,17,18,16,19,140,141,240,241,340,341,2225 }
    ;else { .did -e acronc 15,17,18,16,19,140,141,240,241,340,341,2225 } 
  }
}

on *:dialog:acronc:sclick:115:{ /dialog -srb acronc -1 -1  373 173 | .did -b acronc 115 }
on *:dialog:acronc:sclick:504:{ /dialog -srb acronc -1 -1 280 173 | .did -e acronc 115 }

On *:JOIN:#: {
  ;.acronc.loadini
  if (%acronc.esm == 1 || %acronc.nlcison == 0) { halt }
  if ($nick == $me) { 
    .timer $+ # -o 1 3 nickcoloring #
  }
  else {
    ;nickcoloring #
    cline -l $acronc.get.nick.color(#,$nick) # $nick
  }
}

On *:voice:#: { 
  ;.acronc.loadini
  if (%acronc.esm == 1 || %acronc.nlcison == 0) { halt }
  ;nickcoloring #
  cline -l $acronc.get.nick.color(#,$vnick) # $vnick

}

On *:devoice:#: {
  ;.acronc.loadini
  if (%acronc.esm == 1 || %acronc.nlcison == 0) { halt }
  ;nickcoloring #
  cline -l $acronc.get.nick.color(#,$vnick) # $vnick
}

On *:op:#: {
  ;.acronc.loadini
  if (%acronc.esm == 1 || %acronc.nlcison == 0) { halt }
  ;nickcoloring #
  cline -l $acronc.get.nick.color(#,$opnick) # $opnick
}

On *:deop:#: {
  ;.acronc.loadini
  if (%acronc.esm == 1 || %acronc.nlcison == 0) { halt }
  ;nickcoloring #
  cline -l $acronc.get.nick.color(#,$opnick) # $opnick
}

On *:nick: {
  ;.acronc.loadini
  if (%acronc.esm == 1 || %acronc.nlcison == 0) { halt }
  nickcoloring.all
}

alias nickcoloring {
  ;.acronc.loadini
  var %nnum = 1
  while (%nnum <= $nick($1,0)) {
    if (%acronc.esm == 1 || %acronc.nlcison == 0) { cline -l 1 $1 %nnum | goto cline_black }
    cline -l $acronc.get.nick.color($1,$nick($1,%nnum)) $1 %nnum
    :cline_black
    inc %nnum 1
  }
}

alias acronc.get.nick.color {
  set %acronc.away.txt.2 \a -x zz bz
  set %acronc.away.txt.3 zz] zz} [a] {a} [x] {x} afk brb off 0ff out bz] bz} bot dnd
  set %acronc.away.txt.4 afk] afk} brb] off] off} 0ff] 0ff} out] out} tido away mia] mia} keja awol busy keje turu bot] dnd] dead
  set %acronc.away.txt.5 tido] tido} away] away} keja] keja} awol] awol} busy] busy} keje] keje} tadak study tidur sleep padam turu] turu} dead]
  set %acronc.away.txt.6 tadak] tadak} study] study} tidur] tidur} sleep] sleep} padam] padam]
  set %acronc.away.txt.7 nothere offline
  set %acronc.away.txt.8 nothere] nothere} offline] offline}
  set %acronc.away.txt.9 
  set %acronc.isaway 0
  if ($right($2,2) isin %acronc.away.txt.2) { set %acronc.isaway 1 }
  if ($right($2,3) isin %acronc.away.txt.3) { set %acronc.isaway 1 }
  if ($right($2,4) isin %acronc.away.txt.4) { set %acronc.isaway 1 }
  if ($right($2,5) isin %acronc.away.txt.5) { set %acronc.isaway 1 }
  if ($right($2,6) isin %acronc.away.txt.6) { set %acronc.isaway 1 }
  if ($right($2,7) isin %acronc.away.txt.7) { set %acronc.isaway 1 }
  if ($right($2,8) isin %acronc.away.txt.8) { set %acronc.isaway 1 }
  if ($right($2,9) isin %acronc.away.txt.9) { set %acronc.isaway 1 }
  ;.acronc.loadini
  unset %acronc.tmp.color
  if ($2 isreg $1) {
    if (%acronc.isaway == 0) { set %acronc.tmp.color %acronc.no.ac }
    else { set %acronc.tmp.color %acronc.no.aw }
  }
  if ($2 isvoice $1) {
    if (%acronc.isaway == 0) { set %acronc.tmp.color %acronc.vo.ac }
    else { set %acronc.tmp.color %acronc.vo.aw }
  }
  if ($2 isop $1) {
    if (%acronc.isaway == 0) { set %acronc.tmp.color %acronc.op.ac }
    else { set %acronc.tmp.color %acronc.op.aw }
  }
  if ($1 == $null) { set %acronc.tmp.color %acronc.no.ac }
  if ($2 == $me) { set %acronc.tmp.color %acronc.me.ac }
  return %acronc.tmp.color
}

alias nickcoloring.all {
  set %j 1
  :cari_nc_all
  if ($chan(%j) == $null) goto tamat_nc_all
  nickcoloring $chan(%j)
  inc %j
  goto cari_nc_all
  :tamat_nc_all
}

;*** TESTING for next version ***
alias acronc.init.away.test {
  set %acronc.away.txt \a -x zz zz] zz} [a] {a} [x] {x} $&
    afk afk] afk} brb brb] off off] off} 0ff 0ff] 0ff} $&
    out out] out} tido tido] tido} away away] away} $&
    mia] mia} keja keja] keja} awol awol] awol} $&
    busy busy] busy} keje keje] keje} tadak tadak] tadak} $&
    study study] study} nothere nothere] nothere} $&
    offline offline] offline}
  var %ntok = 1
  echo -s $str(=,88)
  while (%ntok <= $numtok(%acronc.away.txt,32)) {
    echo -s n: %ntok
    var %tok.away = $gettok(%acronc.away.txt,%ntok,32)
    echo -s tokken: $tok.away
    var %tok.len = $len($gettok(%acronc.away.txt,%ntok,32))
    echo -s len: %tok.len 
    set %acronc.away.txt. $+ %tok.len $tok.away
    echo -s newtok: %acronc.away.txt. $+ %tok.len $tok.away
    inc %ntok
    echo -s $str(-,88)
  }
}  

menu * {
  -
  Acro && NC 
  .Settings:acronc
  .-
  . $+ $iif($readini($replace($script,.mrc,.ini),general,ncison) == 1,Nick Completion is ON => Switch OFF,Nick Completion is OFF => Switch ON) $+ : .acronc.nc.switch
  . $+ $iif($readini($replace($script,.mrc,.ini),general,acison) == 1,Acronym is ON => Switch OFF,Acronym is OFF => Switch ON) $+ : .acronc.ac.switch
  .-
  .Unload Script
  ..Are You Sure You Want To Unload This Script?:unload -rs $script
  -
}
