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