Originally Posted by
mellower
Sorry for late reply,anyway "Reflect.Inv.IsFull" works just fine when trying to figure, if there's still empty space. So thanks for that. Yet to manage load info of all items in inventory to array, but during later consideration it would only make it more complicate to look up information from there and doesn't bring any value. Tried different commands and for some reason I've problems with loading even a mere array of specific item, be it with find or w/e. Code below gives right away "Error: Don't know which overloaded method to call with params (record [0]Int32; [4]Int32; [8]Int32; [12]Int32; end, Int32, Int32) at line 76" from line "Reflect.Mouse.Move(depositItemBox(number), 3, 3);"
Simba Code:
InventoryContent: TReflectInvItem;
InventoryAll: TReflectInvItemArray;
number: Integer;
rocedure Banking(DepItem: string);
Begin
InventoryAll.Get(DepItem);
if InventoryContent.Find(DepItem) then
begin
number := RandomRange(Low(InventoryAll),High(InventoryAll));
Reflect.Mouse.Move(depositItemBox(number), 3, 3);
if Reflect.Text.IsUpTextMulti(DepItem)then
begin
Reflect.mouse.Click(MOUSE_RIGHT);
Reflect.Text.ChooseOption('Deposit-all');
end;
end;
End;
edit; that won't work
I'm not even sure if this is what you are after, but this is what I do when I have multiple of the same item and I want to deposit from a random inv slot that one of the items is in
Simba Code:
function TReflectionInventory.getAllItemSlots(Item: string): TIntegerArray;
var
I, J: Integer;
Items: TReflectInvItemArray;
Arr: TIntegerArray;
begin
setLength(Arr, 0);
Items.getAll();
for J := 0 to high(Items) do
if (Pos(Item, Items[J].GetName()) > 0) then
for I := 1 to 28 do
begin
if (Items[J].GetInvSlot() = (I)) then
begin
SetLength(Arr, Length(Arr) + 1);
Arr[High(Arr)] := I;
end;
end;
result := Arr;
//writeln('Found ', Item, ' in slot(s) ', Arr);
end;
Simba Code:
var
J: integer;
L: TIntegerArray;
begin
L := Reflect.Inv.GetAllItemSlots('Oak logs');
if (Length(L) < 1) then exit;
J := random(0, Length(L) - 1);
case Length(L) of
(Length(L) = 1): Reflect.Mouse.Move(Reflect.Inv.InvBox(L[0]), mouse_left);
(Length(L) > 1):
begin
Reflect.Mouse.Move(Reflect.Inv.InvBox(L[J]), Mouse_Right);
Reflect.Text.ChooseOption('Deposit-All');
end;
end;
end;