[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  aliases and wildcards

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: aliases and wildcards
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sat 08 Apr 2006 12:38 AM (UTC)  quote  ]
Message
See this new post:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=6442

I have made an alias that will create aliases "like tintin" for you.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Thu 06 Apr 2006 11:22 PM (UTC)  quote  ]
Message
See my post about using regular expressions:

http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=5089

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Thu 06 Apr 2006 11:21 PM (UTC)  quote  ]
Message
A simple regular expression will do that:


<aliases>
  <alias
   match="^h( .*){0,1}$"
   enabled="y"
   regexp="y"
   sequence="100"
  >
  <send>cast 'cure light'%1</send>
  </alias>
</aliases>


That would match on "h" on its own or "h" followed by a space and then anything. The "anything" might be too broad, so this might be better:


<aliases>
  <alias
   match="^h( [A-Za-z]{1,}){0,1}$"
   enabled="y"
   regexp="y"
   sequence="100"
  >
  <send>cast 'cure light'%1</send>
  </alias>
</aliases>



This would only match on "h <something alphabetic>" assuming your names are like A-Z and a-z, however if other things like underscore can be in names you just put that inside the square brackets.

The notation {0,1} means "zero or 1 of these things", and {1,} means "one or more".

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Tspivey   Canada  (50 posts)  [Biography] bio
Date Thu 06 Apr 2006 10:57 PM (UTC)  quote  ]
Message
Hello. When I used Tintin, I could do something like:
#alias {h} {cast heal}
and the following would result:
h: cast heal
h argon: cast heal argon
I tried doing the same thing in Mush, but couldn't figure out how to do it without writing two aliases for each one I wanted to create this way. Is there something I'm missing? Since writing
match on: h
send: cast 'cure light'
only works if I type h, without any extra args, and "h *" in match only works if I type h with an arg or a space after it.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


1,621 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]