SRL Archive - SRL Bugs

Deposit


Tickyy

2011-12-04 08:08:41

While i was working on my superheater, i found something!

I might be wrong, or a developer just missed it or something, but if you use Deposit(2, 28, True); then it won't deposit the iron ore like in this image:


Though, its supposed to deposit Everything from slot 2 to slot 28!

{*******************************************************************************
Procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);
by: WT-Fakawi/PPLSUQBAWLZ/Stupid3ooo/Town small fix by Tickyy
Description: 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)
*******************************************************************************}
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;
case VarType(vType) of
varInteger: begin
DepositX := not InIntArray([1, 5, 10], vType);
if vType = 1 then
All := False
else
All := True;
end;
varBoolean: All := vType;
end;
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;
MouseItem(I, not All);
end else
begin
B := DepositItemBox(I);
if (not(FindColor(X, Y, srl_outline_black, B.X1, B.Y1, B.X2, B.Y2))) then
Continue;
Mouse((B.X1 + B.X2) shr 1, (B.Y1 + B.Y2) shr 1, 0, 0, not All);
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 VarType(vType) = varInteger then
WaitOptionMulti(['Deposit-' + inttostr(vType), 'Deposit'], 200)
else
WaitOptionMulti(['Deposit-All', 'All', 'Deposit'], 200);
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;

This will also deposit one single items on the inventory :D!

Mark

2011-12-04 08:26:51

I knew it wasn't something todo with my script also thanks tickyy

Dgby714

2011-12-04 08:27:17

Posting so Tickyy can see my sig…

I would say something ontopic if I read the script but I don't want to atm soo…

[INSERT ON-TOPIC SECTION HERE]

Sir R. M8gic1an

2011-12-04 11:23:21

DIff?

~RM

Tickyy

2011-12-04 12:15:33

From: Sir R. M8gic1an
DIff?

~RM


You probably mean what's the difference between them… ?

Old one:
WaitOptionMulti(['Deposit-All', 'All'], 200);

New one:
WaitOptionMulti(['Deposit-All', 'All', 'Deposit'], 200);

Narcle

2011-12-04 13:09:29

Committed.