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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Suggestions
. . -> [Subject]  SpeedWalk command line character parser

SpeedWalk command line character parser

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


Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Wed 11 Mar 2009 08:04 PM (UTC)
Message
Would it be possible to add an option for what the speedwalk character "SendTo"s?

At the moment the enable Speedwalking char is hard coded to be:

<aliases>
<alias
match="^\#(.*?)$"
enabled="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>Send (EvaluateSpeedwalk("%1") )</send>
</alias>
</aliases>


It'd be nice to have the option for:

<aliases>
<alias
match="^\#(.*?)$"
enabled="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>Execute (EvaluateSpeedwalk("%1") )</send>
</alias>
</aliases>

This would be really useful for times when you have n/north/s/south etc aliased...

(I realize I posted my own workaround... :) )

Thanks Nick



[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 11 Mar 2009 08:41 PM (UTC)
Message
I take it the problem is solved?

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #2 on Mon 16 Mar 2009 01:47 AM (UTC)

Amended on Mon 16 Mar 2009 02:00 AM (UTC) by WillFa

Message
well, no, not really...

if an alias sends to speedwalk, that still gets sent to world, not execute. trying to finish off a graphical mapper miniwindow plugin and speedwalks break it because some basic x,y,z position tracking is done by aliasing the commands for n|s|e|w|north... using a speedwalk bypasses those aliases.

so the basic problem is still speedwalks always send to world, not to execute.
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #3 on Mon 16 Mar 2009 02:43 AM (UTC)

Amended on Mon 16 Mar 2009 02:44 AM (UTC) by Worstje

Message
I assume you are using a plugin. If not, this suggestion won't work for you unless you migrate (which is really simple to do).

I found aliases quite limited in nature a few years ago for precisely this reason, as well as a few other 'side effects'. Generally, the rule I go by to explain it is: don't use aliases if you wish to track sent commands - only use them to make user input more convenient.

It might sound a bit vague, but it basically means you can use the OnPluginSent() plugin callback, combined with a simple Lua pattern or other matching method to do your tracking. A really simple version is as follows:

function OnPluginSent(text)
  if (text == "s") or (text == "south") then
    TrackSpeedWalk("south")
  elseif (text == "n") or (text == "south") then
    TrackSpeedWalk("north")
  ...
  ...
  ...
  end
end


TrackSpeedWalk() is obviously some handling function you yourself wrote to do your math and stuff. The code as a whole can obviously be improved with a table and whatnot. :)

The advantage of this method is that you won't have to adjust a dozen aliases in order to do your tracking properly. Some of those aliases might be in plugins. Other commands might have their input prevented alltogether by an OnPluginSend callback. If you think about it, tracking something by alias has a lot of ways it can go wrong that this method covers for.

On a sidenote, mind sharing your plugin? I've been pondering on making a graphical mapper for MUSH for a few weeks, and while I am pretty sure how I want to go about it, it would be nice if I could possibly steal some ideas from how you are going about it. :)
[Go to top] top

Posted by WillFa   USA  (525 posts)  [Biography] bio
Date Reply #4 on Mon 16 Mar 2009 04:36 AM (UTC)
Message
Great idea Worstje!

I have some rather complexe features in it, zoning, heuristics, A* pathing, named locations, map zooming, rescaling (for when w,s,e,n walks you around and into a house and not back to the same room), all in a sqlite db, and temp maps for dynamic zones.

I'm encountering some performance issues atm... I hope to be releasing soon.
[Go to top] top

Posted by Worstje   Netherlands  (899 posts)  [Biography] bio
Date Reply #5 on Mon 16 Mar 2009 05:35 AM (UTC)
Message
.. sounds like you are pretty much doing everything I was planning for. Maybe I'll just steal it alltogether and forego writing my own. :D

By all means, please share.
[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.


15,578 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 HostDash]