[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]  Detecting successful moves
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Detecting successful moves

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


Posted by Auren   (5 posts)  [Biography] bio
Date Tue 30 Aug 2005 03:56 AM (UTC)
Message
I have a little script set up that allows me to use the mapper in Zmud to track my position (follow only so far) from within MUSHclient. The challenge for me now is reliably keeping my position and the map in sync.

I'm using the keypad to navigate, each key is set up to call an alias with a direction as the first wildcard. I set a variable to indicate that I am attempting to move, and another for the direction I'm moving. I enable a trigger to catch a room name to indicate the move was successful. Triggers for failure messages clear both variables. If the room name trigger fires, it sends the command to zmud to update the map position. Theres is a check in there so that if I attempt to move and a move is still in progress, the new command is ignored.

Now, as long as I move relatively slowly, all is well, but if I move quickly, sometimes, the map loses track. Is there a better/more accurate way I could do this?
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #1 on Wed 31 Aug 2005 12:29 AM (UTC)
Message
The problem is that when you send movement commands faster than the replies for them arrive from the MUD, your direction variable will keep going out of synch with the triggers, because it is always set for the last command sent but retrieved by the triggers for the first command sent.

The solution would be to use a list instead of a single variable, so that you would add each new direction to the start of that list and make the triggers use and remove it. That way, no matter how many commands you send, the first one will always be used by the triggers first.

If you do that, however, you would need to keep the movement triggers permanently enabled, at least as long as you want your movement to be tracked on the map.
[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,435 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]