SRL Archive - SRL Suggestions

Fixed - WithdrawFromPouch Function


Sir Ducksworthy

2012-04-15 09:00:23

The Count Color wasn't working on it and I've improved the function a fair bit.

(*
WithdrawFromPouch
~~~~~~~~~~~~~~~~~

.. code-block:: pascal

function WithdrawFromPouch(Amount :Integer) :Boolean;

Withdraws amount from pouch.

.. note ::

by Home and Modified by Leetsxc

*)
function WithdrawFromPouch(Amount :Integer) :Boolean;
var
T :Integer;
begin
Result := False;
T := GetSystemTime + 15000+random(5000);
MouseBox(528, 94, 533, 107, mouse_Right);
while (WaitOption('draw', 300+random(200))=false) and (T > GetSystemTime) do
MouseBox(528, 94, 533, 107, mouse_Right);
if(T > GetSystemTime)then
begin
repeat
wait(50);
InPin(Players[CurrentPlayer].Pin);
until ((T <= GetSystemTime) or (CountColor(0, 107, 385, 410, 414) > 200));
Wait(RandomRange(275, 800));
TypeSend(IntToStr(Amount));
Result := True;
end;
end;