[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]  Beta testing
. . -> [Subject]  World.Get Default Plugins Directory
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

World.Get Default Plugins Directory

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


Posted by Magnum   Canada  (580 posts)  [Biography] bio
Date Fri 05 Jul 2002 05:04 PM (UTC)
Message
Quote:

There is a state file for each world/plugin combination.

The file name will look like this:

a282eaabbecd18a56aa07f84-c8efc9f9e1edd118c6f2dbf5-state.xml

This is:

(world ID)-(plugin ID)-state.xml

Each world should have a unique ID, and each plugin should have a unique ID, thus each world's plugin's state should have a unique file name.

I need to emulate this to store files with a plugin. Like the state file, they need to be unique to the current player and world.

Where can I get the World ID? I've been hunting around for the appropriate function...

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
[Go to top] top

Posted by Magnum   Canada  (580 posts)  [Biography] bio
Date Reply #1 on Fri 05 Jul 2002 05:19 PM (UTC)
Message
Sorry, found it myself:

World.GetAlphaOption("id")

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
[Go to top] top

Posted by Magnum   Canada  (580 posts)  [Biography] bio
Date Reply #2 on Fri 05 Jul 2002 06:06 PM (UTC)
Message
Ok, instead, I need to pull the 'Default Plugins Directory'.

The value is not stored in the world file, since it is a global option. If there is a way, please help me out, otherwise, I recommend:

World.GetDefaultPath(PathLabel)

Where PathLabel could currently be:

"Worlds"
"Plugins"
"Logs"

...and perhaps could be expanded in the future to accomodate other Default Paths declared in the Global Settings.

This is gonna be a tough one to workaround for my plugin. :(

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
[Go to top] top

Posted by Nick Gammon   Australia  (21,321 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Mon 08 Jul 2002 12:05 AM (UTC)
Message
You could get it from the Registry, and I think Krenath asked for something similar. I'll add it to the list. :)

- Nick Gammon

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

Posted by Magnum   Canada  (580 posts)  [Biography] bio
Date Reply #4 on Mon 08 Jul 2002 05:04 PM (UTC)
Message
Ok, I'll look into learning how to pull a value from the registry next time I work on the script. I would very much like to avoid writing a plugin that has to be modified by the user to work.

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
[Go to top] top

Posted by Magnum   Canada  (580 posts)  [Biography] bio
Date Reply #5 on Sat 27 Jul 2002 02:28 AM (UTC)

Amended on Sat 27 Jul 2002 02:33 AM (UTC) by Magnum

Message
A search for the word "registry" in the VBS Manual file only turns up one non-relevant result...

...so, my question is: How do I pull a value from the registry in VBS?

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
[Go to top] top

Posted by Magnum   Canada  (580 posts)  [Biography] bio
Date Reply #6 on Sat 27 Jul 2002 03:43 AM (UTC)
Message
After searching the internet for a while, seems like perhaps VBS is not capable of reading the registry directly. (Need a third party COM called "WSH"?)

If so, that's not really tolerable for me. I can't expect plugin clients to have the COM, and I don't want to distribute addition files and additional instructions.

I assume you're on vacation Nick, and will get back to this sooner or later. :) - Programming burn out?

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
[Go to top] top

Posted by Nick Gammon   Australia  (21,321 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Sat 27 Jul 2002 06:30 AM (UTC)
Message
Quote:

Programming burn out?


It has been a bit like that - but next week things will be back to normal. A whole lot of things have been happening around here, but next week I should be able to release the plugins version and catch up on some of the forum posts. :)

- Nick Gammon

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

Posted by Magnum   Canada  (580 posts)  [Biography] bio
Date Reply #8 on Sat 27 Jul 2002 07:13 AM (UTC)
Message
"Good stuff". :)

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
[Go to top] top

Posted by Magnum   Canada  (580 posts)  [Biography] bio
Date Reply #9 on Sun 04 Aug 2002 09:01 AM (UTC)
Message
Answering my original question, this is the variable I set in my plugin files:

Dim StatePath
StatePath = World.GetInfo(60) & "state\" & World.GetAlphaOption("id") & "-" & World.GetPluginID & " "

My "save file" routine appends the file name to that path. It differs very slightly from the default state files, in that the last character is a 'space' above, where as the MUSHclient state files use a 'dash' as the last character.

Unfortunately, I may end up having to write a whole file management series of routines eventually. Currently, my scripts provide no means through the client to delete files. :(

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
[Go to top] top

Posted by Nick Gammon   Australia  (21,321 posts)  [Biography] bio   Forum Administrator
Date Reply #10 on Mon 05 Aug 2002 06:59 AM (UTC)
Message
I'm not sure about the trailing space, sounds like a dodgy character to have in a file name. Maybe use a $ or something.

- Nick Gammon

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

Posted by Magnum   Canada  (580 posts)  [Biography] bio
Date Reply #11 on Mon 05 Aug 2002 08:39 AM (UTC)
Message
It works. Since MUSHclient is Windows only, there shouldn't be a problem.

I'm done my plugin, but need to wait till Tuesday to resolve a problem with my ISP. I don't have access to my own web-space FTP. I'll consider changing the character to something else while I wait. I could probably just do another dash there, since the next thing to follow is always "AOD_EQ_", so it should never collide with actual state files. I've been considering creating a subdir within the state directory as well.

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
[Go to top] top

Posted by Nick Gammon   Australia  (21,321 posts)  [Biography] bio   Forum Administrator
Date Reply #12 on Fri 09 Aug 2002 01:26 AM (UTC)
Message
Quote:

I've been considering creating a subdir within the state directory as well.


Probably a good idea. The state file names are hardly intuitive, to say the least, and that is just the ones I did. :)

- Nick Gammon

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

Posted by Magnum   Canada  (580 posts)  [Biography] bio
Date Reply #13 on Fri 09 Aug 2002 02:07 AM (UTC)
Message
Yes, I've already made the change. The files for my "AOD_EQ" plugin get saved with a subdirectory of the 'state' directory, the subdirectory haveing the same name as the plugin: "AOD_EQ".

Technically, someone could write a plugin with the same name as one of my own, and thus create directory confusion... LOL, However, I still use the double-id's, so my actual plugin state files should not be overwritten.

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
[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.


8,408 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]