SRL Archive - General

rs_DeleteUID and rs_DeleteUIDEx


Freddy1990

2008-03-30 13:52:45

I will be removing rs_DeleteUID and rs_DeleteUIDEx in my constant quest to reduce the amount of RS specific function in SCAR and they really aren't that useful… In case they're really needed they can still be placed in a plugin.

As I'm removing these I decided just to post DeleteUID for anyone who'd want it:
procedure DeleteUID;
const
Locations: array[1..5] of string = (
'.file_store_32\',
'.file_store_33\',
'.jagex_cache_32\',
'.jagex_cache_34\',
'.general_store\'
);
Files: array[1..2] of string = (
'uid.dat',
'random.dat'
);
var
i, j: Integer;
SystemRoot, Loc, sFile: string;
begin
SystemRoot := GetSystemRoot;
for i := 1 to 5 do
begin
Loc := SystemRoot + Locations[i];
if DirectoryExists(Loc) then
for j := 1 to 2 do
begin
sFile := Loc + Files[j];
if FileExists(sFile) then
DeleteFile(PChar(sFile));
end;
end;
end;

Easy to add more paths/files

And the GetSystemRoot function:
function GetSystemRoot: string;  
var
Buffer: array[0..255] of Char;
BufferSize: Cardinal;
begin
BufferSize := 255;
GetWindowsDirectory(Buffer, BufferSize);
Result := string(Buffer) + '\';
end;

Starblaster100

2008-03-30 14:20:22

Nice, thanks for releasing the depreciated functions Freddy :)

Timer

2008-03-30 14:41:28

just to tell u, it don't compile… deletefile. and the GetWindowsDirectory don't exist.. :redface:

Naike

2008-03-30 14:42:40

Thx for this! Keep up the good work :]

Wizzup?

2008-03-31 06:10:03

From: Timer
just to tell u, it don't compile… deletefile. and the GetWindowsDirectory don't exist.. :redface:


Not in SCAR, in Delphi they do exist though.

Timer

2008-04-01 17:09:11

Oo… -.- LoL

I See…. :p

Stupid Me! :D