PDA

View Full Version : Need help with inventory/menu



bevardis
04-29-2015, 10:12 PM
Hello,
1)How could I count item with name X or ID in inv?
2)How could I Choose for example option X or Y in menu, I know one of them is going to show up but I don't know which. (I'm talking about the small menu, the one you get when you click on a tree or whatever)

Thank you :) I'm using Lape reflection and I'd rather not get color involved if there's no real need.

Unfold
04-29-2015, 11:17 PM
1)

I haven't tested this but :

Use

procedure TReflectInvItemArray.Get(Name: string);


You can get an array of items in your inventory with a name. Then you can count the number of items in the array.

2)

function TReflectionChat.NpcChooseOption(Options: TStringArray): Boolean;

bevardis
05-05-2015, 10:23 AM
I can probably post here again, since it is regarding similar stuff:



procedure EatFood;
var
Food,Tablet: TReflectInvItem;
begin
if Food.Find(FoodName) = False then
begin
Writeln('Food not found; Teleporting');
Tablet.Find('Varrock teleport');
Reflect.Mouse.Move(Tablet.GetMSPoint, 2, 2); //Make those human mouse
Reflect.Mouse.Click(Mouse_Left);
Wait(random(4000,15000));
MyPlayer.Logout;
TerminateScript;
end;
if MyPlayer.GetHealth < 40 then
begin
Food.Find(FoodName);
Reflect.Mouse.Move(Food.GetMSPoint, 2, 2);
Reflect.Mouse.Click(Mouse_Left);
end;
end;

Why does it binge eat all my food? It should only eat if < 40 hp. How would I make it do that? It used to work well, but now it just eats all of it at one point (in the beginning it works okay) and I was not there to witness it the both times.
Thank you.

bevardis
05-06-2015, 11:14 AM
Apparently reflection can't read HP after the user is relogged, that was the reason. I just used AeroLib HP function and now it's all good.