SCAR Code:
{*******************************************************************************
function R_ClickItemID(ID: integer): Boolean;
Description: Clicks an item with the given ID and chooses the given option.
*******************************************************************************}
function R_ClickItemID(ID: integer): Boolean;
var
Inv, x, y, itemID, i: integer;
B: TBox;
begin
Inv := GetInterface(149, 0);
Result := False;
for i := 0 to 27 do
begin
itemID := SmartGetFieldArrayInt(Inv, InventoryItemIDs, i);
if (itemID > 0) and (itemID = ID) then
begin
B := InvBox(i+1);
MouseBox(B.x1, B.y1, B.x2, B.y2, 1);
Wait(50+Random(50));
Break;
end;
end;
SmartFreeObject(Inv);
end;