Log in

View Full Version : ItemExists and Clicking said item



HarryJames
03-02-2011, 08:00 PM
Procedure eat;
var
currentHealth, i: integer;
inv: TInvItem;
Begin
currentHealth := StrToInt(GetInterfaceText(748, 8));
if (currentHealth < Players[0].Integers[5]) then
if(R_ItemExists(Food_To_Eat, inv)) then
begin
writeln('We have FOOD!');
end;
End;

So I have this so far, how do I go about pressing the food that's in the inventory?
As I don't have any coords, I can't used Mouse or Mousebox.

I remember finding something in Inventory.Simba but I can't remember the same. You would use it like this; Inv(3); to get the third inventory spot. I did not know how to use that properly either, though it may be the solution to the problem.

MylesMadness
03-02-2011, 08:01 PM
mouseinv?

HarryJames
03-02-2011, 08:04 PM
Ahh I found it.
R_ClickItem
I've been going through the includes for that past 30 minutes..

Procedure eat;
var
currentHealth, i: integer;
inv: TInvItem;
Begin
currentHealth := StrToInt(GetInterfaceText(748, 8));
if (currentHealth < Players[0].Integers[5]) then
if(R_ItemExists(Food_To_Eat, inv)) then
begin
writeln('We have FOOD!');
R_ClickItem(i, true, 'at')
end;
End;

This doesn't work, what is the problem here?


Edit: I found the problem. I was thinking like I still had the loop there. Thanks!