SRL Archive - OSR Help

Script AutoUpdate ?


Sk1nyNerd

2013-05-21 16:04:41

im trying to add an autoupdater to some private scripts, is there a form or way to do it so the script stays private online i.e someone bored on pastebin doesnt stumble upon it *unlikely but for future references and knowledge*

thank youuu :D

Kevin

2013-05-21 16:23:01

If you want it to stay private, then you need to post it on a private server/host. Although, if you have a dedicated private script gmail account, that should be decent enough :p

Sk1nyNerd

2013-05-21 16:27:16

From: Kevin
Although, if you have a dedicated private script gmail account, that should be decent enough :p


what does that mean? i just started learning about autoupdating like an hour ago ha :)

Kevin

2013-05-21 16:29:01

Setup a brand new gmail account and keep only private scripts on their svn server attached to that account.

Sk1nyNerd

2013-05-21 16:51:15

mk thanks! ill see if i can figure it out lol. does this look correct and are my comments describing whats going on right? couldnt find a tut so found this in one of Ashaman88's scripts and made some name changes. idk what the CloseFile(NewFile) purpose is though


procedure AutoUpdater;
var NewFile:integer;
OnlineVersion, NewScript, NewFileName:string;
begin
if UseAutoChecker then
begin
OnlineVersion := GetPage('http://zezima.com/version.txt'); //this is just a number?
writeln(OnlineVersion);
writeln(ScriptVersion); //declared at begining of script
if (trim(OnlineVersion) > ScriptVersion) then //checking if the number is greater than the script in uses number?
begin
NewScript := GetPage('http://zezima.com/scriptname.simba'); //getting the new script?

NewFileName := ScriptPath+ 'scriptname' + OnlineVersion + '.simba'; //what we are saving the new script as?
NewFile := Rewritefile(NewFileName, true); //rewriting the old file with the new file
try //if an error occurs when saving??
WriteFileString(NewFile, NewScript);
except
begin
terminatescript;
end;
end;
CloseFile(NewFile); //not sure what its closing?
TerminateScript;
end else
writeLn('You have the latest version of the script!');
end else
WriteLn('We are not checking for updates!');
end;

edit: are you talking about google docs? or google drive they call it now? havent used google for awhile :P then i just add who ever it is to the document and they can view it? but wouldnt they be able to edit the document aswell? sorry im a noob, i have limited experience lol

Kevin

2013-05-22 18:02:45

From: ibot_dung11
mk thanks! ill see if i can figure it out lol. does this look correct and are my comments describing whats going on right? couldnt find a tut so found this in one of Ashaman88's scripts and made some name changes. idk what the CloseFile(NewFile) purpose is though


procedure AutoUpdater;
var NewFile:integer;
OnlineVersion, NewScript, NewFileName:string;
begin
if UseAutoChecker then
begin
OnlineVersion := GetPage('http://zezima.com/version.txt'); //this is just a number?
writeln(OnlineVersion);
writeln(ScriptVersion); //declared at begining of script
if (trim(OnlineVersion) > ScriptVersion) then //checking if the number is greater than the script in uses number?
begin
NewScript := GetPage('http://zezima.com/scriptname.simba'); //getting the new script?

NewFileName := ScriptPath+ 'scriptname' + OnlineVersion + '.simba'; //what we are saving the new script as?
NewFile := Rewritefile(NewFileName, true); //rewriting the old file with the new file
try //if an error occurs when saving??
WriteFileString(NewFile, NewScript);
except
begin
terminatescript;
end;
end;
CloseFile(NewFile); //not sure what its closing?
TerminateScript;
end else
writeLn('You have the latest version of the script!');
end else
WriteLn('We are not checking for updates!');
end;

edit: are you talking about google docs? or google drive they call it now? havent used google for awhile :P then i just add who ever it is to the document and they can view it? but wouldnt they be able to edit the document aswell? sorry im a noob, i have limited experience lol


Personally I use google docs just fine for public and/or private scripts (different google accounts for private scripts).
With Google Docs, you can add permissions for edit to a selected list of people while permissions to view is public. However, while permission to view is public, searching for you isn't easy, which is what keeps you fairly safe in respect to keeping your script private :p

CloseFile(NewFile); "Closes" the file. Basically when you open or write a file, it's now in your memory, so you need to close it in order to "free" it like you would a DTM or BMP.

Sk1nyNerd

2013-05-22 18:15:18

From: Kevin
Personally I use google docs just fine for public and/or private scripts (different google accounts for private scripts).
With Google Docs, you can add permissions for edit to a selected list of people while permissions to view is public. However, while permission to view is public, searching for you isn't easy, which is what keeps you fairly safe in respect to keeping your script private :p

CloseFile(NewFile); "Closes" the file. Basically when you open or write a file, it's now in your memory, so you need to close it in order to "free" it like you would a DTM or BMP.


alright cool, ill be playing around with it in the few days so i will let you know of any questions.

and that makes sense, same as C++ but i couldnt find a definet answer. thanks

Kevin

2013-05-22 18:17:22

From: ibot_dung11
alright cool, ill be playing around with it in the few days so i will let you know of any questions.

and that makes sense, same as C++ but i couldnt find a definet answer. thanks


Good luck with everything, and if you think I can answer a question I may not notice, feel free to throw a mention on me to grab my attention (it even works in edits).