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

Directions Script

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


Posted by Sediket   (4 posts)  [Biography] bio
Date Thu 20 Aug 2015 06:07 AM (UTC)
Message
Hello,

I'm new to MUSH client and I've run into a situation. I have my directions all saved in a txt file from other another mud client (CMUD) where the directions are separated by semi-colons. The problem is that I have script commands in the txt file as well and they don't mix well so far in MUSHClient.

so for example as a test:

tested commands:

f = io.open ("runs\\\\100k.txt")
/Execute (f:read("*l"))

txt file:

2 nw;2 n;3 w;/Send ("hi")

I've noticed that the directions would execute properly with the command stacking operator, but the script commands wouldn't be processed as script commands and just sent to the mud unless the script commands were at the beginning of the line, but then any semi-colons error because the semi-colons aren't recognized in the scripting language.

The reason why I'm doing this is because I would like certain commands to easily be executed when entering certain rooms. Like updating target variables or other similar functions. Also I'm looking for an organized way of doing this. In the past I tried using conditional statements, but it got all crazy and convoluted especially if I had to modify my directions because all the conditional statements would need to be shifted, like room 23 became room 26, etc.

I also tried then having an extra line after each direction line in the file for script commands, but then the script commands couldn't be stacked in one line.

Any suggestions?
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 20 Aug 2015 09:37 AM (UTC)
Message
See: http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=6572

You may have to rework a bit.

One approach would be to be for you to convert the ";" into newlines in the script, then the Execute call might work. Or just break it into lines, and do an Execute() on each one.

- Nick Gammon

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

Posted by Sediket   (4 posts)  [Biography] bio
Date Reply #2 on Thu 20 Aug 2015 11:08 AM (UTC)
Message
Thanks Nick, I'll give it a shot.
[Go to top] top

Posted by Meerclar   USA  (733 posts)  [Biography] bio
Date Reply #3 on Fri 21 Aug 2015 01:19 AM (UTC)

Amended on Fri 21 Aug 2015 01:40 AM (UTC) by Meerclar

Message
If there's a mud command equivalent to that Send ("hi) (ie, say hi) you're trying to use you can just use the mud command. It's also worth noting that MC speedwalk doesn't need ; separators between directions like you had in cmud.

As an example, here's a couple of the more interesting but less convoluted speedwalks I have aliased:

<aliases>
<alias
match="draco"
enabled="y"
sequence="100"
>
<send>5n6w6ses2enes8e;open door;3s3en2e;take key;unlock door;open door;drop key;n;close door</send>
</alias>
</aliases>

<aliases>
<alias
match="necro"
enabled="y"
sequence="100"
>
<send>#3s3w4s2e;take key;unlock gate;open gate;drop key;#5sesd2wnene2sd8sd2se4swsed3n2w</send>
</alias>
</aliases>

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[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.


2,477 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]