SRL Archive - SRL Bugs

Deposit()


Shatterhand

2013-01-07 09:42:24

The function is:
(*
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);
*)
The problem was: I want to deposit the first 8 items, but beacause they are the same kind, I want to do it with deposit-x=8.
Deposit(1,8,8)
And it didnt work, it deposited them 1 by 1 plus spamming '8' in the chat 8 times.

Here is my repaired version. Maybe its not the best but it works. :)
The color is the horizontal line's color above the username.
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;

Shatterhand

2013-02-04 13:58:08

Bump! :D

Turpinator

2013-02-04 19:15:23

Deposit(1,8,True)
Should try and deposit all of item 1, then all of item 2, then 3… until out of items.

digitalninja

2013-02-05 01:46:30

I tried this with a deposit box and it didnt work … is there a different code for deposit chests vs banks?

Chris!

2013-02-05 02:08:54

From: digitalninja
I tried this with a deposit box and it didnt work … is there a different code for deposit chests vs banks?


Well, does your script actually open the deposit box? It should work (if the snippet works) if the deposit box is opened and it can see the screen, aslong as the deposit all and whatever other buttons there are.

Shatterhand

2013-02-06 17:01:36

From: Turpinator
Deposit(1,8,True)
Should try and deposit all of item 1, then all of item 2, then 3… until out of items.

I want it to click on the first slot and choose deposit-8. So it has to click on deposit-x and type 8.
Type True = Deposit All. vType False = Deposit one by one.
Any integer is deposit with Deposit X. (except for 5 and 10)
This is I have to use Deposit(1,8,8).

Turpinator

2013-02-06 21:05:37

If you want it to deposit slots 1-8 of the same item using deposit-8, then
deposit(1,1,8)
should do exactly that.
maybe it doesnt, but i assume it will do this.