SRL Archive - Help

Detection of inventory items


RAndomGuru

2012-01-04 02:55:45

When banking, is there a method which would allow the script to detect whether or not an inventory item is in the inventory.

For example, if I were to keep an item in the inven as a failsafe, and then use it, would i be able to withdraw another of this item from my bank?

wantonman

2012-01-04 03:10:25

srl is not a robot, its a book.




{*******************************************************************************
function ExistsItem(i: Integer): Boolean;
By: WT-Fakawi
Description: Checks if item in inventory at specified position exists
*******************************************************************************}
function ExistsItem(I: Integer): Boolean;
var
X, Y: Integer;
TB: TBox;
begin
GameTab(tab_Inv);
TB := InvBox(I);
Result := FindColor(x, y, srl_outline_black, TB.x1, TB.y1, TB.x2, TB.y2);
end;

{*******************************************************************************
function ExistsItemDTM(dtm: Integer; var x, y: Integer): Boolean;
By: NCDS
Description: Checks if the item with dtm is in the inventory. Returns the item's
coordinates.
*******************************************************************************}
function ExistsItemDTM(dtm: Integer; var x, y: Integer): Boolean;
begin
Gametab(tab_Inv);
Wait(300 + Random(300));
Result := FindDTM(dtm, x, y, MIx1, MIy1, MIx2, MIy2);
end;