PDA

View Full Version : Grounditems broken?



kingarabian
03-04-2017, 05:08 AM
Can't get it to work no matter what. Does not return the proper ground item Id's or names. Gets the coords right though.

Procedure pickupItem;
var
i : integer;
_items : TReflectGroundItemArray;
ItemsToPickup : TStringArray;
begin
ItemsToPickup := ['Lobster'];
_items.GetAll(20);
for I := 0 to High(_items) do
begin
writeln('Found item ' + _items[I].getName);
if IsArrInStr(ItemsToPickup, _items[I].GetName) then
begin
Reflect.Mouse.Move(_items[I].GetMSPoint, 3, 3);
Reflect.Mouse.Click(Mouse_Right);
Reflect.Text.ChooseOption(_items[I].GetName);
end;
end;
end;



For some reason no matter the items on the ground it will always return Toolkit.



Found item Toolkit
Found item Toolkit
Found item Toolkit
Found item Toolkit

deejaay
03-04-2017, 12:27 PM
What happens when you put the writeln after you check if the drop is in the pile?



Procedure pickupItem;
var
i : integer;
_items : TReflectGroundItemArray;
ItemsToPickup : TStringArray;
begin
ItemsToPickup := ['Lobster'];
_items.GetAll(20);
for I := 0 to High(_items) do
begin
if IsArrInStr(ItemsToPickup, _items[I].GetName) then
begin
writeln('Found item ' + _items[I].getName);
Reflect.Mouse.Move(_items[I].GetMSPoint, 3, 3);
Reflect.Mouse.Click(Mouse_Right);
Reflect.Text.ChooseOption(_items[I].GetName);
end;
end;
end;


Any different?

Kyle
03-04-2017, 02:45 PM
...

Fixed :)

kingarabian
03-04-2017, 07:11 PM
Fixed :)

Thank you!