Results 1 to 4 of 4

Thread: how to read text

  1. #1
    Join Date
    Jan 2007
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default how to read text

    I need a way to read text (the game I use it for isn't runescape) , it needs to be able to read size 10, bold verdana (baltic) text on a grey background but I don't have a clue how to do it...



    thanks

    joundill

    edit; What I need is a command that reads text (non rs) in an area so I hope that helps

  2. #2
    Join Date
    Feb 2006
    Posts
    406
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    function LoadCharsFromFont2(fontname: string; fontsize: Integer; fontbold, fontitalic, fontunderline, fontstrike: Boolean): Integer;
    sooo........

    you might use

    c:=LoadCharsFromFont2('Veranda',10,true,false,fals e,false);

    ive never really used it, but you can experiment with it a bit

    you need to test to make sure that the font will work, and find some coordinates for you to use with gettextatex

    Code:
    function IsTextInAreaEx(x1, y1, x2, y2: Integer; var x, y: Integer; S: String; Tolerance: Integer; Chars: Integer; CheckShadow, CheckOutline: Boolean; MinSpacing, MaxSpacing: Integer; TextColor: Integer) : Boolean;
    should work for that, again, tweak the parameters (ex you wont need shadow)

    if that works, and you get an x and y returned, you can use

    Code:
    function GetTextAtEx(x, y: Integer; Tolerance: Integer; Chars: Integer; CheckShadow, CheckOutline: Boolean; MinSpacing, MaxSpacing: Integer; TextColor: Integer; TextLength: Integer; Strict: Boolean; Range: TCharRange) : String;
    those are the the three functions you will need to work with (read the manual )

    i modded scripts/test/fonttest2 to give you an example
    Code:
    //drag crosshair to script box
    program New;
    var
      c: Integer;
      x, y: Integer;
      text:string;
    begin
      Sleep(100);
      
      c:= LoadCharsFromFont2('Courier New', 10, False, False, False, False);
    
      if(IsTextInAreaEx(0, 0, 545, 160, x, y, 'Sleep', 10, c, False, True, 0, 0, -1))then
      begin
        Writeln('yay, found "Sleep" at x=' + IntToStr(x) + ', y=' + IntToStr(y));
        text:= GetTextAtEx(x, y, 0, c, False, False, 0, 0, -1, 20, True, tr_NormalChars)
        writeln('text is : '+text);
      end else
        Writeln('nay');
    end.
    good luck

  3. #3
    Join Date
    Sep 2006
    Posts
    154
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Is it to read text or to match text or to find text?

  4. #4
    Join Date
    Jan 2007
    Posts
    13
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    it is to readtext and it needs to readtext in an area... so a function like
    Code:
    GetTextInArea(x1, y1, x2, y2: Integer; Tolerance: Integer; Chars: Integer; CheckShadow, CheckOutline: Boolean; MinSpacing, MaxSpacing: Integer; TextColor: Integer; TextLength: Integer; Strict: Boolean; Range: TCharRange) : String;

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Grabbing or reading Text from a game text box
    By British in forum OSR Help
    Replies: 16
    Last Post: 02-27-2009, 08:02 AM
  2. How To Read The Exact Text From A File?
    By Maninblack144 in forum OSR Help
    Replies: 5
    Last Post: 05-13-2008, 05:51 PM
  3. how do i make my script read the text box?
    By takeout in forum OSR Help
    Replies: 4
    Last Post: 09-28-2007, 10:22 PM
  4. Can Scar/Srl read text?
    By dstone09 in forum OSR Help
    Replies: 11
    Last Post: 07-15-2007, 08:21 PM
  5. How do I "read" or "get" this text?
    By solarwind in forum OSR Help
    Replies: 10
    Last Post: 01-11-2007, 01:29 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
  •