SRL Archive - RS3 Outdated / Broken Scripts

DTM Tester


osmm

2009-06-21 20:47:14

This is just a simple DTM Tester. It will check your inventory for the DTM that you specify. If found it will disguise SCAR's name to be "X DTM's Found!" as well as WriteLn "X DTM's Found!". If the script does not find any DTM's it will respond with "0 DTM`s found!".

This is just a general and basic utility for new people joining this community learning how to script.

SetUp
1. Change YourDTM (line 27) with your actual DTM
2. start logged in with the DTM in your inventory.
3. push play

Credits
1. Zeph for his CountItemsDTM and ItemCoordsDTM functions. I believe there used to be something of that sort built into SRL itself, but now it doesn't seem to be there, thus I used a user-made-function that does the same thing.
2. Yakman for Minimize and Maximize + the 2 related functions.

Shuttleu

2009-06-21 22:25:01

program New;
{.include srl/srl.scar}

var
YourDTM : Integer;

procedure LoadDTMs;
begin
YourDTM := DTMFromString('78DA63FCC4C0C010CB8002EAE7EE04D38C503' +
'EA33C90351155CDFFFFFF51D5CC00B2AA09A80906B23C51D5E4E6' +
'E6A2AA390B24AC50D55CB9FD1655CD5E205183AA86A18101450D0' +
'08CE31230');
end;

procedure CheckForDTM;
var
AmountOfDTM : Integer;
begin
AmountOfDTM:= CountItemsIn('inv', 'dtm', YourDTM, []);
Writeln(IntToStr(AmountOfDTM)+' DTM`s found!');
Disguise(IntToStr(AmountOfDTM)+' DTM`s found!');
end;

procedure SetSelfWindowState(State:TWindowState); //Yakman
begin
GetSelf.WindowState :=State;
end;

procedure SafeSetSelfWindowState(State:TWindowState); //Yakman
var
t: TVariantArray;
begin
t := [state];
ThreadSafeCall('SetSelfWindowState', t);
end;

procedure Minimize; //Yakman
begin
SafeSetSelfWindowState(wsMinimized);
end;

procedure Maximize; //Yakman
begin
SafeSetSelfWindowState(wsNormal);
end;

begin
SetupSrl;
LoadDTMs;
Minimize;
CheckForDTM;
Maximize;
end.
:)

~shut

Da 0wner

2009-06-22 03:26:54

You do not free the DTM. Also, you can just do GetSelf.WindowState := wsMinimized or something like that instead of Yakman's thing.