This function moves the mouse to a given TPoint and left-clicks if the tooltip contains the given action string. If the tooltip doesn't contain the action string because another model is overlapping the model you want to click, it will right-click using the rightClickOption procedure. If no tooltip is found it won't click.
Returns true if a click occured, false if not.
Simba Code:
function tMouse.clickAction(funcClickPoint: tPoint; funcAction: string): boolean
var
funcTimeout: tCountDown;
funcTooltip: string;
begin
moveMouse(funcClickPoint.x, funcClickPoint.y);
funcTimeout.setTime(1000);
repeat
funcTooltip := mouse.getTooltip()
until (funcTooltip <> '') or (funcTimeout.isFinished());
if (funcTooltip <> '') then
begin
if (pos(funcAction, funcTooltip) <> 0) then
begin
mouse.click(funcClickPoint);
result := true;
end
else
result := mouse.rightClickOption(funcClickPoint, funcAction);
exit(result);
end;
exit(false);
end;