At your request, I improved my script to make it convenient for you. I borrowed the idea for the color palette from Talon, for which I want to thank him.

The dialog box will open as soon as you press the "F9" button. (You can change this to a more convenient button in the alias name).
Now the script can count the number of typed characters, a pop-up palette to select the color of the message, additional options for working with the dialog box after the text has been sent, the choice of the type of message to be sent and the "Send message" button. And now the focus is automatically set to the "Send message" button by default so that you can press the "Enter" key.
Please check that everything works in the code, and if you have any questions, write to me here.

     [Linked Image from i.ibb.co]

This code must be inserted into the script editor. To do this, press the key combination "ALT+R" and replace the old code with this code:

Code
#####################################################################
#   Name: MeMessage v1.1
#   Description: Dialog box for managing and sending "/ME" messages.
#   Author: Epic
#   Email: epicnet@mail.ru
#   Site: http://epicnet.ru
#####################################################################

alias F9 {
  if (!$dialog(me)) {
    unset %me_chars | me_set | .dialog -mp me me | .dialog -r me
    if (%me_color) .did -a me 4 %me_tcolors $+($chr(40),%me_color,$chr(41))
    me_select me 6 | if (%me_select) .did -c me 6 %me_select | else .did -c me 6 1
    if (%meo_check2) { .did -a me 1 %me_mess | me_calclines me 1 }
  } | else .dialog -x me
}
dialog -l me {
  title %me_title
  size -1 -1 300 235
  option pixels
  edit "", 1, 10 10 280 130, multi autovs, limit 900
  text %me_tchars, 2, 30 155 35 20, nowrap
  edit "0", 3, 71 152 30 21, read rich right, limit 4
  button %me_tcolors, 4, 115 151 120 22
  button %me_tbutton_set, 5, 248 151 22 22
  combo 6, 30 191 70 20, drop
  button %me_tbutton_ok, 10, 115 190 155 23, default
}
on *:DIALOG:me:close:0: me_winclose
on *:DIALOG:me:edit:1: me_calclines $dname $did | me_winclose
on *:DIALOG:me:sclick:4: me_colors $dname | if (!$window(@MeColors)) .did -f me 1
on *:DIALOG:me:sclick:5: me_options $dname
on *:DIALOG:me:sclick:6: %me_select = $did($dname,$did).sel
on *:DIALOG:me:sclick:10:{
  me_winclose | unset %me_mess | var %q 1 | while (%q <= $did($dname,1).lines) { %me_mess = %me_mess $did($dname,1,%q).text | inc %q }
  if (%me_color) { var %me_col $+($chr(3),%me_color) }
  var %me_message $did($dname,6,0).text $+(%me_col,%me_mess)
  if (%me_chars > 0) {
    if (!%meo_check3) .editbox -afn %me_message
    if (%meo_check3) .editbox -af %me_message
    if (!%meo_check2) { .did -r $dname 1 | unset %me_chars | .did -i $dname 3 1 0 }
    if (%meo_check1) .dialog -x $dname
  }
  else { .echo -a %me_terror_notext | .did -f me 1 }
}
============================================================
alias -l me_set {
  %me_title = MeMessage
  %me_tchars = Chars:
  %me_tcolors = Colors:
  %me_tbutton_set = ⧉
  %me_tbutton_ok = Send message ➤
  %me_tselect = /me /ame /qme
  %me_terror_notext = :: Please write your text ➤
}
alias -l me_winclose { if ($window(@MeColors)) .window -c @MeColors | if ($dialog(me_options)) .dialog -x me_options }
alias -l me_calclines { unset %me_chars | var %q 1 | while (%q <= $did($1,$2).lines) { %me_chars = $calc(%me_chars + $did($1,$2,%q).len) | inc %q } | .did -o $1 3 1 %me_chars }
alias -l me_select { var %me_q 1 | while (%me_q <= $numtok(%me_tselect,32)) { .did -a $1 $2 $gettok(%me_tselect,%me_q,32) | inc %me_q } }
alias -l me_colors {
  if (!$window(@MeColors)) {
    .window -padhik0 +beL @MeColors $calc($dialog($1).x +45) $calc($dialog($1).y +90) 215 63 | .window -a @MeColors
    .drawrect -f @MeColors 14 1 0 0 250 80
    var %me_x 6 | var %me_y 6 | var %me_q 0 | while (%me_q <= 15) {
      .drawrect -f @MeColors %me_q 1 %me_x %me_y 22 22
      .drawrect @MeColors 15 1 %me_x %me_y 22 22
      .hadd -m mecoordcol-x %me_q $+(%me_x,-,$calc(%me_x +22))
      .hadd -m mecoordcol-y %me_q $+(%me_y,-,$calc(%me_y +22))
      inc %me_q | inc %me_x 25 | if (%me_q == 8) { var %me_x 6 | inc %me_y 25 }
    }
  }
  else .window -c @MeColors
}
menu @MeColors {
  sclick {
    var %me_mx $mouse.x | var %me_my $mouse.y
    var %me_q 0 | while (%me_q <= 15) {
      var %me_hx $hget(mecoordcol-x,%me_q) | var %me_hy $hget(mecoordcol-y,%me_q)
      if (%me_mx isnum %me_hx && %me_my isnum %me_hy) { if (%me_q < 10) var %me_q $+(0,%me_q) | .did -a me 4 %me_tcolors $+($chr(40),%me_q,$chr(41)) | %me_color = %me_q | .break }
      inc %me_q
    }
    .window -c @MeColors | if ($dialog(me)) .did -f me 1
  }
}
============================================================
alias -l me_options {
  if (!$dialog(me_options)) {
    me_options_set | .dialog -mp me_options me_options
    if (%meo_check1) .did -c me_options 1
    if (%meo_check2) .did -c me_options 2
    if (%meo_check3) .did -c me_options 3
  }
  else .dialog -x me_options
}
dialog -l me_options {
  title "MeOptions"
  size -1 -1 270 100
  option pixels
  check %meo_t1, 1, 15 20 250 20
  check %meo_t2, 2, 15 40 250 20
  check %meo_t3, 3, 15 60 250 20
}
alias -l me_options_set {
  %meo_t1 = Close the window after click on "Send"
  %meo_t2 = Save typed message after click on "Send"
  %meo_t3 = Move message to EditBox after click on "Send"
}
on *:DIALOG:me_options:close:0: if ($dialog(me)) .did -f me 1
on *:DIALOG:me_options:sclick:1: if ($did($dname,$did).state == 1) %meo_check1 = 1 | else unset %meo_check1
on *:DIALOG:me_options:sclick:2: if ($did($dname,$did).state == 1) %meo_check2 = 1 | else unset %meo_check2
on *:DIALOG:me_options:sclick:3: if ($did($dname,$did).state == 1) %meo_check3 = 1 | else unset %meo_check3
============================================================


Last edited by Epic; 12/11/20 08:53 AM.

🌐 http://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples