Results 1 to 2 of 2

Thread: better chooseoption

  1. #1
    Join Date
    Feb 2007
    Posts
    149
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default better chooseoption

    im trying to put together a chooseoption modification that only looks above the 'Examine' part, but its not working:
    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?

    "Impressive" - Star

  2. #2
    Join Date
    Oct 2006
    Location
    Ireland
    Posts
    855
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    edit: nvm lol. I was being dumb.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Chooseoption help
    By Brianb in forum OSR Help
    Replies: 37
    Last Post: 08-27-2008, 07:30 PM
  2. ChooseOption
    By Harry in forum OSR Help
    Replies: 12
    Last Post: 03-03-2008, 04:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •