SRL Archive - Help

ItemExists and Clicking said item


HarryJames

2011-03-02 15:00:30

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

2011-03-02 15:01:18

mouseinv?

HarryJames

2011-03-02 15:04:22

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!