SCAR Code:
function GChooseOption(x, y: Integer; txt: string): Boolean;
var
x1, y1, x2, y2, maxexaminey, LeftCorner, RightCorner: Integer;
begin
LeftCorner := BitmapFromString(4, 4, 'z78DA33753135313137C5' +
'411A600064715CEA914500CACE13F0');
RightCorner := BitmapFromString(4, 4, 'z78DA33753135313137' +
'C5200D30002E35F8C501C9C013F0');
if (FindBitmap(LeftCorner, x1, y1)) and (FindBitmap(RightCorner, x2, y2)) then
begin
maxexaminey := y2;
if (FindText(x, y, 'xamine', upchars, x1, y1, x2, maxexaminey)) then// NEW PART START
begin
repeat
maxexaminey := maxexaminey - 1; // finds highest examine so knows to look above only
Writeln('Found object examine option, so set maximum y to ' + IntToStr(maxexaminey) + '...');
until not FindText(x, y, 'xamine', upchars, x1, y1, x2, maxexaminey)
end else
begin
Writeln('Could not find examine option from (' + IntToStr(x1) + ', ' + IntToStr(y1) + ') to (' + IntToStr(x2) + ', ' + IntToStr(MaxExamineY) + ')...');
Result := False;
Exit;
end;// NEW PART END
if (FindText(x, y, txt, upchars, x1, y1, x2, maxexaminey)) then
begin
Result := True;
Mouse((x + (x2-x1)) div 2, y + 3, (x2-x1) div 2, 2, True); // new mouse
//Mouse(x + Length(txt) * 3, y + 3, Length(txt) * 3, 2, True); old mouse
end
else if (FindText(x, y, 'ancel', upchars, x1, y1, x2, 502)) then
Mouse(x + 9, y + 3, 2, 2, True);
end;
FreeBitmap(LeftCorner);
FreeBitmap(RightCorner);
end;
im clued out as to why it doesnt work. maybe one of you know?