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 ➜ General ➜ OnPluginSaveState() not firing upon world save

OnPluginSaveState() not firing upon world save

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


Posted by Madcatz   (10 posts)  Bio
Date Mon 10 May 2010 06:40 PM (UTC)
Message
If I'm not mistaken, a plugin saves its state when the world file is saved. Am I right there? I have the following in my plugin:

function OnPluginSaveState()
  Note("OnSaveState")
  require "serialize"
  SetVariable ("captures", "captures = " .. serialize.save_simple (captures))
  SetVariable ("capturesecho", "capturesecho = " .. serialize.save_simple (capturesecho))
  SetVariable ("capturesordernums", "capturesordernums = " .. serialize.save_simple (capturesordernums))
  SetVariable ("capturesordernames", "capturesordernames = " .. serialize.save_simple (capturesordernames))
end

When I save the world file (either by clicking on the disk icon, or by going to file->save world details, I'm expecting to see the note "OnSaveState", but I can never get that to show, so I'm assuming this block of code never runs. Am I just missing something here?
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Mon 10 May 2010 08:20 PM (UTC)
Message
In the plugin header, make sure "save_state" is set to "y". For example:


<muclient>
<plugin
   name="Sellall"
   author="NeoFryBoy(Tealos)"
   id="9b5d0352809c46c0900aec6f"
   language="VBscript"
   purpose="Since Aardwolf doesn't have a sell all feature I decided to add one."
   date_written="2006-06-25 01:45:49"
   save_state="y"
   requires="3.73"
   version="1.0"
   >

</plugin>


- Nick Gammon

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

Posted by Madcatz   (10 posts)  Bio
Date Reply #2 on Mon 10 May 2010 08:31 PM (UTC)
Message
Bah, knew it was something simple I was missing. I think I even found that the other day when I had the problem and forgot about it. Anyways, that did the trick. Thanks :)
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.


12,359 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.