SRL Archive - SRL Archives

Bank.scar


XabdullahX

2009-05-31 03:49:39

This searches for an item, then withdraws the item from 1st bank spot if its correct item



Procedure SAndWItem(Item: String; Amount: Integer); //Search and Withdraw item from bank
var xitems : Boolean;
ite: Integer;
OneLetterOff: String;
begin
if (BankScreen) then
begin
Mouse(85,307,1,1,True);
wait(700+Random(500));
TypeSend(AddMistakes(item, 40));
wait(800+Random(800));
MoveMouse(51,110);
wait(500+Random(200));
ite := Length(Item);
OneLetterOff := Right(Item, ite - 1);
If IsUpText(OneLetterOff) then
begin
Mouse(50,110,1,1,false);
wait(300+Random(300));
Case Amount of
1, 5, 10 : ChooseOption('Withdraw-'+IntToStr(Amount));
else
begin
Chooseoption('Withdraw-X');
xitems := true;
end;
end;
end;

if (xitems) then
begin
wait(600+Random(200));
TypeSend(AddMistakes(Inttostr(amount), 40));
end;
end else
Writeln('Its not open?');
end;

Da 0wner

2009-05-31 04:17:57

function SearchAndWithdrawItemDTM(Item : string; DTM : integer; Amount : integer) : boolean;
var
x, y, l, i : integer;
begin
l := length(Item);
for i := 1 to l do
begin
Mouse(75, 300, 20, 10, True);
Wait(70 + random(75));
TypeByte(GetKeyCode(Item[i]));
Wait(50 + random(50));
if FindDTM(DTM, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x, y, 4, 4, Amount <= 0);
Wait(150 + random(200));
if InIntArray([1, 5, 10], Amount) then
ChooseOption('draw-' + IntToStr(Amount))
else if Amount = 0 then
ChooseOption('draw-All')
else
begin
ChooseOption('draw-x');
Wait(100 + random(100));
TypeSend(IntToStr(Amount));
end;
result := true;
exit;
end;
end;
end;

That could work maybe? You should only do it if you cannot find them item in the main screen though.

XabdullahX

2009-05-31 04:31:18

Maybe, but i dont want to use dtm, because when u search for an item it will automaticly appear in the first bank spot, so just withdraw it from there

btw. added u to msn :)

Sir R. M8gic1an

2009-05-31 04:34:42

Good job, however i have a few things to say:
you most definitely do NOT want to use add mistakes. if you do, it won't find the item properly, screwing up the whole thing.


Case Amount of
1: begin
ChooseOption('Withdraw-1');
xitems := False;
end;

2..4: begin
Chooseoption('Withdraw-X');
xitems := true;
end;

5: begin
ChooseOption('Withdraw-5');
xitems := False;
end;

6..9: begin
Chooseoption('Withdraw-X');
xitems := true;
end;

10: begin
ChooseOption('Withdraw-5');
xitems := False;
end;
11..999999: begin
Chooseoption('Withdraw-X');
xitems := true;
end;


Case Amount of
1, 5, 10 : ChooseOption('Withdraw-'IntToStr(Amount));
else
begin
Chooseoption('Withdraw-X');
xitems := true;
end;
end;

~RM

XabdullahX

2009-05-31 04:44:08

Ohh, thats wat i was searching for :p

i tried

case amount of

2..4.6..9.11..: Begin
blaal
end;

That didnt work :( (Wonder why :duh:)

EDIT: You forgot a + in
1, 5, 10 : ChooseOption('Withdraw-'IntToStr(Amount));

Well, i edited first post and tested (Only tested if it compile) :)

Da 0wner

2009-05-31 08:28:56

Well mine searches after every key press lol so that it is fastest.

Nava2

2009-05-31 08:50:10

I'll do up a version tomorrow.

Great idea guys!

ian.

2009-05-31 08:52:28

Only thing I could think of adding is..

Checking to make sure it's on the main "View all" tab, and checking if there is anything to scroll through. As if there are only a few items in the bank, this would be detectable in my opinion.

Da 0wner

2009-05-31 09:09:39

FixBankTab;

ian.

2009-05-31 09:15:50

Does that check if you can scroll?

Da 0wner

2009-05-31 09:21:05

Oh, nope. It just clicks the first tab if not already on it. But checking if you can scroll can be achieved by performing a GetColor on the top of the scrollbar.

ian.

2009-05-31 09:22:22

I know it's simple, just helping :]