Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {$I Soulsplit/core/tfile.Simba}
- {$I Socks.Simba}
- (*
- Soulsplit include updater written by Robert
- *)
- type
- TUpdateNode = record
- link:string;
- sourceFile:TFile;
- end;
- TUpdateSystem = array of TUpdateNode;
- var
- soulsplitUpdater:TUpdateSystem;
- procedure TUpdateNode.create(f:Tfile;pageLink:string);
- begin
- self.sourceFile := f;
- self.link := pageLink;
- end;
- procedure TUpdateSystem.addNode(f:Tfile;pageLink:string);
- begin
- setLength(self, length(self) + 1);
- self[length(self) - 1].create(f, pageLink);
- end;
- procedure TUpdateSystem.init;
- var
- FNA, PA:TStringArray;
- i:integer;
- begin
- self.addNode(newFile(appPath + 'Includes\Soulsplit\', 'Soulsplit', 'simba'), 'https://raw.githubusercontent.com/officerBarbrady/SSInclude/master/Soulsplit/Soulsplit.simba');
- FNA := ['bank','chatbox','tDirectory','tfile','gametab','globals','interface',
- 'inventory','login','mainscreen','math','minimap','mouse','prayer',
- 'text','timing'];
- for i := 0 to high(FNA) do
- self.addNode(newFile(appPath + 'Includes\Soulsplit\core\', FNA[i], 'simba'), 'https://raw.githubusercontent.com/officerBarbrady/SSInclude/master/Soulsplit/core/' + FNA[i] + '.simba');
- self.addNode(newFile(appPath + 'Includes\Soulsplit\misc\', 'debug', 'simba'), 'https://raw.githubusercontent.com/officerBarbrady/SSInclude/master/Soulsplit/misc/debug.simba');
- self.addNode(newFile(appPath + 'Includes\Soulsplit\misc\', 'Simba', 'simba'), 'https://raw.githubusercontent.com/officerBarbrady/SSInclude/master/Soulsplit/misc/Simba.simba');
- FNA := ['extendedarrays','integerarrays','string',
- 'stringarrays','tbox','tpoint','tpointarrays',
- 'typemath','types'];
- for i := 0 to high(FNA) do
- self.addNode(newFile(appPath + 'Includes\Soulsplit\misc\datatypes\', FNA[i], 'simba'), 'https://raw.githubusercontent.com/officerBarbrady/SSInclude/master/Soulsplit/misc/datatypes/' + FNA[i] + '.simba');
- end;
- procedure TUpdateSystem.update;
- var
- i:integer;
- f:TFile;
- p:string;
- gitPage: HTTPS;
- begin
- for i := 0 to high(self) do
- begin
- gitPage.Create(self[i].link, 443);
- p := gitPage.GetPage();
- gitPage.free();
- if (length(p) <> length(self[i].sourceFile.readString())) then
- begin
- writeln('Updating file ' , self[i].sourceFile.realPath);
- f.create(self[i].sourceFile.Path, self[i].sourceFile.name, 'simba', p, true);
- end;
- end;
- end;
- begin
- soulsplitUpdater.init();
- soulsplitUpdater.update();
- end.
Advertisement
Add Comment
Please, Sign In to add comment