Kirby commented on a Page, My First Dialog: mIRC On-Screen Keyboard  -  Mar 09, 2009

This is very neat, ReFuSeR!
Impressive for your first dialog.

However, you can change some things to make the script work faster and more effectively.

  if ($did == 37) {
    if (%capslock == 0) {
      did -a $dname 1 q
    if (%capslock == 1) {
      did -a $dname 1 Q

In this case, luckily, you're preforming two similar commands, /did -a $dname 1, only to change the two values, q or Q.
I would be a little reluctant when using variables in scripts, but it isn't quite necessary. Because $did(37) is a flat button you can use the prefix of .state after the $did(37) and an $iif to really make that part and similar parts shorter.
So the code block in your script can be rewritten as:

if ($did == 37) { did -a $dname 1 $iif($did($v2).state == 1,Q,q) }
  • a mere one line. If $did(37).state is equal to 1, meaning that it is clicked flat, then return this action (Q), if not, return (q). Also, because it is impossible to click on different parts of the dialog at the same time, you don't need all those 'halts'
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.