#####################################################################
# Name: MeMessage v1.0
# 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_mess | .dialog -mp me me | .dialog -r me
me_colors me 5 | if (%me_colors) .did -c me 5 %me_colors
me_select me 6 | if (%me_select) .did -c me 6 %me_select | else .did -c me 6 1
}
else .dialog -x me
}
dialog me {
title "MeMessage"
size -1 -1 300 235
option pixels
edit "", 1, 10 10 280 130, multi autovs, limit 900
text "Chars:", 2, 40 155 30 20, nowrap
edit "0", 3, 77 152 30 21, read rich right, limit 4
text "Colors:", 4, 135 155 40 20, nowrap
combo 5, 175 151 83 20, drop
combo 6, 40 191 65 20, drop
button "Send message ➤", 10, 115 190 145 23
}
on *:DIALOG:me:edit:1: unset %me_chars | var %q 1 | while (%q <= $did($dname,$did).lines) { %me_chars = $calc(%me_chars + $did($dname,$did,%q).len) | inc %q } | .did -o $dname 3 1 %me_chars
on *:DIALOG:me:sclick:5: %me_colors = $did($dname,$did).sel
on *:DIALOG:me:sclick:6: %me_select = $did($dname,$did).sel
alias -l me_colors { .did -a $1 $2 white [00] | .did -a $1 $2 black [01] | .did -a $1 $2 d.blue [02] | .did -a $1 $2 green [03] | .did -a $1 $2 red [04] | .did -a $1 $2 brown [05] | .did -a $1 $2 purple [06] | .did -a $1 $2 orange [07] | .did -a $1 $2 yellow [08] | .did -a $1 $2 l.green [09] | .did -a $1 $2 sea [10] | .did -a $1 $2 n.blue [11] | .did -a $1 $2 blue [12] | .did -a $1 $2 pink [13] | .did -a $1 $2 gray [14] | .did -a $1 $2 l.gray [15] }
alias -l me_select { .did -a $1 $2 /me | .did -a $1 $2 /ame | .did -a $1 $2 /qme }
on *:DIALOG:me:sclick:10:{
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_colors) { var %me_col $calc(%me_colors -1) | if ($len(%me_col) == 1) var %me_col $+($chr(3),0,%me_col) | else var %me_col $+($chr(3),%me_col) }
if (%me_chars > 0) .editbox -an $did($dname,6,0).text $+(%me_col,%me_mess)
else .echo -a :: Please enter your text ➤
}