SRL Archive - OSR Help

Deposit all failing


e101y7

2012-12-31 07:33:33

I have the following in myscript

begin
if BankScreen then
begin
Deposit(2,28, false);
end;
end;

and although (it was)banking all, it is now banking one by one. I have force-updated srl but to no avail.
HELP!

Mr[S]

2012-12-31 07:45:12

ask The Killer for help he fixed his deposit all functions

The Killer

2012-12-31 08:42:19

Try replacing deposit with the code below (would give u my bank.simba as an attachment but it exceeds my limit -.-. I Can't test because it's not happening to me but try it and see if it works.
(*
Deposit
~~~~~~~

.. code-block:: pascal

Procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);

Deposits from Slot to ToSlot.
vType True = Deposit All. vType False = Deposit one by one.
Any integer is deposit with Deposit X. (except for 5 and 10)

.. note::

Author: WT-Fakawi/PPLSUQBAWLZ/Stupid3ooo/Town
Last Modified: Unknown

Example:

.. code-block:: pascal

Deposit(1, 28, True);
*)
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);
T := GetSystemTime;
while (not FindColor(x, y, 8388608, MCX1, MCY1, MCX2, MCY2)) and (GetSystemTime - T < 3000) do
Wait(100);
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;

e101y7

2012-12-31 10:45:57

brilliant it works now. Time to get going with my 1 million vials…

l6bustank

2013-01-01 05:12:59

updated mine with The Killer's version and everything works fine now.

Eduard

2013-01-01 10:47:37

It's quite simple. The simple fix is that If(Bankscreen) is to quick.

// Do some things
ClickBank;
Wait(1000);
If(Bankscreen) then…

If you don't use wait it will not see the DepositAll; thus will fail.

The Killer

2013-01-02 14:53:16

From: Eduard
It's quite simple. The simple fix is that If(Bankscreen) is to quick.

// Do some things
ClickBank;
Wait(1000);
If(Bankscreen) then…

If you don't use wait it will not see the DepositAll; thus will fail.

Actually it's because WaitOptionMulti has 'osit' for when the item is singular (doesn't have deposit all option). However what is going wrong is that it's finding 'osit' first and using that. where as we want it to select deposit all:P
to fix this I changed it to
     if not WaitOptionMulti(['Deposit-All', 'All'], 200) then
ChooseOptionMulti(['Deposit' , 'osit']);