Simba Code:
(*
WithdrawEx
~~~~~~~~~~
.. code-block:: pascal
function WithdrawEx(Col, Row, Amount: Integer; Uptexts: TStringArray): Boolean;
Withdraws Amount at Column/Row.
.. note::
Author: Starblaster100, Town, Wizzup? and Narcle, small fixes by r!ch!e & EvilChicken!
Last Modified: Unknown
Example:
.. code-block:: pascal
WithdrawEx(1, 3, 28, ['ron ore', 'ore', 'on or']);
*)
function WithdrawEx(Col, Row, Amount: Integer; Uptexts: TStringArray): Boolean;
var
BBox: TBox;
X, Y, T: Integer;
begin
Result := False;
FixBank;
BBox := BankIndexToMSBox(BankPointToBankIndex(Point(Col, Row)));
T := GetSystemTime + 500;
while not FindColor(x, y, srl_outline_black, BBox.X1, BBox.Y1, BBox.X2, BBox.Y2) and (GetSystemTime < T) do
Wait(20 + Random(10));
if not FindColor(x, y, srl_outline_black, BBox.X1, BBox.Y1, BBox.X2, BBox.Y2) then Exit;
GetMousePos(X, Y);
if (not PointInBox(Point(X, Y), BBox)) then
MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, mouse_move);
if (Length(Uptexts) > 0) then
if (not WaitUptextMulti(Uptexts, 500)) then
Exit;
if (Amount = 1) then
ClickMouse2(mouse_left)
else
ClickMouse2(mouse_right);
if (Amount = 1) then
begin
Result := True;
Wait(RandomRange(250, 550));
Exit;
end;
if (Amount = -1) then
Result := WaitOptionMulti(['Withdraw-All but', 'l b'], 300)
if (Amount = 0) then
Result := WaitOptionMulti(['Withdraw-All', 'w-A'], 300)
else
Result := WaitOptionMulti(['Withdraw-' + IntToStr(Amount), 'w-' + IntToStr(Amount)] , 300);
if (not (Result)) and (Amount > 0) then
begin
MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, mouse_right);
if WaitOptionMulti(['Withdraw-X', 'w-X'], 500) then
begin
X := GetSystemTime + 10000;
while (X >= GetSystemTime) and (not (InRange(CountColor(0, 250, 396, 307, 410), 155, 165))) do
Wait(50);
Wait(RandomRange(75, 400));
TypeSend(IntToStr(Amount));
Result := True;
end;
end;
end;
It's really messy, but you get my idea?