I am on a MOO, and want to program expressions for my character to make. This works with pose. For example I can type "pose wave name says, "Hello" ". The MOO will turn it into: "You wave at name and say, "Hi". That's pretty cool but it is a lot to type. I'm trying to automate the feature. So basically I need something like this:
pose wave $1 says, "$2" (where $1 is the target name, and $2 is what I want to say.
Multiple variable input alias
Re: Multiple variable input alias
I solved the problem, first you need the right pattern:
^waveme (.*) (.*)$
Then you need the right script:
send("pose wave to " .. matches[2] .. " with a devilish grin and say \"" .. matches[3] .. "\"")
Then I just type: waveme name message
I love this client. Do you think you will ever get it running on a phone?
^waveme (.*) (.*)$
Then you need the right script:
send("pose wave to " .. matches[2] .. " with a devilish grin and say \"" .. matches[3] .. "\"")
Then I just type: waveme name message
I love this client. Do you think you will ever get it running on a phone?
Re: Multiple variable input alias
Actually I've discovered that the above solution didn't work. This one does:
pattern:
^wave1 *(\w*) .*?(.*)
script:
send( "pose wave to "..matches[2].." and says, \""..matches[3].."\" " )
pattern:
^wave1 *(\w*) .*?(.*)
script:
send( "pose wave to "..matches[2].." and says, \""..matches[3].."\" " )
Re: Multiple variable input alias
^wave1 *(\w*) .*?(.*)
Will still give you trouble in some cases. Better would be
^wave1\s+(\w+)\s+(.+)
* matches 0 or more
+ matches 1 or more
Since the two arguments are not optional, you want to use + instead of *. Between the arguments, you only want to match whitespaces, so don't use . which matches any character; use \s instead.
Will still give you trouble in some cases. Better would be
^wave1\s+(\w+)\s+(.+)
* matches 0 or more
+ matches 1 or more
Since the two arguments are not optional, you want to use + instead of *. Between the arguments, you only want to match whitespaces, so don't use . which matches any character; use \s instead.