The Inventory include contains all inventory-related functions.
Contents
function GetInven(Inven: Integer): TInvenItem;
Returns The Width, Height, Count, ItemBox and CenterPoint of the given Item Slot.
Note
by SKy Scripter
Example:
invItem := GetInven(InvSlot);
MMouse(invItem.centerPoint.x, invItem.centerPoint.y, 2, 2);
function GetInventoryArray : array of TInvenItem;
Returns The Width, Height, Count, ItemBox and CenterPoint in array [0..27] of all Items in the inventory.
Note
by SKy Scripter
Example:
invItems := GetInventoryArray);
for i := 3 to 7 do
MMouse(invItems[i].centerPoint.x, invItems[i].centerPoint.y, 2, 2);
Function InvBox(i :Integer): TBox;
Returns TBox of surrounding Inventory SlotBox 1-2-3-4 5-6-7-8 etc.
Note
by Boreas Last Modified: by Ogre July 15th 2009.
Example:
iBox := InvBox;
MMouse(randomRange(iBox.x1, iBox.x2), randomRange(iBox.y1, iBox.y2), 0, 0);
function ItemCoords(i: Integer): TPoint;
Returns X and Y of Specified Inventory Slot
Note
by RsN
Example:
Coords := itemCoords(3);
MMouse(Coords.x, Coords.y, 2, 2);
function CoordsToItem(X, Y: Integer): Integer;
Returns which Inventory slot the X and Y coords are in. If the coords are between slots (or not in the inventory area at all) it will return 0.
Note
by Boreas and BraK
Example:
Writeln('Item found in slot '+IntToStr(CoordsToItem(point.x, point.y)));
function GetInvItemBounds(InvSpot: Integer; var T: TBox): Boolean;
If item exists, returns TBox of the item, else returns the normal InvBox.
Note
by Wizzup?
Example:
for i := 1 to 7 do
if GetInvItemBounds(i, iBox) then
Writeln('Item found in slot '+IntToStr(i));
function ExistsItem(i: Integer): Boolean;
Checks if item in inventory at specified position exists
Note
by WT-Fakawi
Example:
for i := 1 to 28 do
if ExistsItem(i) then
Inc(Count);
function ExistsItemDTM(dtm: Integer; var x, y: Integer): Boolean;
Checks if the dtm is in the inventory. Returns the item’s coordinates.
Note
by NCDS
Example:
if ExistsItemDTM(OreDTM, x, y) then
MMouse(x, y, 3, 3);
function InvMouse(InvSlot, Action: Byte) : boolean;
A combined MouseItem & MMouseItem, will hopefully replace both procedures one day. Usage is like SRL’s MouseBox, Action determines what to do:
- 1: Leftclick
- 2: Rightclick
- 3: Move mouse to item
Note
by EvilChicken!
Example:
if InvMouse(1, rightClick) then
WaitOption('eposit', 500);
procedure MMouseItem(i: Integer);
Moves mouse to specified inventory spot.
Note
by WT-Fakawi/EvilChicken!
Example:
MMouseItem(1);
procedure MouseItem(i: Byte; Left: Boolean);
Moves Mouse to inv spot then clicks left or right.
Note
by WT-Fakawi/EvilChicken! edit by Naum
Example:
MouseItem(1, true);
procedure DragItem(Inv1, Inv2: Integer);
Drags Item from first position Inv1 to Inv2 (Inventory Slots)
Note
by Naum
Example:
DragItem(1, 3);
function InvCount: Integer;
Returns amount of items in your inventory
Note
by RsN
Example:
totalCount := InvCount;
function InvEmpty: Boolean;
Returns True if inventory is empty
Note
by WT-Fakawi
Example:
if InvEmpty then
CloseBank;
function InvFull: Boolean;
Returns True if inventory is full
Note
by n3ss3s
Example:
if InvFull then
walkToBank;
function CountItems(ItemType: string; Identifier: Integer; tol: TIntegerArray): Integer;
Counts Items in the inventory:
ItemType: ‘dtm’, ‘bitmap’, ‘bitmap mask’, ‘color’
Item: name/value of your dtm/bmp/color/bmpmask.
Tol:
- ‘dtm’ - [] (dtm’s can’t have tolerance).
- ‘bmp’ - [BMPTol].
- ‘color’ - [COLOUR Tol, Colour Count].
- ‘bmpmask’ - [BMPTol, ContourTol].
Note
by WT-Fakawi / Sumilion
Example:
numbOfItems := CountItems('dtm', TheDTM, []);
function ClickAllItemsExcept(ItemType: String; Identifier: Integer; option: string; SlotIgnores: TIntegerArray; waitnum: Integer; tol: TIntegerArray):Integer;
Performs “option” popup menu action on all items with:
ItemType: ‘dtm’, ‘bitmap’, ‘bitmap mask’, ‘color’
Identifier: name/value of your dtm/bmp/color/bmpmask.
Tol:
- ‘dtm’ - [] (dtm’s can’t have tolerance).
- ‘bmp’ - [BMPTol].
- ‘color’ - [COLOUR Tol, Colour Count].
- ‘bmpmask’ - [BMPTol, ContourTol].
Will not click items in slots SlotIgnores
Note
by WT-Fakawi / Sumilion & Nava2
Example:
ClickAllItemsExcept('dtm', theDTM, 'eposit', [1, 4, 5], 200, []);
function ClickAllItems(ItemType: String; Identifier: Integer; option: string; waitnum: Integer; tol: TIntegerArray):Integer;
See ClickAllItemsExcept, this doesn’t ignore any slots.
Note
by WT-Fakawi / Sumilion & Nava2
Example:
ClickAllItemsExcept('dtm', theDTM, 'eposit', 200, []);
procedure DropItem(i: Integer);
Drops item at given position (1-28)
Note
by Lorax
Example:
DropItem(3);
procedure DropArray(InvSlots: TIntegerArray);
Drops item positioned equivalent to numbers in “InvSlots” array. Example: “DropArray([2, 4, 9, 12]);” would drop items in InvSlot 2, 4, 9 and 12.
Note
by Lorax/EvilChicken!, Tickyy for idea.
Example:
DropArray([2, 3, 6]);
procedure DropPattern(Which: Integer);
Drops all items in inventory according to pattern which.
Note
by Rasta Magician
Example:
DropPattern(dp_Snake);
procedure DropAllExcept(IgnoreInvSlots: TIntegerArray);
Drops everything in inventory. Ignores slots specified by DontDrop array.
Note
by Nava2
Example:
DropAllExcept([1, 3, 5, 6]);
procedure DropItemsByIdentifier(ItemType: string; Identifier: Integer; Tol: TIntegerArray);
See description of ClickAllItemsExcept.
Note
by EvilChicken! Fixed by Coh3n
Example:
DropItemsByIdentifier('dtm', tehDTM, []);
procedure ArrangeInv;
Arrange’s inventory in an orderly fashion.
Note
by Cheesehunk
Example:
ArrangeInv;
function CountItemsBlackLine(Count, Tol: Integer): Integer;
Returns the number of items in inventory with Count amount of blackline points and Tol tolerance in the amount of points.
Note
by n3ss3s, fixed by Bobzilla69
Example:
CountItemsBlackLine(260, 2);
function ClickAllItemsBlackLine(Count, Tol: Integer; Option: string): Integer;
Finds all items in inventory with blackline points amount of Count with Tol tolerance, and returns the amount of items could choose the option Option to. Waits the WaitT amount of millisecs between items, with WaitR randomness of milliseconds.
Note
by n3ss3s
Example:
ClickAllItemsBlackLine(260, 2, 'rop');
function ItemActivated(Slot: Integer): Boolean;
Checks if item in specified inventory slot has a white outline. Returns True if the item has a white outline, otherwise returns false.
Note
by marpis
Example:
Result := ItemActivated(4);
function ActivatedItem : integer;
Returns the selected item in invetory (if any), else returns -1.
Note
by mastaraymond
Example:
item := ActivatedItem;