SRL Archive - Reflection Development

[Include] Remade AutoUpdater!


Shady?

2008-09-13 15:34:40

NEW VERSION IS OUT:

CLICK HERE TO GET IT



Well, seeing as no one replyed, i remade this:

Var
Download: TStringArray;
Downloaded: Array[0..10] Of String;
IHI, Files: Integer;
currentver, currentversion: string;

const
thisversion = 98;



Procedure DownloadFiles;
Begin
For IHI := 0 To High(Download) Do
Begin
Downloaded[ihi] := GetPage('http://scarreflection.googlecode.com/svn/trunk/' + Download[ihi]);
WriteLn(download[ihi]);
End;
End;

Procedure Install;
Begin
For Ihi := 0 To High(Download) Do
Begin
Files := RewriteFile(AppPath + '\Includes\SRL\SRL\Reflection\' + Download[ihi], False);
WriteFileString(Files, Downloaded[ihi]);
CloseFile(Files);
End;
End;

Procedure UpdateReflection;

begin
Download := ['Changelog.txt', 'Characters.Scar', 'Core.scar',
'Depreciated.scar', 'Hooks.Scar', 'Objects.Scar', 'README.txt',
'Reflection.Scar', 'Walking.Scar', 'Items.scar'];
currentver := GetPage('http://scarreflection.googlecode.com/svn/trunk/');
currentversion := Between('<title>Revision ', ': /trunk', currentver);
WriteLn('Our current version is: '+inttostr(thisversion)+' and the latest version is: '+currentversion);
If (thisversion = strtoint(currentversion)) then
begin
WriteLn('We got the latest Reflection !');
exit;
end else
begin
DownloadFiles;
Install;
WriteLn('Latest Reflection Downloaded, please restart the script!');
TerminateScript;
end;
end;

Now, how to use it: First Reflection Devs should add a new file to the reflection folder called "Updater.scar" with the above code, and remember to change "thisversion = 98;" in the constants.
Now, in "Reflection.scar" should be added this:
{.Include SRL\SRL\Reflection\Updater.Scar}
And that's all with the setup, now we should call the procedure "UpdateReflection;" somewhere in our script, as it will check wether we have the last version or not.
If you like this, please at least reply? lol.

Nava2

2008-09-14 09:28:43

Damn dude… Thats awesome.

Really useful for those without SVN. :)

Suggestion, make some of the variables local. That way, others can use the same variables in their scripts ;).

Shady?

2008-09-14 12:06:22

From: Nava2
Damn dude… Thats awesome.

Really useful for those without SVN. :)

Suggestion, make some of the variables local. That way, others can use the same variables in their scripts ;).


Thanks. I g2g eat now, i'll se what i do when i come back :)

Dracody

2008-09-16 22:26:22

Yeah seems great , also for people like me that have a windows vista with multiple sessions and Im not the admin, so it wont let me download it by svn :( , thanks a lot

edit: meh it isnt working for me :(

Shady?

2008-09-16 23:13:51

From: Dracody
Yeah seems great , also for people like me that have a windows vista with multiple sessions and Im not the admin, so it wont let me download it by svn :( , thanks a lot

edit: meh it isnt working for me :(


Follow this steps:
1. Copy that code and save it to Includes/srl/srl/reflection/Updater.scar
2. Open "Reflection.scar" and in line 21 add this
{.Include SRL\SRL\Reflection\Updater.Scar}
3.Get the script you're using, let's say you're using FastFighter, go to the main loop and after SetupSrl; add UpdateReflection;

Mjordan

2008-09-17 19:06:44

Wow very nice thanks!

Dracody

2008-09-17 20:29:00

From: Shady?
Follow this steps:
1. Copy that code and save it to Includes/srl/srl/reflection/Updater.scar
2. Open "Reflection.scar" and in line 21 add this
{.Include SRL\SRL\Reflection\Updater.Scar}
3.Get the script you're using, let's say you're using FastFighter, go to the main loop and after SetupSrl; add UpdateReflection;


Actually I just added a main loop and It looks like this and also works:


Var
Download: TStringArray;
Downloaded: Array[0..10] Of String;
IHI, Files: Integer;
currentver, currentversion: string;

const
thisversion = 98;



Procedure DownloadFiles;
Begin
For IHI := 0 To High(Download) Do
Begin
Downloaded[ihi] := GetPage('http://scarreflection.googlecode.com/svn/trunk/' + Download[ihi]);
WriteLn(download[ihi]);
End;
End;

Procedure Install;
Begin
For Ihi := 0 To High(Download) Do
Begin
Files := RewriteFile(AppPath + '\Includes\SRL\SRL\Reflection\' + Download[ihi], False);
WriteFileString(Files, Downloaded[ihi]);
CloseFile(Files);
End;
End;

Procedure UpdateReflection;

begin
Download := ['Changelog.txt', 'Characters.Scar', 'Core.scar',
'Depreciated.scar', 'Hooks.Scar', 'Objects.Scar', 'README.txt',
'Reflection.Scar', 'Walking.Scar', 'Items.scar'];
currentver := GetPage('http://scarreflection.googlecode.com/svn/trunk/');
currentversion := Between('<title>Revision ', ': /trunk', currentver);
WriteLn('Our current version is: '+inttostr(thisversion)+' and the latest version is: '+currentversion);
If (thisversion = strtoint(currentversion)) then
begin
WriteLn('We got the latest Reflection !');
exit;
end else
begin
DownloadFiles;
Install;
WriteLn('Latest Reflection Downloaded, please restart the script!');
TerminateScript;
end;
end;

begin
UpdateReflection;
end.
Still didnt let me download it because freaking vista dont let me write at Program Files because im not an admin… so I gotta download those at desktop, but it works, thanks anyways!:)

Shady?

2008-09-17 20:54:30

From: Dracody

Still didnt let me download it because freaking vista dont let me write at Program Files because im not an admin… so I gotta download those at desktop, but it works, thanks anyways!:)


Oh yeah, freaking Vista, my solution to that problem was to move the SCAR folder to my desktop :)

ekamjit

2008-11-11 16:47:52

dont need this use the have version in reflection tuts

Shady?

2008-11-12 07:56:16

NEW VERSION IS OUT:

CLICK HERE TO GET IT

davidwang

2008-11-12 08:54:29

So this updates reflection automatically?

Shady?

2008-11-12 09:27:51

From: davidwang
So this updates reflection automatically?


Yes, please go to the other topic wich is linked in the first post to get the new version