SRL Archive - SRL Archives

FindDTMInBank and Bitmap


Rune Hacker

2007-05-16 20:03:47

Idk, I think these could be useful functions with a little editing, you tell me. The will scroll the bank looking for a dtm or a bitmap you made and even close the bank. Ide add more options to do such as closing the bank an option or stuff, idk, you tell me. Ide just love a function made by me in srl, but in the mean time, im just making functions i find useful. Im always up for suggestions.

{*******************************************************************************
function FindDTMInBank(DTM, Amount: Integer): Boolean;
By: Rune Hacker
Description: Will start at the top of the bank and scroll down until it finds the DTM, then
it will withdraw X amount of it and close the bank.
*******************************************************************************}
function FindDTMInBank(DTM, Amount: Integer): Boolean;
var
z, ScrollDown, AtBottom, CloseButton, TimeMarker : Integer;
begin
if not LoggedIn then Exit;
ScrollDown := BitmapFromString(10, 10, 'z78DA33713131323636' +
'C1200D40C010429AE0506342B15E4C35B8F4228BE057835F9C5A7' +
'AF1BB871895C490F8C396785DA48606E5F10B006F477801');
AtBottom := BitmapFromString(6, 19, 'z78DA33713131323636193' +
'4A4B1B1918B9129E5A4B9999999A909E524A9EE37000143083998' +
'D5208B60AA4116A19CC46F26F16E06003C788BC5');
CloseButton := BitmapFromString(10, 11, 'z78DA3330000243033' +
'069E664EA62628C9F3440528F4912AF0BBF380159135373134308' +
'89DF3D505D48EA3149F274E13201971A533753236367641297BD9' +
'82A89D185DF04FC6A70C96211B7347131B6C42409B807872E5C26' +
'0000D95685F1');
MarkTime(TimeMarker);
Mouse(475, 80, 2, 2, True);
repeat
if(FindDTM(DTM, x, y, MSX1, MSY1, MSX2, MSY2))then
begin
Wait(1000 + random(400));
Mouse(x, y, 2, 2, False);
Wait(900 + random(500));
ChooseOption(x, y, 'ithdraw X');
Wait(1300 + random(300));
TypeSend(IntToStr(Amount));
Wait(1500 + random(500));
FindBitmapSpiralTolerance(CloseButton, x, y, MSX1, MSY1, MSX2, MSY2, 3);
MMouse(x, y, 1, 1);
Wait(600 + random(100));
Mouse(x, y, 1, 1, True);
Result := True;
end else
FindBitmapSpiralTolerance(ScrollDown, x, y, MSX1, MSY1, MSX2, MSY2, 2);
MMouse(x, y, 1, 1);
HoldMouse(x, y, True);
Wait(700 + random(50));
ReleaseMouse(x, y, True);
z := z + 1;
until (z >= 12) or (TimeFromMark(TimeMarker) >= 70000) or (FindBitmapSpiralTolerance(AtBottom, x, y, MSX1, MSY1, MSX2, MSY2, 2));
if (z >= 12) or (TimeFromMark(TimeMarker) >= 70000) or (FindBitmapSpiralTolerance(AtBottom, x, y, MSX1, MSY1, MSX2, MSY2, 2))then
begin
Result := False;
end;
FreeBitmap(ScrollDown);
FreeBitmap(AtBottom);
FreeBitmap(CloseButton);
end;

{*******************************************************************************
function FindBitmapInBank(Bitmap, Amount, Tol: Integer): Boolean;
By: Rune Hacker
Description: Will start at the top of the bank and scroll down until it finds the Bitmap with a
tolerance, then it will withdraw X amount of it and close the bank.
*******************************************************************************}
function FindBitmapInBank(Bitmap, Amount, Tol: Integer): Boolean;
var
z, ScrollDown, AtBottom, CloseButton, TimeMarker : Integer;
begin
if not LoggedIn then Exit;
ScrollDown := BitmapFromString(10, 10, 'z78DA33713131323636' +
'C1200D40C010429AE0506342B15E4C35B8F4228BE057835F9C5A7' +
'AF1BB871895C490F8C396785DA48606E5F10B006F477801');
AtBottom := BitmapFromString(6, 19, 'z78DA33713131323636193' +
'4A4B1B1918B9129E5A4B9999999A909E524A9EE37000143083998' +
'D5208B60AA4116A19CC46F26F16E06003C788BC5');
CloseButton := BitmapFromString(10, 11, 'z78DA3330000243033' +
'069E664EA62628C9F3440528F4912AF0BBF380159135373134308' +
'89DF3D505D48EA3149F274E13201971A533753236367641297BD9' +
'82A89D185DF04FC6A70C96211B7347131B6C42409B807872E5C26' +
'0000D95685F1');
MarkTime(TimeMarker);
Mouse(475, 80, 2, 2, True);
repeat
if(FindBitmapSpiralTolerance(Bitmap, x, y, MSX1, MSY1, MSX2, MSY2, Tol)then
begin
Wait(1000 + random(400));
Mouse(x, y, 2, 2, False);
Wait(900 + random(500));
ChooseOption(x, y, 'ithdraw X');
Wait(1300 + random(300));
TypeSend(IntToStr(Amount));
Wait(1500 + random(500));
FindBitmapSpiralTolerance(CloseButton, x, y, MSX1, MSY1, MSX2, MSY2, 3);
MMouse(x, y, 1, 1);
Wait(600 + random(100));
Mouse(x, y, 1, 1, True);
Result := True;
end else
FindBitmapSpiralTolerance(ScrollDown, x, y, MSX1, MSY1, MSX2, MSY2, 2);
MMouse(x, y, 1, 1);
HoldMouse(x, y, True);
Wait(700 + random(50));
ReleaseMouse(x, y, True);
z := z + 1;
until (z >= 12) or (TimeFromMark(TimeMarker) >= 70000) or (FindBitmapSpiralTolerance(AtBottom, x, y, MSX1, MSY1, MSX2, MSY2, 2));
if (z >= 12) or (TimeFromMark(TimeMarker) >= 70000) or (FindBitmapSpiralTolerance(AtBottom, x, y, MSX1, MSY1, MSX2, MSY2, 2))then
begin
Result := False;
end;
FreeBitmap(ScrollDown);
FreeBitmap(AtBottom);
FreeBitmap(CloseButton);
end;

JuKKa

2007-05-17 03:51:32

Instead of loading alot of bitmaps to the memory with close buttons and if i understood right scroll the bank up u can just use:

FixBank;
CloseBank;

else this is good i guess

Rune Hacker

2007-05-17 10:55:33

Well, i tested it in fally bank and the closebank; didn't work and do bitmaps thsi size lag the game because i didn't notice any lag at all. And I wanted it to be reliable so i made my own scrolling because its not hard. Im still going to update this because im going to use it in my new script.

~alex~

2007-05-17 15:57:34

You should use a case satement for the amount, if someone just wants to withdraw say 1,5 or 10 instead of always clicking withdraw x, other than that nice job. I'll probably use this.

shaunthasheep

2007-05-17 19:53:19

u should add if ClickOption('Withdraw X', 1) then …etc.. just incase =p