Dark_Sniper
2007-02-17 19:41:59
The Code im releasing will update your script automaticly without the user of the script needing to do much.
This one Checks the version number of the script and sees if it needs to be updated.
this one Gets the text from the page and writes it to a file.
Edit: FIXED EVERYTHING WOOT!
now i can tell some people are getting ideas like oo i can so give someone a virus or o man if i use a script with this in it ill get a virus or something bad on my computer….
now you may see it like that but its impossible as far as i see it….
getpage returns the whole page in string which is text …. plain text canot give your anything bad…
it is safe
////////////////////////////////////////////////////////////
// NeedUpdate(URL , VerNum : String) : Boolean; //
// Checks the URL you give it for Version number. //
// if the version number is not the same as //
// your current version number it returns true. //
////////////////////////////////////////////////////////////
// usage: NeedUpdate('http://www.google.com' , '1.0') //
// will check google for text of 1.0 //
////////////////////////////////////////////////////////////
Function NeedUpdate(URL, CurrentVer : String) : Boolean;
Var
WebPage : String;
begin
WebPage := GetPage( URL );
if not (WebPage = CurrentVer) then
Result := True;
end;This one Checks the version number of the script and sees if it needs to be updated.
////////////////////////////////////////////////////////////
//UpdateScript(URL, FilePath, FileName, FileType : String)//
// Goes to URL givin to it takes all text on site //
// and saves it to file path given as filename givin //
////////////////////////////////////////////////////////////
//usage: UpdateScript('http://www.google.com/update.txt', //
// 'C:\', 'Google', '.txt' ) //
////////////////////////////////////////////////////////////
Procedure UpdateScript(URL, FilePath, FileName, FileType : String);
Var
WebPage : String;
FileNum : Integer;
begin
WebPage := GetPage( URL )
FileNum := ReWriteFile ( ''+FilePath+''+FileName+''+FileType+'' , true );
if( FileNum < 0 )then begin
AddtoReport('Error with updating: File Error.')
Exit;
end;
WriteFileString(FileNum, WebPage)
CloseFile(FileNum);
end;this one Gets the text from the page and writes it to a file.
Edit: FIXED EVERYTHING WOOT!
now i can tell some people are getting ideas like oo i can so give someone a virus or o man if i use a script with this in it ill get a virus or something bad on my computer….
now you may see it like that but its impossible as far as i see it….
getpage returns the whole page in string which is text …. plain text canot give your anything bad…
it is safe