SRL Archive - Discussions & Debates

Favorite script updating method


Kyle

2014-10-20 20:35:11

So a few people and I were talking about on skype recently about our favorite way to keep scripts up to date, and we had conflicting opinions about it. So if you could vote on how you prefer your scripts to be updated I'm sure it will be useful to script writers to see what the general thoughts of this are.

Please only vote if you download scripts here to use, as I want this to be the opinion of users and not scripters!

Lipcot

2014-10-20 20:37:56

From: elfyyy


No auto updating, if the script is outdated, you will have to manually download new one from thread.

Script checks if it is outdated, tells you to download new on from thread.

Script auto updates, overwriting the previous version.

Script auto updates, with a new file name with the version in it to prevent overwriting.


number one: i dont mind

number two: better than number one

number three: NEVER overwrite, i probably touched it a lot (antiban, breaking, that kinda stuff)

numbre four: best. although im between number two and this one

KeepBotting

2014-10-20 22:18:09

autoUpdateMe(), no overwriting

Like Asha's scripts, "SCRIPT HAS BEEN UPDATED, USE (FILENAME).SIMBA!!!"

Ashaman88

2014-10-20 22:28:18

From: KeepBotting
autoUpdateMe(), no overwriting

Like Asha's scripts, "SCRIPT HAS BEEN UPDATED, USE (FILENAME).SIMBA!!!"


yes my way or the highway!

i like either the autodl overwrite or the autodl with new version in title in a new file (what i use). less work for everyone :)

Camel

2014-10-20 23:34:16

meh, I can see how auto updating helps people who are frightened by code.. But, I almost always end up commenting out the autoupdate() procedure… I'm going with 1.

Incurable

2014-10-20 23:52:28

*sigh* I have to be the guy who accidentally voted for the wrong option. FML. I voted for #3 , overwrite, but I meant to vote for #4 . I don't think there's anything wrong with auto-updating as long as it's non-intrusive. I mean honestly, you download a script, run it, close it, delete/keep the previous version, open the new one, then run it. It takes a total of 10 seconds at most and you don't have to go through the hassle of finding the thread and downloading the new script.

AutoUpdateMe ftw! ;)

Home

2014-10-21 05:07:43

I updated AutoUpdateMe little bit.

Added:
Msg & DialogBox.
Restart Simba.

Some other stuff.


procedure AutoUpdateMe(ScriptName, ScriptVer, VerURL, SourceURL: string);
var
TProc :TProcess;
I, iFile: Integer;
CurrVer, NewScript, FileName: String;
ArgArr :TStringArray;
begin
CurrVer := GetPage(VerURL);
if (Trim(CurrVer) > ScriptVer) then
begin
if (MessageDlg('Update Available', ScriptName + ' ' + CurrVer + ' is Available for Download' + Chr(13) + 'Would you like to Download?', mtInformation, [mbYes, mbClose]) = 11) then
Exit;
NewScript := GetPage(SourceURL);
FileName := ScriptPath + ScriptName + ' ' + CurrVer + '.simba';
iFile := Rewritefile(FileName, True);
try
WriteFileString(iFile, NewScript);
except
begin
MessageBox('Unable to download ' + ScriptName + ' ' + CurrVer + '.simba', 'Error!', 8);
TerminateScript;
end;
end;
CloseFile(iFile);

ArgArr := ['/c ' + AppPath + 'Simba.exe' + ' -o ' + '"' + FileName + '"' + ' -r', ' /c Taskkill /PID ' + IntToStr(GetProcessID) + ' /F']

If (MessageDlg('Script Successfully downloaded!', ScriptName + ' ' + CurrVer + ' has been downloaded.' + Chr(13) + 'To complete the update you must restart the script. Would you like to restart the script now?', mtInformation, [mbYes, mbClose]) = 11) then
Exit;

for I := 0 to 1 do
begin
TProc.Init(nil);
TProc.setExecutable('Cmd.exe');
TProc.getParameters().Add(ArgArr[I]);
TProc.Execute();
TProc.Free();
end;
end;
end;

begin
AutoUpdateMe('Ashaman Herblore', '0.1', 'http://ashamanherblore.googlecode.com/git/Version.txt', 'http://ashamanherblore.googlecode.com/git/AshamanHerblore.simba')
end.


~Home