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

Gammon Forum

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

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Alias Matching a Shorter Alias That Begins the Same Way
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Alias Matching a Shorter Alias That Begins the Same Way

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Jai   (4 posts)  [Biography] bio
Date Wed 03 Jun 2009 04:09 PM (UTC)
Message
If I have an alias that begins in a way that matches another alias, the shorter alias is matched instead of the longer alias.

So if I have this to play a minorsecond at my variable target:
<aliases>
<alias
match="pmis"
enabled="y"
expand_variables="y"
regexp="y"
sequence="100"
>
<send>play minorsecond @kill_target</send>
</alias>
</aliases>

And this to play a minorsecond at something I only need to attack once and don't want to change targets:
<aliases>
<alias
match="pmisf *"
enabled="y"
expand_variables="y"
regexp="y"
sequence="100"
>
<send>play minorsecond %1</send>
</alias>
</aliases>

Trying to use the pmisf * alias only sets off the pmis alias. Is there a way to stop this? This is how I had all my aliases set up in zMUD, and I don't want to memorize (and unavoidably confuse myself with) a new system.
[Go to top] top

Posted by Bast   (77 posts)  [Biography] bio
Date Reply #1 on Wed 03 Jun 2009 04:13 PM (UTC)

Amended on Wed 03 Jun 2009 04:15 PM (UTC) by Bast

Message
Try this,


<aliases>
<alias
match="^pmis$"
enabled="y"
regexp="y"
sequence="100"
>
<send>play minorsecond @kill_target</send>
</alias>
</aliases>


Bast

Bast

Scripts: http://bastmush.googlecode.com
[Go to top] top

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #2 on Wed 03 Jun 2009 05:30 PM (UTC)
Message
Bast's suggestion is what I'd use. Anchoring the alias wih ^ and $ (start of and end of line markers) avoids all confusion.

An alternate method though would be to lower the sequence number for the longer alias.


The pmisf isn't isn't going to work like you expect, either. You have it flagged as a regular expression but are using non-regexp syntax. If you uncheck the regular expression checkbox in the properties of the alias, and then click "Convert to Regular Expression" you'll see the pattern change from "pmisf *" to "^pmisf (.*?)$"
[Go to top] top

Posted by Jai   (4 posts)  [Biography] bio
Date Reply #3 on Thu 04 Jun 2009 03:49 AM (UTC)
Message
Thank you both!
[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.


3,964 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]