Gammon Forum
Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, 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.
Entire forum
MUSHclient
General
Make it compatible with zmud / cmud dirs
Make it compatible with zmud / cmud dirs
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Foldar
(5 posts) bio
|
Date
| Sun 23 Jan 2022 12:41 AM (UTC) Amended on Sun 23 Jan 2022 01:07 AM (UTC) by Foldar
|
Message
| zMUD: #9 w;sw;#4 w;s;sw;w;w;open s;s;s;sw;s;window
MUSHClient: #9w (sw) 4w s (sw) 2w (open s) 2s (sw) s (window)
Many people use zmud if they give me dirs it is mostly in zmud format. would be nice if i could paste it in mushclient
It is a whole lot of typing to adjust it. | top |
|
Posted by
| Nick Gammon
Australia (23,043 posts) bio
Forum Administrator |
Date
| Reply #1 on Sun 23 Jan 2022 06:25 AM (UTC) |
Message
| Is there really a # in the middle like that? As in #4?
You can make an alias with a bit of scripting to convert them. For example:
<aliases>
<alias
match="#*"
enabled="y"
send_to="12"
sequence="100"
>
<send>
-- extract out each direction
local directions = utils.split ("%1", ";")
local t = { } -- for converted results
for k, v in ipairs (directions) do
count, remainder = string.match (Trim (v), "^(%d+)%s*(.+)$")
if count then
directions = remainder
else
count = ""
remainder = v
end -- if
remainder = Trim (remainder) -- remove spaces
if #remainder > 1 then
remainder = "(" .. remainder .. ")"
end -- if more than one letter
table.insert (t, count .. remainder)
end -- for each direction
Send (EvaluateSpeedwalk (table.concat (t, "")))
</send>
</alias>
</aliases>
|
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
|
Turn off speedwalking in the Input configuration -> Commands, and let the alias do it instead. I haven't allowed for the "#" in the middle as I thought that might just be a typo.
If it isn't you can get rid of it, eg.
remainder = string.gsub (remainder, "#", '')
After the line with "remove spaces" on it. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | 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.
6,363 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
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.