SRL Archive - SRL Archives

Inventory.scar


Sandstorm

2008-11-09 13:57:55

{*******************************************************************************
Procedure DropAllExcept(A : Array of Integer);
By: Sand Storm
Description: Drops everything except the user defined inventory spaces.
*******************************************************************************}

procedure DropAllExcept(A : Array of Integer);
var
i: Integer;
begin
For I:=1 To 28 Do
if not(InIntArray(a, i)) then
DropItem(i);
end;

Also, I'd like to thank Metagen/Lee Lok Hin for pointing me in the right direction towards InIntArray :P.

Rich

2008-11-09 14:03:44

So say I didn't want to drop 3 and 5, this would be used like
DropAllExcept(3, 5);
?

Sandstorm

2008-11-09 14:04:45

No, like this:


DropAllExcept([3, 5]);

Shuttleu

2008-11-09 14:16:40

simple and easy
could come in quite useful
well done

~shut

Sandstorm

2008-11-09 14:24:32

Thanks. It was simple once I knew InIntArray :P.

HarryJames

2008-11-10 02:59:12

From: Sand Storm
No, like this:


DropAllExcept([3, 5]);



Would this be dropping variables?
like defining 3 and 5 as certain inven slots?

Sandstorm

2008-11-10 08:39:20

Yea.

Grid like this:

1 2 3 4
5 6 7 8
9 10 11 12

Etc.