SRL Archive - Extensions

CRov - Script Crash Recovery


nielsie95

2010-10-02 14:00:57

Hey there,

here's a little extension some of you might find interesting: CRov (Crash Recovery). It's an extension that creates a backup of your script at a certain interval. It maintains a backup for every open unsaved file and deletes it when Simba closes like it should close. If Simba crashes, the files aren't the deleted and you'll have a backup version of your script. The extension will notify you of this and will give you the opportunity to save it. All backups are saved in the Simba\CRov folder by default.

Settings can be modified through the Simba settings form and require a restart. This requires Simba version > 0.93.

Settings:
  • SettingsInMenu - If you want a menu for fast switching of intervals (3 options available: 30s, 5m or 20m). Default is 5m.
  • ForceSave - If you recover a file, True to force the user to save it, False to open it in a new tab.
  • Extension - File extension used for temporary files.
  • Interval - Saving interval in ms.
  • Directory - Directory for temporary files.
  • SaveOnRun - Make a backup before compiling/running a script.

Nielsie95

Wizzup?

2010-10-02 14:04:05

Very nice! :)

Sir R. M8gic1an

2010-10-02 14:22:18

Include it with the installer :)

~RM

Gu3st...

2010-10-02 14:34:56

Awesome! Thanks a ton :)

nielsie95

2010-10-02 14:41:06

I've already added it to the repository, so it should probably be in the next release :)

Daniel

2010-10-02 20:42:34

/me was working on one of these :/

BraK

2010-10-02 21:09:30

Totally would have saved me a few hours of work the week before last. Thanks nielsie :)

Rick

2010-10-02 22:34:32

Excellent. Thanks :)

Naum

2010-10-03 05:50:14

You are a beast niels!

Naike

2010-10-03 08:02:00

Nice one :)

Keep 'em coming!

mastaraymond

2010-10-03 08:36:38

Perfect!

nielsie95

2010-10-03 08:58:09

Little thing I forgot to say: it only works on Windows. I don't know how to delete files on Linux.

Wizzup?

2010-10-03 09:01:51

It won't work on Win64, Linux32, Linux64 either way since PascalScript won't be able to run any extension properly anyway. And if we export DeleteFile() from Simba then there's no need to use win32 API calls. :)

Dan Cardin

2010-10-03 12:52:46

add option for save upon running scripts? I wouldn't expect Simba to crash while just sitting there.

Shuttleu

2010-10-03 13:13:45

i cant find the option in the settings

~shut

nielsie95

2010-10-03 13:19:29

It's under extensions > extension# > settings.
Where # is the number of the extension (probably the last).

Saving on script start is a good idea, Dan :)

EDIT: Added the OnScriptStart idea.

Shuttleu

2010-10-03 14:13:03

From: nielsie95
It's under extensions > extension# > settings.
Where # is the number of the extension (probably the last).

this is what i have

~shut

nielsie95

2010-10-03 14:20:41

Did it compile? If you get a message with "Extension enabled" then it compiles, otherwise it shows the error (in the debug box).

Shuttleu

2010-10-03 14:22:13

From: nielsie95
Did it compile? If you get a message with "Extension enabled" then it compiles, otherwise it shows the error (in the debug box).


that would be why
i assumed it compiled :duh:
Loading extension C:\Simba\Extensions\CRov.sex
Extension Disabled - Did not compile
[Error] (212:15): Unknown identifier 'ScriptText' at line 212

~shut

nielsie95

2010-10-03 14:26:17

I see.. You need the git version then. You can get a nightly build here if you're eager to test :)

Dgby714

2010-10-03 14:43:46

Just a Note: Your auto saved script have user names passwords and bank pins taken out =)

Shuttleu

2010-10-03 14:48:56

works well

but a quick suggestion

if simba crashes then you open it the files are there
but if you then close simba properly then the files remain there

i think it should delete all the files in the CRov folder on a proper close

~shut

nielsie95

2010-10-03 16:57:34

I did that on purpose. It could be that you have multiple Simba's open and (accidentally) close the other while you're still trying to recover files. Or that you're busy recovering and some annoying brother/dog hits Alt+F4. Unpredictable things like that make me think that it's better to only empty the directory at the user's command.

Bad Boy JH

2010-10-04 04:23:42

nielsie95, thank you so much for that extention. now if only I had this two days ago when simba crashed…at least I have it now… Thanks dude.

Wizzup?

2010-10-04 05:35:14

From: nielsie95
I did that on purpose. It could be that you have multiple Simba's open and (accidentally) close the other while you're still trying to recover files. Or that you're busy recovering and some annoying brother/dog hits Alt+F4. Unpredictable things like that make me think that it's better to only empty the directory at the user's command.


Your dog hits Alt+F4? :D

But yeah. I don't think it should remove files.

nielsie95

2010-10-04 08:18:36

Obviously dogs don't like it when their owners spend more time scripting than playing with their dog, so they tend to hit Alt+F4 every now and then to get some attention :p

Gu3st...

2010-10-04 09:35:46

From: nielsie95
Obviously dogs don't like it when their owners spend more time scripting than playing with their dog, so they tend to hit Alt+F4 every now and then to get some attention :p
Oh, god I hate it when that happens… <_<
But now with the CRov Extension made by you, I wont have to worry anymore! Yaaaay

lordsaturn

2010-10-04 09:38:45

Yes goood… my plan is working flawlessly :stirthepot:

mrpickle

2010-10-04 13:14:54

I got 64bit win 7 =[…

Wizzup?

2010-10-04 13:31:08

From: mrpickle
I got 64bit win 7 =[…


Just use the 32 bit version of Simba (the only one that has an Installer) and you should be fine. :)

Sabzi

2010-10-04 14:25:54

From: Wizzup?
Your dog hits Alt+F4? :D.


Your can't? Noob dog …

Mine even written a virus while I was out for a sandwich.

Gu3st...

2010-10-04 14:56:55

From: Sabzi
Mine even written a virus while I was out for a sandwich.
That's nothing, once my dog hacked into Villavu's databases while I was opening the window (!!!)

Wizzup?

2010-10-04 14:59:02

From: Sabzi
Your can't? Noob dog …

Mine even written a virus while I was out for a sandwich.


I don't have a dog. ;)

Bad Boy JH

2010-10-14 22:49:48

this won't compile for me…*cries*

Dgby714

2010-10-14 23:23:36

From: Bad Boy JH
this won't compile for me…*cries*


You need Simba 450 (Latest Dev).

Options
1.) Compile Simba Yourself!
2.) Use mopars latest nightlie.
3.) Find someone to compile for you?

i luffs yeww

2010-10-15 01:37:09

Simba 750 is the latest by the by. ;)

Dgby714

2010-10-15 01:49:24

From: i luffs yeww
Simba 750 is the latest by the by. ;)


What? Wizzup's server still reports 715 as the latest release.

Current Simba version: 750
Latest Simba Version: 715

i luffs yeww

2010-10-15 01:55:40

715 is the latest stable, but 750 is the latest unstable (it seems stable to me, and Wizzup? Will be making 750 the current stable soon).

I was just responding to "You need Simba 450 (Latest Dev)."

nielsie95

2010-10-15 02:54:08

It should only compile as an extension, so just copy it inside your extension folder and enable it through Simba :)

Bad Boy JH

2010-10-15 08:34:29

I know that, I put it in the extention folder, and clicked enable, and got this

Loading extension C:\Program Files (x86)\Simba\Extensions\CRov.sex
Extension Disabled - Did not compile
[Error] (209:15): Unknown identifier 'ScriptText' at line 209

nielsie95

2010-10-15 08:44:27

Ok, that does indeed mean you need to wait for the next release, or use the unstable version.

Gu3st...

2010-12-24 10:29:05

Each time I click File -> Recover -> and then one of the files, Simba opens the Save File As window

E: the bug is in OnRecover, right about here:
if Execute then
begin
s := TStringList.Create;
try
s.LoadFromFile(TMenuItem(Sender).Hint);
s.SaveToFile(FileName);
finally
s.Free;
end;
end;

E2: Or is it my settings? ForceSave := LowerCase(Settings.GetKeyValueDef('ForceSave', ForceSaveDef)) = 'true';

nielsie95

2011-01-01 14:39:46

Did you change your settings? If not, ForceSave should be false (you can access the settings through the Simba settings dialog).

Gu3st...

2011-01-01 18:57:50

No, I didn't save it, but somehow it was True for me

nielsie95

2011-01-12 10:34:30

Yeah, it should be true by default, that's why I asked if you changed your settings ;)

Sex

2011-04-17 07:40:48

There is a bug with this extension.
If there is a script running and you open a new instance of Simba it says that it crashed and recovered the file that was running.

nielsie95

2011-04-17 08:01:39

I'm not sure if I can fix that. Maybe add the handle of the Simba program to the file and check if it's a valid window on recovery.. not sure. I don't think I will attend to it very soon.

Gu3st...

2012-06-24 17:17:22

Just reporting that the extension doesn't work that good with multi-instances of Simba.. :p
Open a script, modify it and wait until CRov has "saved" the script, then open a new instance of Simba. CRov will now treat the unsaved script in Simba1 as a script that has been recovered..

nielsie95

2012-06-27 10:21:16

Yeah, any suggestions on how to solve this? Search for processes with the name Simba? Feel free to contribute an enhancement :)

pija

2014-10-16 04:07:03

Unfortunately CROV isn't working for me. It has saved me countless of times so, thank you.
(CROV extension is enabled.)

Justin

2014-11-02 20:20:09

Any chance we can get an update on this? Current version throws this:

Extension Disabled - Did not compile

Cheers

Olly

2014-11-02 21:45:14

If this is right some memory I've got here…. Try removing the type TCharArray = array of char in the extension.

Clarity

2014-11-02 21:49:18

From: Olly
If this is right some memory I've got here…. Try removing the type TCharArray = array of char in the extension.


That I believe is for associate.sex's error, CRov's error is this:
[Error] C:\Simba\Extensions\CRov.sex(106:12): Variable Expected at line 107
Compiling failed.

Picture of highlighted lines: