[MudWalker] Macros and Variables

Kevin Reid kpreid
Mon Nov 21 02:05:25 PST 2005


On Nov 14, 2005, at 14:22, Cicero wrote:

> I understand that currently keyboard macros do not support any sort  
> of scripting, only simple commands. I am wondering if there is any  
> sort of work-around possible for what I am trying to do, however:
> ...
> Would it be possible to do this in any other way? For instance,  
> would it be possible somehow to define a client-alias that  
> redefines the command a keyboard macro sends to the MUD?
> ...
> This is the only thing I need Mudwalker to do that it currently  
> does not seem to support; if no work-arounds are possible, are  
> there any coders out there that could fix me up with a patch that  
> could do this?

As far as I know, there are no workarounds - there is nothing to edit  
the config from a script, and a keyboard macro goes directly past the  
trigger and alias processing.

Given the number of times this has been asked for, I think "scripting  
for key macros" is pretty much the next thing on my todo list (ha).

For any programmers who are listening, the relevant code is in  
MWTriggerFilter.m:

   - (void)processUserEvent:(NSEvent *)event {
     NSString *code = MWEventToStringCode(event);
     NSString *send = [[self config] objectAtPath:[MWConfigPath  
pathWithComponents:@"KeyCommands", code, @"command", nil]];

     if (send) {
       [self send:[MWLineString lineStringWithString:send role:nil]  
toLinkFor:@"outward"];
       [self send:[MWLineString lineStringWithString:send  
role:MWEchoRole] toLinkFor:@"inward"];
     } else {
       NSBeep();
     }
   }

What I think should be done is one of:
   * Make key macros have scripts instead of a simple string.
   * Match the command string against aliases, which currently do run  
scripts.

I'm not sure which would be better.

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>




More information about the MudWalker mailing list