OK
I've made a script that does all of tutorial island pretty well, except this one stupid door. The problem is, the door stays open or closed depending on if someone has clicked on it or not. I made a tpa function that doesn't return true until it opens the door (if it was closed, it would open it and return true. if it was open, it would close it, return false, open it, then return true.) BUT the tpa would take like 20 minutes to find the door and it even when it right clicked, the chooseoption would return false most of the time when the open and close options were actually there! So does anyone have any idea how i can get through this door so I can end this nightmare and submit my SRL application...
Here's some information that may help...
Door closed:

Door open:

My function
SCAR Code:
function OpenDoor() : boolean;
var
MyTPA : TPointArray;
x,y,i : Integer;
begin
writeln('Looking for door...');
writeln('Trying first color');
FindColorsSpiralTolerance(234,153,MyTPA, 3293259, 0, 20, 500, 270, 10);
if Length(MyTPA) = 0 then
begin
writeln('Trying second color');
FindColorsSpiralTolerance(234,153,MyTPA, 3754069, 0, 20, 500, 270, 10);
if Length(MyTPA)=0 then
begin
writeln('Trying thrid color');
FindColorsSpiralTolerance(234,153,MyTPA, 5532284, 0, 20, 500, 270, 10);
if Length(MyTPA)=0 then
begin
writeln('Trying fourth color');
FindColorsSpiralTolerance(234,153,MyTPA, 2963779, 0, 20, 500, 270, 10);
end;
end;
end;
writeln('Color found!');
for i:= 0 to High(MyTPA)do
begin
MMouse(MyTPA[i].x, MyTPA[i].y,3,3);
if(IsUpTextMultiCustom(['Church']))then
begin
GetMousePos(x,y);
Mouse(x,y,3,3,False);
wait(1000+random(300));
if (chooseOption('Close Church door'))then
begin
writeln('The door is open and I closed it');
Result := False;
Exit;
end
else
begin
if (chooseOption('Open Church door')) then
begin
writeln('The door is closed and i opened it');
Result := True;
Exit;
end
else
begin
writeln('Cant find Open or close, trying again...');
end;
end;
end
else
begin
writeln('bad point');
Wait(350+random(350));
end;
end;
end;
And my call to the function:
SCAR Code:
while not (OpenDoor) do
begin
writeln('Trying again...');
end;
PLEASE help! I am very willing to abandon this function and try something else...