SRL Archive - Research & Development Lounge

villavu.com script version checker


slushpuppy

2013-04-18 11:25:40


procedure CheckVersion;
var src,url,scriptName,currentVersion,tmp : String;
astr : TStringArray;
I : Integer;
X,Y : LongInt;
begin
scriptName := 'slushysuperheat'; //word Part of the filename
currentVersion := '02'; //numeric part of file name
url := 'http://villavu.com/forum/showthread.php?t=101409'; //url of script topic


src := GetPage(url);
src := Between('Attached Files</legend>','</fieldset>',src);
astr := Explode('</li>',src);
Y := 0;
for I := 0 to high(astr) do
begin
src := between('attachmentid=','&amp;d=',astr[I]);
if src <> '' then X := StrToInt64(src) else X := 0;
if (X > Y) AND (Pos(scriptName,astr[I]) > 0) then
begin
Y := X;
tmp := astr[I];
end;
end;
if tmp = '' then writeln('['+scriptName+'] Warning URL not found');
I := Pos(scriptName,tmp);
if (I > 0) AND (PosEx(currentVersion,tmp,I) <> 0) then writeln('['+scriptName+'] Script update found, please update script here: ' + url);
end;
end.


Just simply change

  scriptName := 'slushysuperheat';  //word Part of the filename
currentVersion := '02'; //numeric part of file name
url := 'http://villavu.com/forum/showthread.php?t=101409'; //url of script topic

Then add CheckVersion; Before setupSRL;

Please note that your script naming conventions must be in this format for this to work:

SCRIPTNAMEblahblahVERSION

Olly

2013-04-18 14:04:17

very nice :p, not sure about the AND's though :D

rj

2013-04-18 15:39:54

Very nice I will be using this!

slushpuppy

2013-04-18 19:41:45

From: Ollybest
very nice :p, not sure about the AND's though :D


which 1 D:

Olly

2013-04-18 20:18:38

From: slushpuppy
which 1 D:


I mean how you do your and's in caps! :p

wthomas

2013-04-18 20:26:51

From: Ollybest
I mean how you do your and's in caps! :p


No one really likes coding standards, it makes it much more fun, especially in pascal where cases don't matter.. :)

The Mayor

2013-04-18 20:54:29

Nice idea slushy :)

John

2013-04-18 23:43:18

Well done :)

senrath

2013-04-18 23:43:56

From: wthomas
No one really likes coding standards, it makes it much more fun, especially in pascal where cases don't matter.. :)


I like coding standards :<

wthomas

2013-04-19 03:58:29

From: senrath
I like coding standards :<


Are we supposed to use camelCase or PascalCase for identifiers? I'm never totally sure..

senrath

2013-04-19 10:09:13

From: wthomas
Are we supposed to use camelCase or PascalCase for identifiers? I'm never totally sure..


camelCase for variables, PascalCase for procedures/functions, I believe.

Rich

2013-04-19 16:52:18

From: senrath
camelCase for variables, PascalCase for procedures/functions, I believe.
I've always used PascalCase for everything. I guess by the way you've written camelCase it's where the first word isn't capitalised?

senrath

2013-04-19 17:38:53

From: Rich
I've always used PascalCase for everything. I guess by the way you've written camelCase it's where the first word isn't capitalised?


As far as I am aware, that is the only difference between camelCase and PascalCase, yes.

fcslynnlin

2013-05-06 05:15:48

it makes it much more fun, especially in pascal where cases don't matter.. ??