alias with consecutive characters

Posted by Jesse P Bunker on Fri 16 Oct 2020 12:38 PM — 4 posts, 18,985 views.

#0
I would like to make an alias as follows and can't seem to figure it out or find a reference on the forums.

r* returns
r%1
r%2
r%3

so rstc returns
rs
rt
rc

I can't figure out how to make a wildcard that only matches a single character.


Also, Nick, thank you so much for all your hard work!
USA Global Moderator #1
Use a regular expression pattern instead.
Australia Forum Administrator #2
A little bit of scripting lets you break up the wildcard (stc) into individual letters:


<aliases>
  <alias
   match="r*"
   enabled="y"
   send_to="12"
   sequence="100"
  >
  <send>

for c in string.gmatch ("%1", "%a") do
  Send ("r" .. c)
end -- for

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


Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
Australia Forum Administrator #3
If it was always 3 letters then Fiendish's suggestion would work, that is a regular expression:


^r(.)(.)(.)$


That would match 3 characters and each one would be their own wildcard (ie. %1, %2, %3).