Here's an example of a simple case:
Where Gate is a TPoint, and 1234 is the items ID, if you don't know how to get the items ID, you can go here.That is a Ref Debugger which is very useful for getting item IDs.
Just a tip, you should use FindObjectEx instead of FindObject, it's much much faster, and not hard to understand.
Here's a function I use in one of my scripts:
SCAR Code:
function Dray_ClimbStile: Boolean;
var
Stile : TPoint;
begin
if not LoggedIn then Exit;
MakeCompass('N');
if FindObjectEx(Stile, 7527, 10) then
begin
Writeln('Found stile, attempting to climb...');
Stile := TileToMS(Stile, Random(5));
MMouse(Stile.x, Stile.y - 20, 4, 4);
Result := R_ClickMouseOption(Stile.x, Stile.y - 20, 0, 0, 'random', ['tile', 'limb-over'], ['limb-over']);
if not Result then
Writeln('Couldn''t climb over stile.');
end else Exit;
end;
The "10" is how many tiles you want it to look in, so basically it should be as big as the item you are trying to find.
I hope I helped, if you have any questions, don't hesitate to ask.