Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ How to make aliases in Mushclient?
How to make aliases in Mushclient?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Myrk
(7 posts) Bio
|
Date
| Mon 24 Aug 2009 06:15 PM (UTC) |
Message
| Hi,
I use CMUD, and have a script to compute the fastest speedwalks to all areas in my mud (Aardwolf) using CMUD's mapper, and make aliases for zMud/CMUD so i can give them out to my friends. Unfortunately, a lot of my friends use MUSHclient and it's quite a lot of work for them to manually make aliases for the 200+ zones. Though i can't have my script automatically make MUSH compatible aliases, i can have my script output something in a format mush can read (xml?) so i can easily copy/paste into notepad and send. They are simple aliases, just something like #ALIAS swfayke {run uwn10wnd}. Any help would be appreciated :)
Myrkul | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #1 on Mon 24 Aug 2009 06:42 PM (UTC) |
Message
| |
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #2 on Mon 24 Aug 2009 09:10 PM (UTC) |
Message
| Thanks for making your aliases available to MUSHclient users as well, much appreciated.
Your simple solution is just to give them an "alias that makes aliases". This would do for what you showed:
<aliases>
<alias
match="#alias * {*}"
enabled="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>
require "addxml" -- addxml extension
-- add the alias
addxml.alias {
match = "%1",
send = "%2",
sequence = 100,
enabled = true,
name = "%1",
group = "speedwalks"
}
ColourNote ("white", "green", "Added alias to match on '%1', sending '%2'")
</send>
</alias>
</aliases>
If I run that with your example alias, I see:
Added alias to match on 'swfayke', sending 'run uwn10wnd'
Now, a new alias has been added. This puts all the aliases in the group "speedwalks" so that you can sort them in the alias list, or disable the entire group if you want.
I have also given the alias the name of itself (ie. the alias that matches on "swfayke" is also *named* "swfayke"). That way, if you update your aliases it will replace ones of the same name.
So basically your MUSHclient players:
- Install this alias, see:
 |
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
|
- Copy your generated list of speedwalks from wherever you supply it
- Paste the whole lot into the MUSHclient command window (in a single batch)
- Hit <enter> and the whole lot should be added
The only problem here is that alias names must be like variable names, that is, start with a letter and then consist of letters, numbers or underscores. The name won't work if some of your aliases don't follow that convention. If necessary the alias above could be modified to do a string replacement of illegal characters by something else.
However if your script that generates aliases sticks to that naming convention, then you won't have any problems.
Another approach that might be slightly more modular would be to put the whole lot into a plugin, then the players only have to install one item, but I'll stick to the simpler solution for the moment. ;) |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Myrk
(7 posts) Bio
|
Date
| Reply #3 on Mon 24 Aug 2009 09:19 PM (UTC) |
Message
| So (if I understand this correctly) all they need to do is import that alias, copy paste my zMud/CMUD aliases onto the command line and it makes MUSH aliases? And would aliases within the alias it makes work? For example, if the speedwalk my script generates starts from the hotel, it adds on photel; at the beginning, which is my alias to enter my portal to the hotel. Assuming the MUSH player also has this alias it would work for them too? | Top |
|
Posted by
| Nick Gammon
Australia (23,158 posts) Bio
Forum Administrator |
Date
| Reply #4 on Mon 24 Aug 2009 09:42 PM (UTC) Amended on Mon 24 Aug 2009 09:43 PM (UTC) by Nick Gammon
|
Message
|
Myrk said:
... all they need to do is import that alias, copy paste my zMud/CMUD aliases onto the command line and it makes MUSH aliases?
Yes.
Myrk said:
And would aliases within the alias it makes work?
The amended one below will. That adds a line in the generated alias that does "send to execute". That effectively means the alias is re-parsed, and thus nested aliases will work.
<aliases>
<alias
match="#alias * {*}"
enabled="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>
require "addxml" -- addxml extension
-- add the alias
addxml.alias {
match = "%1",
send = "%2",
sequence = 100,
enabled = true,
name = "%1",
send_to = 10,
group = "speedwalks"
}
ColourNote ("white", "green", "Added alias to match on '%1', sending '%2'")
</send>
</alias>
</aliases>
However these is one difficulty here. If you put semicolons in the alias, for example:
#ALIAS swfayke {photel; run uwn10wnd}
Then you want the semicolons ignored when adding all the aliases, but processed when executing them.
This is controlled by world configuration -> command stacking in MUSHclient. If command stacking is on when they paste in all the aliases, it will break them up, which won't work.
So, the amended instructions would be:
- Install this alias, see:
 |
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
|
- Go to world configuration -> commands (Alt+0) and turn "command stacking" off.
- Copy your generated list of speedwalks from wherever you supply it
- Paste the whole lot into the MUSHclient command window (in a single batch)
- Hit <enter> and the whole lot should be added
- Go to world configuration -> commands (Alt+0) and turn "command stacking" (using semicolon) ON.
Now the semicolons are ignored when adding all the aliases, but processed when executing them. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Myrk
(7 posts) Bio
|
Date
| Reply #5 on Mon 24 Aug 2009 09:58 PM (UTC) |
Message
| Yeah, i should have mentioned there would be semicolons in my first post, there won't only be semicolons with the enter portal aliases, it's not a direct run to all areas, there are things like opening doors too. Thanks for all the help :)
Myrkul | 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.
28,426 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top