SRL Archive - RS3 Outdated / Broken Scripts

function DropAllDTMsFast(TheDTM: Integer): Boolean;


JAD

2007-06-30 18:50:13


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

var LogDTM: Integer;

function ChooseOptionFast(x, y, Over: Integer; txt: string): Boolean;
var
x1, y1, x2, y2, LeftCorner, RightCorner: Integer;
begin
LeftCorner := BitmapFromString(4, 4, 'z78DA33753135313137C5' +
'411A600064715CEA914500CACE13F0');
RightCorner := BitmapFromString(4, 4, 'z78DA33753135313137' +
'C5200D30002E35F8C501C9C013F0');
if (FindBitmap(LeftCorner, x1, y1)) and (FindBitmap(RightCorner, x2, y2)) then
begin
if (FindText(x, y, txt, upchars, x1, y1, x2, 502)) then
begin
Result := True;
Mouse(x + Length(txt) * 3 + (Over), y + 3, 2, 2, True);
end
else if (FindText(x, y, 'Cancel', upchars, x1, y1, x2, 502)) then
Mouse(x + 9, y + 3, 2, 2, True);
end;
FreeBitmap(LeftCorner);
FreeBitmap(RightCorner);
end;

{**********************************************************************
function DropAllDTMsFast(TheDTM: Integer): Boolean;
By: JAD
Description: Drops all DTMs in inventory from top to bottom, AKA,
"The fast way" :)
**********************************************************************}

function DropAllDTMsFast(TheDTM: Integer): Boolean;
var FastSlot: array[1..28] of Integer;
I, Q, T, Timer, LeftCorner, RightCorner: Integer;
J: TPoint;
begin
LeftCorner := BitmapFromString(4, 4, 'z78DA33753135313137C5' +
'411A600064715CEA914500CACE13F0');
RightCorner := BitmapFromString(4, 4, 'z78DA33753135313137' +
'C5200D30002E35F8C501C9C013F0');
if(not(LoggedIn))then
Exit;
GameTab(4);
T := 1;
for I := 1 to 28 do
begin
FastSlot[i] := T + Q;
Q := Q + 4;
if(Q > 24)then
begin
T := T + 1;
Q := 0;
end;
end;
for I := 1 to 28 do
begin
J := ItemCoords(FastSlot[i]);
for Q := 1 to 5 do
begin
if(FindDTM(TheDTM,x,y,J.x-30,J.y-21,J.x+30,J.y+21))then
begin
Mouse(x,y,2,2,false);
ChooseOptionFast(x,y,34,'Drop');
MarkTime(Timer);
repeat
wait(30);
until(not(FindBitmap(LeftCorner,x,y))) and (not(FindBitmap(RightCorner,x,y))) or
(TimeFromMark(Timer) > 5000);
wait(10+random(30));
Break;
end;
wait(150+random(70));
end;
end;
for I := 1 to 5 do
begin
if(FindDTM(TheDTM,x,y,MIX1,MIY1,MIX2,MIY2))then
begin
Mouse(x,y,2,2,false);
ChooseOption(x,y,'Drop');
end;
wait(200+random(200));
end;
Result := not(FindDTM(TheDTM,x,y,MIX1,MIY1,MIX2,MIY2));
end;

begin
SetupSRL;
ActivateClient;
wait(1500+random(500));
LogDTM := DTMFromString('78DA63FCC2C4C0C0CEC800021012C29283F2F' +
'F0301E31BA01A1EDC6AC0BCD740351204D4FC02AA9124A0869999' +
'81419C801A4666C2EEF907B48B85809A4F403532F8D50000BFD20' +
'B67');
DropAllDTMsFast(LogDTM);
end.

Well, if you want a good description on how this works, take a look at my other function DropToFast. It drops just like that, but this will only drop the DTM(s) specified :)

Test it out with a full inventory of logs (or you can make your own DTM and test it out with whatever you want.. :p)

Please post comments/bugs/improvements!!

NOTE: I put the fail safe in at the end to drop the DTMs we may have missed the old fashioned way just in case.. ;) It was having some problems finding the DTM.. Could have been a problem with the DTM I made, IDK. But it works :)



Enjoy!

~JAD

Harry

2007-06-30 18:53:04

OMG JAD DOUBLE POSTED!! n00b alert!!

:p maybe add some DTM's fro ore?

JAD

2007-06-30 18:55:24

From: hy71194
OMG JAD DOUBLE POSTED!! n00b alert!!

:p maybe add some DTM's fro ore?


Double posted? This is a different function :p

And you could just make your own.. Or learn how if you don't know already (You really should learn if you don't) :)

Harry

2007-06-30 18:59:34

Whoops, thought it was on the same thread, I am using iSpy.. I could make a DTM, just easier for the semi-leechers ;)

Secet

2007-07-05 01:14:02

JAD you could make functions like DropAllOres, and DropAllLogs with that function, and maybe developers would implent those to next SRL, would help many beginner scripters.

Because I think every ore looks the same, but different colors. So you just need to set starting point tolerance to 255, same thing with logs.
If you won't do it, I will. :)

JAD

2007-07-05 14:31:38

From: Secet
JAD you could make functions like DropAllOres, and DropAllLogs with that function, and maybe developers would implent those to next SRL, would help many beginner scripters.

Because I think every ore looks the same, but different colors. So you just need to set starting point tolerance to 255, same thing with logs.
If you won't do it, I will. :)


The only difference with your idea and the way I did it was the people making it have to make the DTM there selves. So instead of me doing all the work for them, they should learn DTM's anyways and make them there own :p

So I could do that.. But I think it'd be better if people had to just make a DTM and then call for this function for dropping :p

I want scripters to have to do a little work for the dropping.. And not have it all done for them. But it is a good idea though! DropAllLogs is already a function in SRL by StarBlaster which would drop a LOT faster though with this ;)