[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Jscript
. . -> [Subject]  error using save("");

error using save("");

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


Pages: 1 2  

Posted by KatAngel   (9 posts)  [Biography] bio
Date Tue 24 Feb 2009 11:31 PM (UTC)
Message
I have a timer set to save my world file every five minutes. When it fires, I SOMETIMES get an error, and I sometimes don't. The error shows up... maybe one in 10 fires on average. Here's the error:

Script error
World: KoD
Execution of line 1 column 1
Immediate execution
Internal application error.

The trigger is just:

world.Save("");

Even when it does fire without an error message, when I close it, it still says that world internal variables have changed and asks if I want to save the file. It does this even if I manually trigger world.Save("") while disconnected, and then close immediately after.

Am I doing something wrong here?

Using MUSHClient version 4.37
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 25 Feb 2009 12:49 AM (UTC)
Message
Hmm. Strange. No, I don't think you are doing anything wrong. I Googled for:


jscript "Internal application error."


A few sites seemed to advise re-registering the jscript.dll file as follows:


  • Click Start, and then click Run.
  • In the Open box, type regsvr32 jscript.dll, and then click OK.


You should get the same result by simply clicking on the "Register DLL" button in the scripting configuration dialog.

Let us know if this doesn't fix the problem.

- Nick Gammon

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

Posted by KatAngel   (9 posts)  [Biography] bio
Date Reply #2 on Wed 25 Feb 2009 12:53 AM (UTC)
Message
That didn't fix it.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 25 Feb 2009 12:57 AM (UTC)

Amended on Wed 25 Feb 2009 01:00 AM (UTC) by Nick Gammon

Message
On this page is a plugin that reports your jscript version (JScript_Version):

http://www.gammon.com.au/plugins/

Can you please run that and advise what version you have?

Actually, I think it is part of the MUSHclient distribution, it should already be in the plugins directory.

- Nick Gammon

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

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Wed 25 Feb 2009 01:00 AM (UTC)
Message
I got:


Script engine = JScript
Version = 5.7
Build  = 16599



- Nick Gammon

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

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Wed 25 Feb 2009 01:01 AM (UTC)
Message
Also can you please show the timer:

http://mushclient.com/copying

- Nick Gammon

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

Posted by KatAngel   (9 posts)  [Biography] bio
Date Reply #6 on Wed 25 Feb 2009 03:29 AM (UTC)
Message
Script engine = JScript
Version = 5.7
Build = 18066

<timers>
<timer enabled="y" minute="5" second="0.00" offset_second="0.00" send_to="12"
active_closed="y" >
<send>world.Save("");</send>

</timer>
</timers>

It gives the same error if I put it directly into the command window using the script prefix. (i.e., "/world.Save("");")
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Wed 25 Feb 2009 05:54 AM (UTC)

Amended on Wed 25 Feb 2009 11:01 PM (UTC) by Nick Gammon

Message
Well can you try this instead?

This does the same thing, but in a plugin with Lua as the script language. Maybe there is something funny about jscript.

Save between the lines to disk as Auto_Save.xml, and then use File menu -> Plugins to install that as a plugin. You will get a confirmation message about whether or not it thinks it saved OK. You might want to check on disk that the date/time of the world file has been updated.


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Wednesday, February 25, 2009, 5:51 PM -->
<!-- MuClient version 4.40 -->

<!-- Plugin "Auto_Save" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Auto_Save"
   author="Nick Gammon"
   id="3ea0bfc4db127153568ff673"
   language="Lua"
   purpose="Saves the world file periodically"
   date_written="2009-02-25 17:50:10"
   requires="4.00"
   version="1.0"
   >
<description trim="y">
<![CDATA[
Saves the world file periodically.
Default is every 5 minutes.
]]>
</description>

</plugin>


<!--  Timers  -->

<timers>
  <timer 
    enabled="y" 
    minute="5" 
    send_to="12"
>
  <send>

if GetInfo (111) then  -- world file changed?
  if Save () == false then
    ColourNote ("green", "", "World file saved.")
  else
    ColourNote ("white", "red", "Couldn't save world file.")
  end -- if
end -- if world file changed

</send>

  </timer>
</timers>

</muclient>

- Nick Gammon

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

Posted by KatAngel   (9 posts)  [Biography] bio
Date Reply #8 on Wed 25 Feb 2009 03:32 PM (UTC)

Amended on Wed 25 Feb 2009 03:36 PM (UTC) by KatAngel

Message
It gives me "Couldn't save world file." every single time, and after about 5 times, it gives me an alert that says "an unnamed file was not found." The plugin then stops functioning at all. If I try to reinstall it, MUSHclient crashes.

The last modified date on the file changes even though it says it couldn't save, but after the crash, any changes I made don't show up once I open it back up again. So it changed the date, but didn't actually save.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #9 on Wed 25 Feb 2009 07:32 PM (UTC)
Message
Hmmm, we have a larger problem here than the version of jscript.

There must be something about your environment - if people in general couldn't save thousands of players would be screaming.

Let's narrow it down some more ...


  • What operating system are you using? (Visa, XP, WIndows 98, Ubuntu, etc.)

  • If under Vista are you running with Administrator privileges?

  • Can you tell me the name of the world file? I assume you have named it already (on disk) as you said you checked the date/time of it. Perhaps special characters in the file name are responsible.

  • In particular, are any of the characters: "<>"|?:#%;/\" in the file name?

  • What directory are you saving it to?

  • Do you have write permission to that directory?

  • Can you reliably save it using File menu -> Save? (and if so, do changes get saved?)

  • What is your "current directory" when doing a save? To find this out execute this script command:

    
    Note (GetInfo (64))
    


  • Do you have any plugins installed? If so, does the problem go away if you disable all of them?

  • Do you have a script function name entered on the World Events -> Save box in the scripting configuration?




- Nick Gammon

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

Posted by KatAngel   (9 posts)  [Biography] bio
Date Reply #10 on Wed 25 Feb 2009 08:19 PM (UTC)
Message

  • Using Windows XP Professional
  • World file is named KoD, another one named KoD2. Both have the same timer and experience the same problem.
  • One is saved to C:\Program Files\MUSHclient, the other to C:\Program Files\MUSHclient\worlds
  • I have write permissions to all directories.
  • I can reliably save with File->Save, and all changes get saved.
  • Current directory is "C:\Program Files\MUSHclient\"
  • I do not have any plugins installed.
  • I do not have anything written in the World Events -> Save box in the scripting configuration
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #11 on Wed 25 Feb 2009 11:04 PM (UTC)
Message
It looks like I confused myself by having a very obscure return code from Save.

Also, the documentation was wrong. :(

Anyway, I have amended the plugin above - it should be checking for false, that representing a good save. I also added a check that it didn't save if it didn't have to, to save your screen filling up with "World file saved." messages when you don't change anything.

Can you try the amended plugin please, and report back your results?

- Nick Gammon

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

Posted by KatAngel   (9 posts)  [Biography] bio
Date Reply #12 on Wed 25 Feb 2009 11:10 PM (UTC)
Message
Seems to be working so far. I'll let you know if it ever throws an error.
[Go to top] top

Posted by KatAngel   (9 posts)  [Biography] bio
Date Reply #13 on Thu 26 Feb 2009 01:09 AM (UTC)
Message
I got the "an unnamed file was not found" error again just a moment ago.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #14 on Thu 26 Feb 2009 02:05 AM (UTC)
Message
That plugin does not have a provision for displaying the exact error. It either says "World file saved." or "Couldn't save world file.".

Do you perhaps have the timer still running?

Where does the error message "an unnamed file was not found" appear? Does a dialog box pop up with it in it?

A Google search for "an unnamed file was not found" seems to indicate that, under some situations, this error may occur. They refer to the MFC libraries, which is what MUSHclient is built using. So far I haven't seen a resolution.

There appears to be a suggestion that, for some users, they can save once, but not more than once. Also it suggests that the problem occurs because MFC saves the file under a temporary name, and then cannot rename it.

I will continue to investigate.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[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.


54,088 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

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 HostDash]