SRL Archive - SRL Suggestions

Bank.scar WithdrawEx


Rick

2010-08-05 20:40:45

When WithdrawEx is used in conjunction with WithdrawItemEx the mouse will hover the IdentType (BMP, DTM, Mask, Colour) to check for the correct UpText, then move the mouse again to withdraw Amount.

Nothing big, but I'm sure most of you don't consistently hover your item then move the mouse again to withdraw it.

WithdrawEx:


BBox := BankIndexToMSBox(BankPointToBankIndex(Point(Col, Row)));
MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 3);

becomes:


var
BBox: TBox;
x, y: Integer;

...

BBox := BankIndexToMSBox(BankPointToBankIndex(Point(Col, Row)));
GetMousePos(x, y);
if not InRange(x, BBox.X1, BBox.X2) and not InRange(y, BBox.Y1, BBox.Y2) then
MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 3);

Heavenguard

2010-08-07 13:33:41

Thanks for suggesting that. I just tested the old function as well as the fixed function. The fixed one works the way its supposed to (with no extra mouse movements after checking the uptext). Please commit lol =]

EvilChicken!

2010-08-07 21:53:35

I obviously forgot to commit this .. :confused:
Anyway, added and additionally fixed and streamlined the function a bit.
Thanks!

This is the version I committed:
{*******************************************************************************
function WithdrawEx(col, row, Amount: Integer; Uptexts: TStringArray): Boolean;
By: Starblaster100, Town, Wizzup? and Narcle, small fixes by r!ch!e & EvilChicken!
Description: Withdraws Amount at Column/Row.
*******************************************************************************}
function WithdrawEx(Col, Row, Amount: Integer; Uptexts: TStringArray): Boolean;
var
BBox: TBox;
X, Y: Integer;
begin
Result := False;
FixBank;
FixBankTab;

BBox := BankIndexToMSBox(BankPointToBankIndex(Point(Col, Row)));
GetMousePos(X, Y);
if (not PointInBox(Point(X, Y), BBox)) then
MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 3);

if (Length(Uptexts) > 0) then
if (not WaitUptextMulti(Uptexts, 500)) then
Exit;

ClickMouse2(Amount = 1);
if (Amount = 1) then
begin
Result := True;
Wait(RandomRange(250, 550));
Exit;
end;

case (Amount) of
0: Result := WaitOptionMulti(['Withdraw-All', 'w-A'], 300);
5, 10: Result := WaitOptionMulti(['Withdraw-' + IntToStr(Amount), 'w-' + IntToStr(Amount)] , 300);
else
Result := WaitOptionMulti(['Withdraw-X', 'w-X'], 300);
end;

if (Result) and (not InIntArray([0, 1, 5, 10], Amount)) then
begin
Wait(RandomRange(500, 1250));
TypeSend(IntToStr(Amount));
end;
end;

Rep+'d for your recent contribution, R!ch!e.

Heavenguard

2010-08-07 22:08:23

Thanks for committing EC =]

Rick

2010-08-07 22:25:50

Thanks :)

To be honest it seemed very botlike without the fix :/