working directory errors

Posted by Oriol on Mon 14 Sep 2009 02:33 PM — 7 posts, 33,344 views.

#0
Greetings:
Today I switched from mush 4.4something to the new mush 4.43 portable zip file.
When I tried to load a world I got this error:
Line 1703: C:\Documents and Settings\Administrator\Desktop\worlds\plugins\Winamp.xml contains an invalid path. (include file not loaded)
A bunch fo times for every plugin on the game.
Also when I open a world it goes tot he plugins dir when I add the plugins manually.
Any way to let mush know where the default plugins dir should be?
Thnx.
USA #1
http://www.gammon.com.au/scripts/showrelnote.php?version=4.42&productid=0

Quote:

4. Changed the way the current directory is handled.

In previous versions the current directory (that is, the default directory used in a file open if no full pathname is specified) would vary if you used the file browser dialog. For example, if you loaded a plugin (by browsing to find it), then the file browser would leave the current directory as the one the plugin was in.

I didn't want to change the file browser to not remember where you last browsed to, because that would be annoying if you wanted to load lots of plugins (say) from a non-standard location, and had to keep browsing to the same spot.

On the other hand, having the current directory change randomly can make plugins stop working.

The solution is now as follows:

a) When MUSHclient starts up, it remembers the startup directory (the current directory). This is stored internally (See GetInfo (68)).

b) The "file browsing" directory is initially set to be the startup directory.

c) When you use the file browser (there are about 36 places this happens), the current directory is set to be the file browsing directory - before the dialog appears. This way, file browsing remembers where you last browsed to.

d) After you have browsed for a file, MUSHclient remembers the now-current directory as the file browsing directory, for next time you browse a file.

e) After that, the current directory is reset back to the startup directory.

Note that the script function ChangeDir *does* change the current directory, as advertised.


:)
#2
I must be stupid or something, but I don't see a solution to my problem here. All it does is state what I have already mentioned.
It does state taht the directory is changed every time you browser for a file, which makes plugins not load right.
It doesn't seem to be working either, since it's trying to load stuf in desktop, and I never loaded anything from there..
#3
OK, I got it.
The problem was that I was running mush from a shortcut and it'd pick up desktop as the working directory.
Is tehre any way to fix this or do I need to run it directly from the folder?
USA #4
Change your plugin's includes to reference GetPluginIfo(20) .. "filename.ext" and not just "filename.ext"
Australia Forum Administrator #5
Oriol said:

The problem was that I was running mush from a shortcut and it'd pick up desktop as the working directory.
Is tehre any way to fix this or do I need to run it directly from the folder?


Just change the shortcut to make the working directory the MUSHclient directory. Under XP, right-click the shortcut, choose Properties, and enter the directory you want under the "Start in" box.
Australia Forum Administrator #6
Oriol said:

Any way to let mush know where the default plugins dir should be?


The default plugins directory is in the File -> Global Preferences dialog.

Whether that gets used when plugins load include files is a bit debatable.