SRL Archive - SRL Archives

DropAllEx ~ Inventory.scar


Tickyy

2009-07-01 11:02:52


{*******************************************************************************
procedure DropAllEx;
By: Tickyy
Description: Drops all the items from the first given position, till to the second given position
*******************************************************************************}
procedure DropAllEx(z_from, z_to: integer);
var
i : Integer;
begin
for i := z_from to z_to do
DropItem(i);
end;

Like it?

ian.

2009-07-01 11:09:48

I think DropItemEx would be better :p

Tickyy

2009-07-01 11:11:43

From: 99_ aka ian.
I think DropItemEx would be better :p


The name doesn't matter that much, but whatever…. developers can make any changes later. :)

Da 0wner

2009-07-01 12:06:59

No I don't like it >.>.

Tickyy

2009-07-01 12:27:24

From: Da 0wner
No I don't like it >.>.


haha, i love you too :p!

ZephyrsFury

2009-07-01 12:57:50

I swear there was something like this in SRL before…

Simtoon

2009-07-01 15:16:10

mine drops if the uptext



procedure DropStuff(textup : string);
var
i, NSPosC, SPos: Integer;
TB: TBox;
begin

if not LoggedIn then
LoginPlayer;
if (SPos < 1) then
begin
for i := 1 to 28 do
begin
TB := InvBox(i);
MMouse(RandomRange(TB.X1 + 4, TB.X2 - 4), RandomRange(TB.Y1 + 4,
TB.Y2 - 4), 3, 3);
if (Uppercase(GetUpText) = ((textup))) then
DropItem(i)
else
begin
NSPosC := NSPosC + 1;
Continue;
end;
end;
end
else
begin
for i := SPos to 28 do
begin
TB := InvBox(i);
MMouse(RandomRange(TB.X1 + 4, TB.X2 - 4), RandomRange(TB.Y1 + 4,
TB.Y2 - 4), 3, 3);
if (Uppercase(GetUpText) = ((textup))) then
DropItem(i)
else
begin
NSPosC := NSPosC + 1;
Continue;
end;
end;
end;
if (NSPosC > 0) then
begin
ArrangeInv;
SPos := SPos + NSPosC;
end;
end;

EvilChicken!

2009-07-01 15:29:22

From: ZephyrsFury
I swear there was something like this in SRL before…


+1, but I've got a feeling we're confusing this with something else.
Anyway, I'll add it briefly.

Thanks for the idea, Tickyy.

Edit: committed.
And, Da 0wner, the proc I committed already does that. Sort of.

Da 0wner

2009-07-01 15:41:35

{*******************************************************************************
procedure DropItemsSkipEx;
By: Tickyy and Da 0wner
Description: Drops all the items from the first given position, till to the second given position. Skips all slots in Skip TIntegerArray.
*******************************************************************************}
procedure DropItemsSkipEx(z_from, z_to: integer; Skip : TIntegerArray);
var
i : Integer;
begin
for i := z_from to z_to do
if not InIntArray(i, Skip) then
DropItem(i);
end;

Also commit that one EvilChicken.

NCDS

2009-07-01 15:50:57

Isn't that just the old DepositAll from SRL?

Even so, seems kind of like a down graded version of this:

{*******************************************************************************
Procedure Deposit(SlotFrom, SlotTo: Integer; vType: Variant);
by: WT-Fakawi/PPLSUQBAWLZ/Stupid3ooo/Town
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
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 := 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, 65536, 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
ChooseOption('Deposit-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('Deposit-' + vType)
Else
ChooseOption('Deposit-All');
T := GetSystemTime;
Wait(RandomRange(200, 300));
repeat
if (BScreen) then
if (not(ExistsItem(I))) then Break;
if (DScreen) then
if (not(FindColor(X, Y, 65536, B.X1, B.Y1, B.X2, B.Y2))) then Break;
Wait(50);
until(GetSystemTime - T > 2000);
End;
End;
Since they both do the same thing…

Tickyy

2009-07-01 19:39:53

First of all, i wanna thank you all for your nice comments (if there was any:rolleyes:).

Second, i just needed something like this and made it up pretty fast, i've been searching for it and haven't found anything.

EvilChicken!

2009-07-01 20:01:08

From: Tickyy
First of all, i wanna thank you all for your nice comments (if there was any:rolleyes:).

Second, i just needed something like this and made it up pretty fast, i've been searching for it and haven't found anything.


That you stole it was absolutely not what I meant, and I believe that applies to every poster in this thread posting somewhat the same as me.

It simply confused me that something like this wasn't in SRL although I was certain seeing it being there some time ago.

Tickyy

2009-07-01 20:06:07

From: EvilChicken!
That you stole it was absolutely not what I meant, and I believe that applies to every poster in this thread posting somewhat the same as me.

It simply confused me that something like this wasn't in SRL although I was certain seeing it being there some time ago.


k thanks, i hope you liked it :p, its pretty short, but very useful. :)

noidea

2009-07-01 20:13:33

Yea. Last night on the IRC I looked for the DropAll Function in SRL, and when I found it, it looked very different from the last time I saw it. I especially noticed that it was by Lorax, instead of one of the current devs.