Function:
SCAR Code:
function WithdrawDTM(DTM1: integer; var Index:integer; Amount: integer; UpText: TStringArray): boolean;
var
x1, y1: integer;
BankBox: TBox;
Found: boolean;
label
Start;
begin
if (Index = 0) then
begin
Start:
for Index := 1 to 50 do
begin
BankBox := BankIndexToMSBox(Index);
if FindDTM(DTM1, x1, y1, BankBox.x1 , BankBox.y1, BankBox.x2, BankBox.y2) then
begin
MMouse(x1, y1, 4, 4);
Wait(50+random(15));
if IsUpTextMultiCustom(UpText) then
begin
Writeln('Found Item at Bank Slot ' + IntToStr(Index));
Found := true;
break;
end else
Writeln('Found Item, Incorrect UpText, moving.');
end;
end;
end else
begin
BankBox := BankIndexToMSBox(Index);
if FindDTM(DTM1, x1, y1, BankBox.x1, BankBox.y1, BankBox.x2, BankBox.y2) then
begin
MMouse(x1, y1, 4, 4);
Wait(50+random(15));
if IsUpTextMultiCustom(UpText) then
begin
Writeln('Found Item at Bank Slot ' + IntToStr(Index));
Found := true;
end;
end else
begin
Writeln('DTM Moved, checking bank again.');
GoTo Start;
end;
end;
Wait(200+random(150));
if Found then
begin
x := x1; y := y1;
Mouse(x1, y1, 0, 0, false);
Wait(200+random(200));
if (Amount = 5) or (Amount = 10) then
ChooseOption('Withdraw-' +IntToStr(Amount))
else if Amount = 0 then
ChooseOption('Withdraw-All')
else
if not(ChooseOption('Withdraw-' + IntToStr(Amount))) then
begin
ChooseOption('Withdraw-X');
Wait(1000 + Random(100));
TypeSend(IntToStr(Amount));
end;
Result := true;
end else
begin
Index := 0;
Writeln('Could not Find DTM in Bank.');
end;
end;
Error:
Seems like the uptext fails, as it doesn't find it. It moves the mouse to the dtm, but when the check is preformed it comes back false, when, at times, it is true!
Thanks,
Nava2