alias w/ w/o target

Posted by Atheis on Mon 08 Mar 2010 06:57 PM — 5 posts, 18,945 views.

#0
is it possible to have an alias than can be used with and without a target?

mm * = cast 'magic missile' %1

when you use that alias you always need to type the target afterwards. what if youre already fighting and just want to type 'mm' without the target?
USA #1
Try this on for size:

<aliases>
  <alias
   name="foobar"
   match="^\s*mm(?:\s+(.+))?\s*$"
   enabled="y"
   regexp="y"
   ignore_case="y"
   sequence="100"
  >
  <send>cast 'magic missile' %1</send>
  </alias>
</aliases>


mm test
-> cast 'magic missile' test

mm
-> cast 'magic missile'
Amended on Mon 08 Mar 2010 07:12 PM by Twisol
#2
so is that what you type in the send box? what do you type in 'alias', 'send', etc... sry im new to muding
USA #3
Just copy the whole thing in the code box - from <aliases> to </aliases>, inclusive - and go to the Aliases dialog (the one with the list). Then click Paste at the bottom and it'll import the alias.

Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
Amended on Mon 08 Mar 2010 07:42 PM by Twisol
Australia Forum Administrator #4
Template:faq=50
Please read the MUSHclient FAQ - point 50.