Enable and disable keypad keys with a macro

Posted by Caelen on Mon 09 Aug 2010 09:11 AM — 6 posts, 28,736 views.

#0
Is there any built-in keyboard shortcut for enabling and disabling keypad key macros? If not, is there a script command that can be used to do so?
#1
You need to use Accelerator or AcceleratorTo to redefine or unset most macros.
#2
Larkin said:

You need to use Accelerator or AcceleratorTo to redefine or unset most macros.


And those are...?

The specific macros I'm asking about are the keypad keys (the options reached from ctrl+shift+1), since they have a built in checkbox to enable and disable them. I want to be able to toggle that option with an alias or a built-in keyboard shortcut.
Australia Forum Administrator #3

<aliases>
  <alias
   match="disable_keypad"
   enabled="y"
   expand_variables="y"
   send_to="12"
   sequence="100"
  >
  <send>

SetOption ("keypad_enable", 0)
ColourNote ("cyan", "", "Numeric keypad disabled.")

</send>
  </alias>

  <alias
   match="enable_keypad"
   enabled="y"
   expand_variables="y"
   send_to="12"
   sequence="100"
  >
  <send>

SetOption ("keypad_enable", 1)
ColourNote ("cyan", "", "Numeric keypad enabled.")

</send>
  </alias>
</aliases>


Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.


#4
Shiny! Thanks. SetOption ("keypad_enable", #) is exactly what I needed. Question though. What's the difference between "print" and "ColourNote"?

EDIT:

I shortened it up a bit, making one alias to turn it on or off so I could assign it to a macro.

<aliases>
  <alias
   match="togglekeypad"
   enabled="y"
   expand_variables="y"
   send_to="12"
   sequence="100"
  >
  <send>if (GetOption("keypad_enable")) == 1 then
 print "NUMERIC KEYPAD DISABLED"
 SetOption ("keypad_enable", "0")
else
 print "NUMERIC KEYPAD ENABLED"
 SetOption ("keypad_enable", "1")
end</send>
  </alias>
</aliases>


And... the code brackets don't seem to be working?
Amended on Tue 10 Aug 2010 12:41 AM by Nick Gammon
Australia Forum Administrator #5
Caelen said:

Shiny! Thanks. SetOption ("keypad_enable", #) is exactly what I needed. Question though. What's the difference between "print" and "ColourNote"?


The print function prints in the world "note" colour as defined in the scripting configuration. ColourNote lets you specify any foreground and background colour you want.

Caelen said:

And... the code brackets don't seem to be working?


It only auto-detects the [code] tag on an initial post. If you edit later and add tags you have to manually check "Forum codes" on the posting.