Simba Code:
procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);
var
DepositX, BScreen, DScreen: Boolean;
All: Variant;
I, T, x, y: Integer;
B: TBox;
begin
BScreen := BankScreen;
if (not(BScreen)) then
DScreen := DepositScreen;
if not (BScreen or DScreen) then
Exit;
if vType = 2 then
srl_Warn('Deposit', '2 now means store per 2, not ''All''', 15);
DepositX := False;
if VariantIsInteger(vType) then
begin
DepositX := not InIntArray([1, 5, 10], vType);
All := vType <> 1;
end
else if VariantIsBoolean(vType) then
All := vType;
if (SlotFrom = 1) and (SlotTo = 28) and (All = true) then
if DepositAll then
exit;
for I := SlotFrom to SlotTo do
begin
if (BScreen) then
begin
If Not ExistsItem(I) Then
Continue;
if (not All) then
MouseItem(I, mouse_left)
else
MouseItem(I, mouse_right);
end else
begin
B := DepositItemBox(I);
if (not(FindColor(X, Y, srl_outline_black, B.X1, B.Y1, B.X2, B.Y2))) then
Continue;
if (not All) then
Mouse((B.X1 + B.X2) shr 1, (B.Y1 + B.Y2) shr 1, 0, 0, mouse_left)
else
Mouse((B.X1 + B.X2) shr 1, (B.Y1 + B.Y2) shr 1, 0, 0, mouse_right);
end;
if DepositX then
begin
//WaitOptionMulti(['Deposit-X', 'Deposit'], 200);
WaitOptionMulti(['Deposit-X'], 200);
T := GetSystemTime;
//while (not FindColor(x, y, 8388608, MCX1, MCY1, MCX2, MCY2)) and (GetSystemTime - T < 3000) do
while (not FindColor(x, y, 6321792, MCX1, MCY1, MCX2, MCY2)) and (GetSystemTime - T < 3000) do
Wait(100);
Wait(RandomRange(800,1200)); //+line
TypeSend(vType);
end else if VariantIsInteger(vType) then
WaitOptionMulti(['Deposit-' + IntToStr(Integer(vType)), 'Deposit'], 200)
else
if not WaitOptionMulti(['Deposit-All', 'All'], 200) then
ChooseOptionMulti(['Deposit' , 'osit']);
T := GetSystemTime;
Wait(RandomRange(200, 300));
repeat
if (BScreen) then
if (not(ExistsItem(I))) then Break;
if (DScreen) then
if (not(FindColor(X, Y, srl_outline_black, B.X1, B.Y1, B.X2, B.Y2))) then Break;
Wait(50);
until(GetSystemTime - T > 2000);
end;
end;