Go Back   AC3D Forums > General > AC3D Suggestions
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 20th December 2010, 10:17 AM   #1
Mossie
Senior Member
Professional user
 
Mossie's Avatar
 
Join Date: Dec 2003
Location: UK
Posts: 369
Default Auto Save to Time

Would like ot see and auto save with the following options:
1. time, in minutes, from 5 to 30mins
2. filename with auto number

This would reduce the number of times I screw up on files and models.
__________________
Regards, Gerry "Mossie" Mos
--------------------------------------------------------------------------
WW1 Aircraft Library
http://ww1-aircraft.info/

Mossie 3D CAD, "Prompt and Precise"
http://mossie3dcad.com/
Mossie is offline   Reply With Quote
Old 31st December 2010, 03:19 PM   #2
Mossie
Senior Member
Professional user
 
Mossie's Avatar
 
Join Date: Dec 2003
Location: UK
Posts: 369
Default Re: Auto Save to Time

Anyone like to write a script to do this? Is it possible?
__________________
Regards, Gerry "Mossie" Mos
--------------------------------------------------------------------------
WW1 Aircraft Library
http://ww1-aircraft.info/

Mossie 3D CAD, "Prompt and Precise"
http://mossie3dcad.com/
Mossie is offline   Reply With Quote
Old 14th June 2013, 04:45 PM   #3
Clipper
Junior Member
Member
 
Join Date: Apr 2005
Posts: 13
Default Re: Auto Save to Time

Is there anything like this yet? I just lost an hour's work, grrrrr. My own fault, I know but I was so happily working away...
Clipper is offline   Reply With Quote
Old 17th June 2013, 12:17 PM   #4
Stiglr
Senior Member
Professional user
 
Stiglr's Avatar
 
Join Date: Feb 2004
Location: Portland, OR
Posts: 604
Default Re: Auto Save to Time

I'd think the people who do plugins regularly could spit this out in just a few minutes. Me, I'm code clueless....

How's it going, Clip? (waves)
__________________
Flight Sim Project Contributor

My Gaming Rig:
i5 2500K Quad-Core CPU at 3.3GHz
MSI P67A-C43 mobo
4GB of PC12800 DDR3 memory
Windows 7
1GB Galaxy GeForce GTX550 Ti video card GeForce 270.61 drivers (4/2011)
Cougar joystick/throttle combo
CH Pedals
Stiglr is offline   Reply With Quote
Old 20th November 2013, 12:17 PM   #5
Geoffm
Junior Member
Member
 
Geoffm's Avatar
 
Join Date: Aug 2013
Location: London UK
Posts: 22
Default Re: Auto Save to Time

Save this script as auto_save.tcl in <ac3d_dir>/scripts.

Code:
namespace eval asave {
    # Autosave implementation
    variable nsave 0 ;# count number of saves for file name.
    proc auto_save {ms} {
        # if a model is loaded, save version N, repeat after ms millisec
        global nsave
        global unsaved_changes
        global acfilename ;# last saved file name
        if {$unsaved_changes} {
            incr nsave
            set orname $acfilename
            set fname [file root $acfilename]_${nsave}.ac
            puts "Save $nsave as $fname"
            set acfilename $fname
            menu_save_last
            set acfilename $orname
        }
        after $ms "eval asave::auto_save $ms"
    }
    asave::auto_save 60000 ;# 60000 = 1 minute.
    # puts "Autosave start"
}
to automatically save your current file as <orignal name>_1.ac and so on.

Will only make a backup if a change is detected (the changes which cause 'changes made do you want to save' on Exit). Makes a save every minute if there is a change; replace 60000 with 10000 if you want to fill up your disk quickly.
Geoffm is offline   Reply With Quote
Old 21st November 2013, 04:07 AM   #6
Mossie
Senior Member
Professional user
 
Mossie's Avatar
 
Join Date: Dec 2003
Location: UK
Posts: 369
Default Re: Auto Save to Time

Thank you very much works as stated. A nice addition to the tool box. No longer will changes be lost.
__________________
Regards, Gerry "Mossie" Mos
--------------------------------------------------------------------------
WW1 Aircraft Library
http://ww1-aircraft.info/

Mossie 3D CAD, "Prompt and Precise"
http://mossie3dcad.com/
Mossie is offline   Reply With Quote
Old 15th February 2020, 07:25 PM   #7
Tomkat
Member
Advanced member
 
Join Date: Nov 2010
Posts: 45
Default Re: Auto Save to Time

I have no idea how to write scripts... but I was able to figure out how to change the posted script into an "auto save" that just overwrites the open file every 5 minutes.

Code:
namespace eval asave {
    # Autosave implementation
    
    proc auto_save {ms} {
        # if a model is loaded, save version, repeat after ms millisec
        
        global unsaved_changes
        global acfilename ;# last saved file name
        if {$unsaved_changes} {
            set orname $acfilename
            set fname [file root $acfilename].ac
            menu_save_last
            set acfilename $orname
        }
        after $ms "eval asave::auto_save $ms"
    }
    asave::auto_save 300000 ;# 60000 = 1 minute.
    # puts "Autosave start"
}
Tomkat is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 06:57 AM.


AC3D Forum
(C) Inivis Limited 2020