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.
Entire forum
➜ MUSHclient
➜ Beta testing
➜ World.Get Default Plugins Directory
World.Get Default Plugins Directory
|
Posting of new messages is disabled at present.
Refresh page
Posted by
| Magnum
Canada (580 posts) 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. | Top |
|
Posted by
| Magnum
Canada (580 posts) 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. | Top |
|
Posted by
| Magnum
Canada (580 posts) 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. | Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) 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 | Top |
|
Posted by
| Magnum
Canada (580 posts) 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. | Top |
|
Posted by
| Magnum
Canada (580 posts) 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. | Top |
|
Posted by
| Magnum
Canada (580 posts) 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. | Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) 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 | Top |
|
Posted by
| Magnum
Canada (580 posts) 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. | Top |
|
Posted by
| Magnum
Canada (580 posts) 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. | Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) 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 | Top |
|
Posted by
| Magnum
Canada (580 posts) 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. | Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) 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 | Top |
|
Posted by
| Magnum
Canada (580 posts) 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. | 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.
35,298 views.
Posting of new messages is disabled at present.
Refresh page
top