Amichie
09-07-2014, 02:46 PM
Main loop:
result := findPapaya();
writeLn(result);
findPapaya:
function findPapaya(): boolean;
var
x, y: integer;
begin
if mainscreen.findObject(x, y, 2341762, 15, ['Take Papaya fruit'], MOUSE_MOVE) then
begin
Result := true;
writeLn('We found a papaya!');
writeLn(Result);
end else
writeLn('Failed to find another papaya.');
Result := false;
end;
The problem is: inside the findPapaya function Result is TRUE, but in the main loop the writeLn writes FALSE in the debug box.
result := findPapaya();
writeLn(result);
findPapaya:
function findPapaya(): boolean;
var
x, y: integer;
begin
if mainscreen.findObject(x, y, 2341762, 15, ['Take Papaya fruit'], MOUSE_MOVE) then
begin
Result := true;
writeLn('We found a papaya!');
writeLn(Result);
end else
writeLn('Failed to find another papaya.');
Result := false;
end;
The problem is: inside the findPapaya function Result is TRUE, but in the main loop the writeLn writes FALSE in the debug box.