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
➜ Bug reports
➜ 4.61: GetInfo(67) in OnPluginInstall returns .
4.61: GetInfo(67) in OnPluginInstall returns .
|
Posting of new messages is disabled at present.
Refresh page
Posted by
| Tspivey
Canada (54 posts) Bio
|
Date
| Wed 15 Sep 2010 05:44 PM (UTC) |
Message
| When I create a plugin with something like:
Note(GetInfo(67))
it prints ".\".
I expect it to print the directory where the .mcl file is located,
like it does when I reload the plugin. If this is expected behaviour, is there a workaround? | Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) Bio
Forum Administrator |
Date
| Reply #1 on Wed 15 Sep 2010 09:51 PM (UTC) |
Message
| Has the world file in question ever been saved? Like, did you just create a new world and add the plugin to it? If the file hasn't been saved it can't have a file name. Otherwise it should be the full pathname to it. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Tspivey
Canada (54 posts) Bio
|
Date
| Reply #2 on Thu 16 Sep 2010 03:54 AM (UTC) |
Message
| The world is saved. To verify, I did the following:
1. Created and saved a new world with ip address 0.0.0.0 so it didn't connect to anything.
2. Opened the plugin wizard, filled in the fields with test,, went to the script tab and typed:
function OnPluginInstall()
Note(GetInfo(67))
end
Created and saved the plugin, and loaded it. So far all is well, and it prints "C:\Program Files\MUSHclient\worlds\."
Saving the world again and re-opening, the plugin prints ".\".
If I reinstall the plugin, the correct path is displayed. | Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) Bio
Forum Administrator |
Date
| Reply #3 on Thu 16 Sep 2010 06:32 AM (UTC) |
Message
| Thanks for the detailed description. I can reproduce that. Very weird. I'll look into it. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Nick Gammon
Australia (23,122 posts) Bio
Forum Administrator |
Date
| Reply #4 on Thu 16 Sep 2010 06:46 AM (UTC) |
Message
| Well it seems there is a strange behaviour in the internal libraries. It calls the "you are being opened" function just *before* it stores the pathname of the world file.
I have added an extra line into version 4.62 to fix that.
Meanwhile, all I can suggest is either waiting slightly (even 0.1 seconds with a DoAfterSpecial function call) as you will find it will be OK providing you don't do it in OnPluginInstall, or since you just want the directory, try GetInfo (57) which is the default world files directory. That would hopefully be where the file is anyway. |
- 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.
14,298 views.
Posting of new messages is disabled at present.
Refresh page
top