I would just use a mouse over function so you don't have to "search" for a DTM or bitmap etc.
If ItemExists(i) then
MMouseItem(i);
Check up text - WaitUpText
equip if its correct - mouse / chooseoption
Example:
SCAR Code:
function Equip(Items: TStringArray):boolean;
var
i,x,y:integer;
begin
GameTab(tab_Inv);
for i := 1 to 28 do
if ExistsItem(i) then
begin
MMouseItem(i);
GetMousePos(x, y);
if WaitUpTextMulti(Items, 400) then
begin
Mouse(x,y,0,0,false);
wait(50+random(50));
if ChooseOption('eild') then
begin
wait(350+random(150));
Result := true;
Exit;
end;
end;
end;
end;
So instead of food you look for the items you want and just use a TStringArray for the UpText. You could even make it interchangeable so you can equip items at various stages. The way its setup it exits after it equips one but you can easily change it to do as you need.
Note: the code is just an example, names aren't perfect