Rune Pro: Sorry my bad use this:
Function HandleGate: boolean;
var
G:TPoint;
begin
G:=Point(3032, 3313);
if not(loggedin) then exit;
MyRandoms;
if FindObjectEx(G, 7050, 5) then
begin
Writeln('Attempting to handle gate.');
if (GetMyPos.x = 3031) then
begin
if FindColorSpiralTolerance(x, y, 5401208, 257, 183, 281, 237, 4) then
begin
MMouse(x, y, 2, 2);
wait(100+Random(75));
if IsUpText('pen') then
begin
Mouse(x, y, 0, 0, false);
wait(100+Random(75));
if FindText(x, y, 'pen', UpChars, x, y, x + 100, y + 100) then
Mouse(x, y, 0, 0, True);
Writeln('Successfully opened gate. =D');
GatesOpened:=GatesOpened+1;
end else
begin
Writeln('Failed to find gate.');
LogOut;
TerminateScript;
end;
end else
begin
Writeln('Failed to find gate.');
LogOut;
TerminateScript;
end;
end else
begin
if FindColorSpiralTolerance(x, y, 5401208, 208, 119, 225, 225, 4) then
begin
MMouse(x, y, 2, 2);
wait(100+Random(75));
if IsUpText('pen') Then
begin
Mouse(x, y, 0, 0, false);
wait(100+Random(75));
if FindText(x, y, 'pen', UpChars, x, y, x + 100, y + 100) then
Mouse(x, y, 0, 0, True);
Writeln('Successfully opened gate. =D');
GatesOpened:=GatesOpened+1;
end else
begin
Writeln('Failed to find gate.');
LogOut;
TerminateScript;
end;
end else
begin
Writeln('Failed to find gate.');
LogOut;
TerminateScript;
end;
end;
end else Writeln('Gate already open, walking in the cow pen now.');
end;
That should work :)