Code:
Function OpenDoor :boolean;
var Door: TReflectObject;
begin
if Door.Find(objGame, 'Open Door', 15) then begin
Reflect.Mouse.Move(Door.GetMSPoint, 2, 2);
fastClick(Mouse_Left);
end;
end;
Something like this doesn't work? it doesn't.
I will see if i can get something to function, can you explain what circumstance this is in? or just a general fail safe?
In the mean time you could use
Code:
R_InteractTile(Point(X, Y), 'Open Door', 3, 3, 3)
This is not desirable; But it moves the mouse over the coords if the uptext is correct it will interact; so you will need to make and end else statement. (but as stated this isn't the most desirable way)
You will also need some extra functions for that function.
Code:
function R_TileOnMS(Tile : TPoint; var OutputPoint : TPoint; x : integer = 0; y : integer = 0; z : integer = 0):boolean;
var tempB : TBox;
begin
OutputPoint := TReflectionTiles.TileToMS(Tile, x, y, z);
tempB := intToBox(MSX1, MSY1, MSX2, MSY2);
result := PointInBox(OutputPoint, tempB);
end;
procedure randomMouseInput(pnt:Tpoint; ranx, rany:integer);
begin
case random(3) of
0:humanMMouse(pnt, ranx, rany);
1:missMouse(pnt, ranx, rany);
2:mouse(pnt, ranx, rany, mouse_move);
end;
end;
function R_InteractTile(tile:Tpoint; action:string; x:integer = 0; y:integer = 0; z:integer = 0):boolean;
var RSTile : TPoint;
begin
if R_TileOnMS(Tile, RSTile, x, y, z) then begin
randomMouseInput(rsTile, 3, 3);
if(Reflect.Text.IsUpText(action)) then begin
FastClick(mouse_left);
result := didClick(true, 1000);
end else begin
if TReflectionText.OptionExists(action) then begin
FastClick(mouse_right);
result := Reflect.Text.ChooseOption(action);
end;
if not result then
randomMouseInput(Point(MSCX, MSCY), 500, 500);
end;
end;
end;