SRL Archive - SRL Archives

Deposit need cases?


Naum

2008-03-16 06:07:16

Since i'm a
 case 
freak i thought that the function Deposit could use some cases.
Just an idea

{*******************************************************************************
procedure Deposit(slot, toslot, thetype: Integer);
by: WT-Fakawi/PPLSUQBAWLZ/Stupid3ooo/Town
Description: Deposits from Slot to ToSlot.
Type 2 = All, Type 1 = one-by-one.
*******************************************************************************}

procedure Deposit(Slot, ToSlot, TheType: Integer);
var
i,n: Integer;
begin
if (BankScreen) then
begin
for i:= Slot to ToSlot do
begin
if ExistsItem(i) then
begin
Case TheType of
1:begin
MouseItem(I, True);
Wait(50+random(50));
end;
2:begin
n:=0;
MouseItem(I, False);
if (ChooseOption('All')) then
begin
Wait(100+random(100));
repeat
n:=n+1;
Wait(40);
if not ExistsItem(i) then
break;
until n>50;
end;
end;
end;
end;
end;
end;

Santa_Clause

2008-03-16 06:29:40

procedure Deposit(Slot, ToSlot, TheType: Integer);
var
i,n: Integer;
begin
if (BankScreen) then
for i:= Slot to ToSlot do
if ExistsItem(i) then
case TheType of

1 : begin
MouseItem(I, True);
Wait(50+random(50));
end;

2 : begin
n:=0;
MouseItem(I, False);
if (ChooseOption('All')) then
begin
Wait(100+random(100));
while N > 50 do
begin
Inc(N);
Wait(40);
if not ExistsItem(i) then
break;
end;
end;
end;
end;
end;

Just had to do that…

n3ss3s

2008-03-16 06:42:00


procedure Deposit(Slot, ToSlot, TheType: Integer);
var
i,n: Integer;
begin
if (BankScreen) then
for i:= Slot to ToSlot do
if ExistsItem(i) then
case TheType of

1 : begin
MouseItem(I, True);
Wait(50+random(50));
end;

2 : begin
MouseItem(I, False);
if (ChooseOption('All')) then
begin
Wait(100+random(100));
For N := 0 To 49 Do
if not ExistsItem(i) then
break
else
Wait(40);
end;
end;
end;
end;
end;

Just had to do that…

Naum

2008-03-16 08:55:25

lolz. Ty dudes!

nielsie95

2008-03-19 07:24:21

The developers have already designed a new Deposit using variants :)

Wizzup?

2008-03-19 07:41:24

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

Var
DepositX: Boolean;
All: Variant;
I, T, x, y: Integer;

Begin
If Not BankScreen Then
Exit;
DepositX := False;
Case VarType(vType) Of
3: Begin
DepositX := Not InIntArray([1, 5, 10], vType);
If vType = 1 Then
All := False
Else
All := True;
End;
11: All := vType;
End;
For I := 1 To 28 Do
Begin
If Not ExistsItem(I) Then
Continue;
MouseItem(I, Not All);
If DepositX Then
Begin
ChooseOption('Store X');
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) = 3 Then
ChooseOption('Store ' + vType)
Else
ChooseOption('Store All');
T := GetSystemTime;
While ExistsItem(I) And (GetSystemTime - T < 2000) Do
Wait(50);
End;
End;