P1ng
2012-08-27 11:45:59
So I want to search through my inventory and whenever I find an item I want to move the mouse to it and check it's uptext.
Then with that uptext I want to remove the excess bits and pieces like "Fill" and "/ 5 more options" and then just return "Medium pouch" as the result.
Not sure if this is do-able, I have looked through the text include and didn't see anything I thought would help my cause.
Here is the function, it currently finds the objects in the inventory then gets the uptext appropriately, just doesn't remove all the extra little bits as I'd like it to.
Then with that uptext I want to remove the excess bits and pieces like "Fill" and "/ 5 more options" and then just return "Medium pouch" as the result.
Not sure if this is do-able, I have looked through the text include and didn't see anything I thought would help my cause.
Here is the function, it currently finds the objects in the inventory then gets the uptext appropriately, just doesn't remove all the extra little bits as I'd like it to.
function ObjectDetect: String;
var
i: Integer;
TmpBox: TBox;
BlackTPA: TPointArray;
begin
for i := 1 to 28 do
begin
TmpBox := InvBox(i);
if FindColors(BlackTPA, 131072, TmpBox.x1, TmpBox.y1, TmpBox.x2, TmpBox.y2) then
begin
InvMouse(i, mouse_Move);
Wait(RandomRange(400,500));
Result := GetUpText;
WriteLn(Result);
end;
end;
end;