Simba Code:
Function WaitAmount(Item, Amount, TimeToWait: Integer): Integer;
var
T, Count: integer;
begin
Count:= 0; Result:= 0;
T := (GetSystemTime + TimeToWait);
while (GetSystemTime < t) do
begin
Count:= ItemAmount('inv', 'dtm', Item, []);
if (Count >= Amount) then
begin
Result:= Count;
Break;
end;
Wait(50);
end;
end;
Function WithdrawDTM(Item, HowMany: Integer; ItemUptext: TStringArray): Boolean;
var
X, Y, T, ItemCount: Integer;
begin
if (Not BankScreen) then
Exit;
ItemCount:= ItemAmount('inv', 'dtm', Item, []);
if (WaitFindDTMEx(Item, X, Y, MBX1, MBY1, MBX2, MBY2, 50, 1500)) then
begin
MMouse(X, Y, 5, 5);
if (WaitUptextMulti(ItemUptext, 500)) then
begin
if (HowMany = 1) then
ClickMouse2(MOUSE_LEFT)
else
begin
ClickMouse2(MOUSE_RIGHT);
if WaitOptionMulti(['w-X', 'draw-X'], 600) then
begin
Wait(1000);
if (Not BankScreen) then
exit;
T:= GetSystemTime + 10000;
while (T >= GetSystemTime) and (not (InRange(CountColor(0, 250, 396, 307, 410), 155, 165))) do
Wait(50);
TypeSend(ToStr(HowMany - ItemCount));
end;
end;
end;
end;
Result:= (HowMany >= WaitAmount(Item, HowMany, 1000));
end;
Function BankSoulwars: Boolean;
var
Tries: Integer;
begin
Result := (LoggedIn and BankScreen);
if (Result) then
Exit;
if (Length(Players) > 0) then
if ((PinScreen) and (Players[CurrentPlayer].Pin <> '')) then
InPin(Players[CurrentPlayer].Pin);
while (Not OpenBankChest(SRL_BANK_SW)) do
begin
if (OpenBankChest(SRL_BANK_SW)) then
break;
Inc(Tries);
if (Tries > 5) then
Exit;
end;
if (Length(Players) > 0) then
if ((PinScreen) and (Players[CurrentPlayer].Pin <> '')) then
InPin(Players[CurrentPlayer].Pin);
Result := (BankScreen) or (PinScreen);
end;