mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2012
Posts: 48
Ameglian cow
OP Offline
Ameglian cow
Joined: Apr 2012
Posts: 48
I have no idea how to do it... in my alias command text typed in the "EDIT" control must return him if the "CHARSET" or "FONTNAME" exists.
I can solve with an identifier?

This is the text that is to be compared with the type font name of the typed character present in your system.

Code:
$xdid($1,2).text


edit controls
Code:
alias xchar_tree {
  if ($xdialog(treebardialog, 1).isid == $true) /xdialog -d treebardialog  1
  if ($xdialog(treebardialog, 1).isid != $true) {
    xdialog -c treebardialog 1 edit 2 40 300 40 autohs autovs showsel tabstop default group tooltips return 
    xdid -f treebardialog 1 %textmode %xchartree %xdimtree %xcartree
    if (%lang == en) { xdid -T treebardialog 1 Can be any of the following: ansi, baltic, chinesebig, default, easteurope, gb2312, greek, hangul, mac, oem, russian, shiftjis, symbol, turkish, vietnamese. - Press ENTER to apply the changes  }  
    if (%lang == it) { xdid -T treebardialog 1 Può essere uno dei seguenti: ansi, baltico, chinesebig, default, EASTEUROPE, GB2312, greco, hangul, mac, oem, russo, ShiftJIS, simbolo, turco, vietnamita. - Premi ENTER per applicare le modifiche }
    if (%lang == es) { xdid -T treebardialog 1 Puede ser cualquiera de los siguientes: ansi, báltico, chinesebig, por defecto, easteurope, gb2312, griego, hangul, mac, OEM, ruso, ShiftJIS, símbolo, turco, vietnamita. - Pulse ENTER para aplicar los cambios }
    if (%lang == fr) { xdid -T treebardialog 1 Peut être une des caractéristiques suivantes: ansi, Baltique, chinesebig, par défaut, easteurope, gb2312, grec, hangul, mac, oem, russe, ShiftJis, symbole, turc, vietnamien. - Sur ENTER pour appliquer les modifications }
    xdid -C treebardialog 1 +b $dcx(GetSystemColor, COLOR_WINDOW)
    xdid -C treebardialog 1 +k $dcx(GetSystemColor, COLOR_HIGHLIGHT)
    xdid -C treebardialog 1 +t $dcx(GetSystemColor, COLOR_WINDOWTEXT)
    xdid -C treebardialog 1 +g $dcx(GetSystemColor, COLOR_WINDOW)
    xdid -C treebardialog 1 +G $dcx(GetSystemColor, COLOR_WINDOW)
    /xdid -E treebardialog 1 %xchartree
    if (%cur_x == ON) /xdid -J treebardialog 1 +f %cursore
    /xdid -y treebardialog 1 1
  }
}


alias charset_tree {
  if ($xdialog(treebardialog, 2).isid == $true) /xdialog -d treebardialog  2
  if ($xdialog(treebardialog, 2).isid != $true) {
    xdialog -c treebardialog 2 edit 2 80 300 40 autohs autovs showsel tabstop default group tooltips return  
    xdid -f treebardialog 2 %textmode %xchartree %xdimtree %xcartree
    if (%lang == en) { xdid -T treebardialog 2 Sets the type of character. Some examples Arial, Sans MS Comics, Thaoma, Verdana, Calibri - Press ENTER to apply the changes  } 
    if (%lang == it) { xdid -T treebardialog 2 Imposta il Tipo di Carattere. Qualche esempio Arial, Sans MS Comics, Thaoma, Verdana, Calibri - Premi ENTER per applicare le modifiche }
    if (%lang == es) { xdid -T treebardialog 2 Establece el tipo de carácter. Algunos ejemplos  Arial, Sans MS Comics, Thaoma, Verdana, Calibri - Pulse ENTER para aplicar los cambios }
    if (%lang == fr) { xdid -T treebardialog 2 Définit le type de caractère. Quelques exemples  Arial, Sans MS Comics, Thaoma, Verdana, Calibri - Sur ENTER pour appliquer les modifications }
    xdid -C treebardialog 2 +b $dcx(GetSystemColor, COLOR_WINDOW)
    xdid -C treebardialog 2 +k $dcx(GetSystemColor, COLOR_HIGHLIGHT)
    xdid -C treebardialog 2 +t $dcx(GetSystemColor, COLOR_WINDOWTEXT)
    xdid -C treebardialog 2 +g $dcx(GetSystemColor, COLOR_WINDOW)
    xdid -C treebardialog 2 +G $dcx(GetSystemColor, COLOR_WINDOW)
    /xdid -E treebardialog 2 %xcartree
    if (%cur_x == ON) /xdid -J treebardialog 2 +f %cursore
    /xdid -y treebardialog 2 1
  }
}

alias size_font_tree {
  if ($xdialog(treebardialog, 3).isid == $true) /xdialog -d treebardialog  3
  if ($xdialog(treebardialog, 3).isid != $true) {
    xdialog -c treebardialog 3 edit 2 120 300 40 autohs autovs showsel tabstop default group tooltips number return  
    xdid -f treebardialog 3 %textmode %xchartree %xdimtree %xcartree
    if (%lang == en) { xdid -T treebardialog 3 Sets the size of Character. Press ENTER to apply the changes  } 
    if (%lang == it) { xdid -T treebardialog 3 Imposta la dimensione del carattere. Premi ENTER per applicare le modifiche }
    if (%lang == es) { xdid -T treebardialog 3 Establece el tamaño del personaje. Pulse ENTER para aplicar los cambios }
    if (%lang == fr) { xdid -T treebardialog 3 Définit la taille des caractères. Sur ENTER pour appliquer les modifications }
    xdid -C treebardialog 3 +b $dcx(GetSystemColor, COLOR_WINDOW)
    xdid -C treebardialog 3 +k $dcx(GetSystemColor, COLOR_HIGHLIGHT)
    xdid -C treebardialog 3 +t $dcx(GetSystemColor, COLOR_WINDOWTEXT)
    xdid -C treebardialog 3 +g $dcx(GetSystemColor, COLOR_WINDOW)
    xdid -C treebardialog 3 +G $dcx(GetSystemColor, COLOR_WINDOW)
    /xdid -E treebardialog 3 %xdimtree
    if (%cur_x == ON) /xdid -J treebardialog 3 +f %cursore
    /xdid -y treebardialog 3 1
    /xdid -q treebardialog 3 2
  }
}


alias FontName & Charset
Code:
alias treebardialog_cb {
  if ($2 == keydown) {
    if ($3 == 1) { /set %xchartree $xdid($1,1).text | ref_text }
    elseif ($3 == 2) { /set %xcartree $xdid($1,2).text | ref_text }
    elseif ($3 == 3) { if ($xdid(treebardialog, 3).caretpos == 1 2) /set %xdimtree $xdid($1,3).text | ref_text }
  }
  if ($2 == sclick) {
    elseif ($3 == 1) { xdid -r treebardialog 1 }
    elseif ($3 == 2) { xdid -r treebardialog 2 }
    elseif ($3 == 3) { xdid -r treebardialog 3 }
 }
}


events
Code:
/cb_treebardialog treebardialog return 1
/cb_treebardialog treebardialog return 2
/cb_treebardialog treebardialog return 3
/cb_treebardialog treebardialog edit 1
/cb_treebardialog treebardialog edit 2
/cb_treebardialog treebardialog edit 3
/cb_treebardialog treebardialog keydown 1 13
/cb_treebardialog treebardialog keydown 2 13
/cb_treebardialog treebardialog keydown 3 13
/cb_treebardialog treebardialog copy 1 
/cb_treebardialog treebardialog copy 2 
/cb_treebardialog treebardialog copy 3 
/cb_treebardialog treebardialog cut 1 
/cb_treebardialog treebardialog cut 2 
/cb_treebardialog treebardialog cut 3 


Last edited by DEATHJ0KER; 23/03/15 03:45 PM. Reason: Additional information is missing

A Creative & Interactive mIRC Scripting
Joined: Apr 2012
Posts: 48
Ameglian cow
OP Offline
Ameglian cow
Joined: Apr 2012
Posts: 48
I solved in another way. When you type the wrong character won't get no change text style and when it is corrected automatically make the change.
In essence it is not necessary to compare the font installed in your system because it is not returned error.

Code:
  if ($2 == keyup) {
    if ($3 == 3) { /set %xchartree $xdid($1,3).text | .timer 1 0 ref_text }
    elseif ($3 == 4) { /set %xcartree $xdid($1,4).text | .timer 1 0 ref_text }
  }
  if ($2 == keydown) {
    if ($3 == 3) { if ($xdialog(treebardialog).key & 13) /set %xchartree $xdid($1,3).text | .timer 1 0 ref_text }
    elseif ($3 == 4) { if ($xdialog(treebardialog).key & 13) /set %xcartree $xdid($1,4).text | .timer 1 0 ref_text }
    elseif ($3 == 5) { if ($xdid(treebardialog, 5).caretpos == 1 2) /set %xdimtree $xdid($1,5).text | .timer 1 0 ref_text }
  }

Last edited by DEATHJ0KER; 13/04/15 02:17 PM. Reason: my english syntax errors

A Creative & Interactive mIRC Scripting
Joined: Apr 2012
Posts: 48
Ameglian cow
OP Offline
Ameglian cow
Joined: Apr 2012
Posts: 48


A Creative & Interactive mIRC Scripting

Link Copied to Clipboard