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


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, 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.
 Entire forum ➜ MUSHclient ➜ General ➜ zMUD Convertee, getting a good start...

zMUD Convertee, getting a good start...

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


Posted by RasmusKL   (15 posts)  Bio
Date Fri 08 Dec 2006 11:22 AM (UTC)
Message
Hey,

Okay, Im switching now, too much mess in zMUD, want lua scripting :-)

However, since I'm going to convert my current settings, I'd like to hear from experienced MC rats how to structure these best..

My Situation: 1 mud, multiple chars, I usually structure my settings based on the chars class, so that two chars of equal class will have the same settings. But I'd like to have the possibility to have common triggers / aliases for all chars.

So... What do I do?
- one world, enabling / disabling classes of settings (like I did in zmud - and what I'm slightly annoyed with :-))
- multiple worlds ?...

Thanks,
- Rasmus.


Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 09 Dec 2006 01:53 AM (UTC)
Message
I would investigate plugins - they let you put common stuff into a plugin file, and then that same file can be loaded into multiple worlds. Each plugin can have its own "state" file, which is a disk file where relevant information (basically, variables) can be saved and automatically reloaded.

An alternative is to use group names for things, and enable/disable groups, but I think using plugins make things a lot more modular.

Common shared routines can be loaded using "require" in Lua, so that if you had some standard things that each plugin might want to do, then you can include that in each one. Some examples of that are shipped with MUSHclient, such as using a proxy table to access MUSHclient variables as a dummy Lua table.

- Nick Gammon

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

Posted by RasmusKL   (15 posts)  Bio
Date Reply #2 on Tue 12 Dec 2006 08:49 AM (UTC)
Message
Thanks Nick, I'll look into plugins.
Top

Posted by RasmusKL   (15 posts)  Bio
Date Reply #3 on Tue 12 Dec 2006 08:55 AM (UTC)
Message
On another note,

I'm trying to figure out how to best do my triggers, I'm a bit torn between using the "Send To: Script" option, rather than using the Script box for executing a specific lua function. I feel that using "Send To: Script" gives me more versatility, since I can add arguments etc, while using the other option makes me either make a whole bunch of functions, embedding the arguments for each trigger or switching / using the trigger name a lot, which I don't like that much.

My gut feeling is that I want to move as much as possible into the script file, since the Trigger Dialog can sometimes be a bit cumbersome to work with, for many triggers (my experience anyways). Is there any way to do syntax highlighting in lua, without omitting the line and reposting it to output? I was looking to see if the 4th argument might be a metatable, where you could actually alter the styles, but I don't think so?

Post might sound a bit negative, but I'm already so much happier for Mush than zMUD :-P Thanks for a good program.

Thanks,
- Rasmus.

Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #4 on Wed 13 Dec 2006 02:07 AM (UTC)
Message
Quote:

Is there any way to do syntax highlighting in lua, without omitting the line and reposting it to output?


No, the output is really what is received from the MUD. If you want to change it you really have to omit it and repost it, and that has to be done in a script, and not "send to script", otherwise the resposted line is also omitted.

- Nick Gammon

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

Posted by Onoitsu2   USA  (248 posts)  Bio
Date Reply #5 on Wed 13 Dec 2006 11:11 AM (UTC)
Message
Nick that is slightly incorrect, if u look at this posting of mine...

http://www.gammon.com.au/forum/?id=7517

It uses the standard workaround for the omitting, but it calls a function instead of doing the work itself in the doafterspecial.

I know the code could be condensed in MANY ways, but I code, and if it is functional, and easy to follow, then it need not be altered in my opinion.

Hope that posting will help you in your questioning.

Laterzzz,
Onoitsu2
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #6 on Wed 13 Dec 2006 11:36 AM (UTC)
Message
Some would argue that unnecessarily verbose code is hard to follow. :) It tends to be easy for the person who wrote it, but hard for others... or, hard for the person who wrote it, a few time periods later. It is also usually harder to maintain.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Nick Gammon   Australia  (23,046 posts)  Bio   Forum Administrator
Date Reply #7 on Wed 13 Dec 2006 08:51 PM (UTC)
Message
Quote:

It uses the standard workaround for the omitting, ...


What you have done is a DoAfterSpecial to defer the writing of the new line by 0.1 seconds. This conceivably would echo lines in a different order to what they were received in.

This issue of trying to do a note in "send to script" seems to be an ongoing problem, so I have made a new feature in version 3.83, see:

http://www.gammon.com.au/forum/?id=7527

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


22,801 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

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]