Register forum user name Search FAQ

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, 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 can I change the default behavior for speedwalking?

How can I change the default behavior for speedwalking?

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


Posted by Yanwuhuan   (15 posts)  Bio
Date Wed 22 Oct 2008 06:42 AM (UTC)
Message
In my game, server accepts 'n' as 'go north', and 's' as 'go south'.
In some rooms which no special direction, like 'north' will not be recognized, but 'n'.
So game return: "What? unknown command" for "north", not "there is no this direct." which I want, "n" can get this prompt.

For examplem: #2s3n
Mushclient will execute them as "south;south;north;north;north".
I want change them to "n;n;s;s;s".

Any way to do this?

Thanks in advance!
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 22 Oct 2008 08:51 PM (UTC)

Amended on Mon 09 Aug 2010 10:18 PM (UTC) by Nick Gammon

Message
The simplest thing is to install the plugin below. This looks for the problem words as a single command being sent to the MUD, and substitutes the correct one instead. Other text is left alone.

Template:saveplugin=Speedwalk_Fixer To save and install the Speedwalk_Fixer plugin do this:
  1. Copy between the lines below (to the Clipboard)
  2. Open a text editor (such as Notepad) and paste the plugin into it
  3. Save to disk on your PC, preferably in your plugins directory, as Speedwalk_Fixer.xml
  4. Go to the MUSHclient File menu -> Plugins
  5. Click "Add"
  6. Choose the file Speedwalk_Fixer.xml (which you just saved in step 3) as a plugin
  7. Click "Close"



<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Thursday, October 23, 2008, 7:48 AM -->
<!-- MuClient version 4.37 -->

<!-- Plugin "Speedwalk_Fixer" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Speedwalk_Fixer"
   author="Nick Gammon"
   id="2fa39133624dd86581e3b846"
   language="Lua"
   purpose="Modifies 'north' to be 'n' and so on"
   date_written="2008-10-23 07:44:13"
   requires="4.00"
   version="1.0"
   >
<description trim="y">
<![CDATA[
This modifies any directions like "north", "south" sent to the MUD
and replaces then with "n", "s" and so on.
]]>
</description>

</plugin>


<!--  Script  -->


<script>
<![CDATA[
local conversions = {
  north = "n",
  south = "s",
  east  = "e",
  west  = "w",
  up    = "u",
  down  = "d",
  }

function OnPluginSend (sText)

  -- lookup conversion
  local fixed = conversions [sText]

  if fixed then  -- if found use that
    Send (fixed)
    return false -- do not send original text
  end -- if

  return true  -- send original

end -- function


]]>
</script>


</muclient>

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Yanwuhuan   (15 posts)  Bio
Date Reply #2 on Thu 23 Oct 2008 02:46 AM (UTC)
Message

It works.
Yes, it's what I want.
Thanks a million.
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.


11,100 views.

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

Go to topic:           Search the forum


[Go to top] top

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