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 ➜ Tips and tricks ➜ Automatic save of world file

Automatic save of world file

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


Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Tue 24 Jun 2008 12:26 AM (UTC)

Amended on Tue 24 Jun 2008 03:17 AM (UTC) by Nick Gammon

Message
The timer below will automatically save your world file every 3 minutes, if you have changed it.

This is helpful if you are making all sorts of improvements to triggers etc., but are so carried away by what you are doing you forget to save anything.


<timers>
  <timer name="autosave" enabled="y" 
    minute="3" second="0.00" offset_second="0.00"    
    active_closed="y"
    send_to="12"
    omit_from_output="y" >
  <send>

if GetInfo (111) then
  Save ()
  ColourNote ("white", "blue", "World file saved.")
end -- if world file changed

</send>

  </timer>
</timers>


This is in Lua, it will work as is if you are using Lua scripting, otherwise turn it into a plugin, and install that:


<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Tuesday, June 24, 2008, 10:23 AM -->
<!-- MuClient version 4.29 -->

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

<muclient>
<plugin
   name="Auto_Save"
   author="Nick Gammon"
   id="8238deec7c06bade8ebc3819"
   language="Lua"
   purpose="Automatically saves the world every 3 minutes"
   date_written="2008-06-24 10:23:08"
   requires="4.29"
   version="1.0"
   >
<description trim="y">
<![CDATA[
Saves the world file every 3 minutes, if it has changed.
]]>
</description>

</plugin>


<!--  Timers  -->

<timers>
  <timer 
    name="autosave"   
    enabled="y" 
    minute="3" 
    second="0.00" 
    offset_second="0.00"    
    send_to="12"
    omit_from_output="y" 
    active_closed="y"
    >
  <send>
  
if GetInfo (111) then
  Save ()
  ColourNote ("white", "blue", "World file saved.")
end -- if world file changed

</send>

  </timer>
</timers>

<script>
assert (GetOption ("enable_timers") == 1, "Timers not enabled")
</script>

</muclient>



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


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