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, 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 ➜ Suggestions ➜ Saving world get the relative plugin path converted to absoluted

Saving world get the relative plugin path converted to absoluted

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


Posted by Zhenzh   China  (68 posts)  Bio
Date Wed 07 Feb 2018 06:16 AM (UTC)
Message
I manually modified .MCL file to get the world portable like this: <include name="./worlds\JHL\Plugin\Character_Information.xml" plugin="y" />

But I find the saving operation in mush automatically overwrites the relative path I provided, instead, converts it to an absolute path: <include name="E:\MUSHCLIENT\WORLDS\JHL\Plugin\Character_Information.xml" plugin="y" />

Which means each time I do the saving world operation, I have to manually modify the .MCL file to recover the relative plugin path

Is it possible to keep the relative plugin path in .MCL file?

Another problem is that the relative path uses startup directory, which means starting world by load MCL in much and directly running MCL file may get error because of different startup path.

Can I set the relative path using application install directory
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 08 Feb 2018 05:56 AM (UTC)
Message
Would it be possible for you to use LoadPlugin to load the desired plugins?

http://www.gammon.com.au/scripts/doc.php?function=LoadPlugin

Then you could tweak the path that is loaded as desired. A small script to do that could be in your main (script) file.

You may need to unload all the plugins when saving the world (or closing the session), otherwise the absolute paths would be saved with the world file.


http://www.gammon.com.au/scripts/doc.php?function=UnloadPlugin

- Nick Gammon

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

Posted by Zhenzh   China  (68 posts)  Bio
Date Reply #2 on Fri 09 Feb 2018 04:47 PM (UTC)
Message
How to unload the plugin when saving the world or closing session?

Is manually operation required?
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Fri 09 Feb 2018 08:18 PM (UTC)
Message
Template:version Please help us by advising the version of MUSHclient you are using. Use the Help menu -> About MUSHclient.


The current version of MUSHclient does in fact save plugins as relative paths. For example from one of my MCL files:


<!-- plugins -->
<include name="Omit_Blank_Lines.xml" plugin="y" />
<include name="Summary.xml" plugin="y" />
<include name="MUSHclient_Help.xml" plugin="y" />
<include name="Calculator.xml" plugin="y" />
<include name="Config_Option_Changer.xml" plugin="y" />
<include name="C:\program files\mushclient\worlds\plugins\Scrolling_Window_Demo.xml" plugin="y" />
</muclient>


You will notice that all but one plugin has a relative path. The only one that didn't was a plugin that was not currently in the default plugins directory.

Make sure your plugins are loaded from the worlds/plugins directory and it should work. Also make sure you have the latest version:

http://www.gammon.com.au/forum/index.php?bbtopic_id=1

- Nick Gammon

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

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #4 on Fri 09 Feb 2018 08:37 PM (UTC)
Message
I notice when I look at my post above that the only difference in the last plugin was the "case" of the path, not the real path. I've amended the save code to do a case-insensitive check of the pathname.

https://github.com/nickgammon/mushclient/commit/95d4dcb

This new pre-release version should be available if you follow the instructions here:

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

- 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.


21,933 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

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.