ID:1141630
 
(See the best response by Tom.)
Code:
client/script = {"

// Various css settings

macro
space return "Interact"
Return return "Say"
R return "Interact"

"}


Problem description:
I've searched and searched the forums now, but the most relevant posts to my issue seem to be from 2004, and no longer applicable.

In my macros, I've got some code to run a macro with an alphabet key, as you can see. The space and enter key macros work but the alpha key simply adds to the input text box. I tried setting the command_text of the client to ".alt " but this had no effect. I tried removing the input box entirely, and it still had no effect.

So... how do I get my R key macro to activate when I press R? I'm hoping I don't have to use the interface-based macro options, because then it's tied to the interface rather than my code, and that makes me sad.
Setting up macros via the .dms format is deprecated and handled much better by the new interface system. You can set up macros implicitly using winset() instead of having to create or modify a .dmf file.
Perpetr8r the Perpetu8r wrote:
I'm hoping I don't have to use the interface-based macro options, because then it's tied to the interface rather than my code, and that makes me sad.

Oh, come now.. surely having a nice simple GUI to set up macros is better than a bunch of whacky winsets...

BTW your name is awesome

In response to LordAndrew
LordAndrew wrote:
Setting up macros via the .dms format is deprecated and handled much better by the new interface system. You can set up macros implicitly using winset() instead of having to create or modify a .dmf file.

Ah, thanks. Do you perhaps have an example of that? I can't seem to find any and this would probably help others in the future too.
Best response
You can put this code in somewhere at client or mob login:
winset(usr,"input","command=\"!.alt \"")

The "!" says to put the command ".alt " (note the space) onto the input control, which activate the "ALT" button so you can run your commands directly. Pre-4.0 I believe we had a macro-mode var (or something like that) which did the same thing.

I must say that this is very cludgy and mixing text input and non-ctrl/alt macros is pretty unintuitive. I think the cleaner approach would be to make a simple custom interface that didn't have a command-line, and just use a macro (like S) to pull it up.