Awkwardsaw
2010-06-07 16:25:09
i noticed it wasnt in the include, so i scrapped one up :)
{*******************************************************************************
function ClickObjByID(ID, objType, MD, height : Integer; uptext : String; left : Boolean):boolean;
By: Awkwardsaw
Description: Clicks a mainscreen object by using ID
*******************************************************************************}
function ClickObjByID(ID, objType, MD, height : Integer; uptext : String; left : Boolean):boolean;
var
Obj : TRSObject;
tp : TPoint;
x, y, c : Integer;
label
here;
begin
Obj := GetObjectByID(ID, objType, MD);
tp := TileToMS(Obj.Tile, height);
mmouse(tp.x, tp.y, 3, 3);
here:
if R_IsUpText(UpText) then
begin
getmousepos(x, y);
mouse(x, y, 0, 0, left);
result := true;
end else
begin
inc(c);
mmouse(tp.x, tp.y, 0, 0);
if c = 2 then exit;
goto here;
end;
end;