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
➜ Recording Speedwalks
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Oligo
(26 posts) Bio
|
| Date
| Tue 23 Apr 2013 04:25 PM (UTC) |
| Message
| I dug around the forums and it's prob something obvious, but is there a way to record the path I recently walked as a speedwalk?
The equivalent of the tintin #savepath function.
For example, if I go , east, north, east, east, east.
It will save that as e;n;e;e;e; or something ?
The EvaluateSpeedwalk() seems to be more for the execution than the recording of a speedwalk. |
mud.arctic.org : 2700 | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Wed 24 Apr 2013 10:26 AM (UTC) |
| Message
| Write a plugin and use something like the OnPluginCommandEntered callback to record what you recently entered.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Oligo
(26 posts) Bio
|
| Date
| Reply #2 on Fri 26 Apr 2013 11:50 PM (UTC) Amended on Fri 26 Apr 2013 11:51 PM (UTC) by Oligo
|
| Message
| I got started down this path of creating a plugin to duplicate Wintin functionality I'm used to with your help in pointing me in the right direction of the OnPluginCommandEntered() callback. However, I'm trying to use an alias to AddAlias and it doesn't seem to create an alias in my MCL file. Is the plugin scope independent of the .MCL scope? Can an AddAlias call in the plugin add an alias in the .MCL?
Because the below doesn't seem to work:
<alias
match="^#savepath(\s+(.+))?$"
enabled="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>
Note("in savepath: arg: "..Trim("%2")..", speedwalk: "..GetVariable("speedwalk_path_current"))
AddAlias("food_alias", "eat", "eat food", alias_flag.Enabled, "")
AddAlias(Trim("%2"),Trim("%2"), "Execute("..GetVariable("speedwalk_path_current")..")",bit.bor(alias_flag.Enabled,alias_flag.RegularExpression),"")
</send>
</alias>
<script>
<![CDATA[
function OnPluginCommandEntered(sText)
if (string.sub(sText,1,1) == "n"
or string.sub(sText,1,1) == "e"
or string.sub(sText,1,1) == "s"
or string.sub(sText,1,1) == "w"
or string.sub(sText,1,1) == "u"
or string.sub(sText,1,1) == "d") then
if (#GetVariable("speedwalk_path_current") > 0) then
SetVariable("speedwalk_path_current",GetVariable("speedwalk_path_current")..";"..sText)
else
SetVariable("speedwalk_path_current",sText)
end
end
end
]]>
</script>
|
mud.arctic.org : 2700 | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Sat 27 Apr 2013 08:42 AM (UTC) |
| Message
| | The main world script space, and each plugin script space, are separate. This was done by design so plugins could be written in different languages (eg. VBscript, JScript, Lua). |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Oligo
(26 posts) Bio
|
| Date
| Reply #4 on Sun 28 Apr 2013 07:05 AM (UTC) |
| Message
| Is there a method where I don't need to use a plugin and can still access the command entered much like the plugin callback OnPluginCommandEntered()?
Or what do you recommend is the best solution if I want to have aliases saved to my .MCL file programatically and the contents of the aliases are based upon input commands captured? |
mud.arctic.org : 2700 | | 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.
17,820 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top