Results 1 to 20 of 20

Thread: Reading Runescape Letters

  1. #1
    Join Date
    Aug 2009
    Posts
    164
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Reading Runescape Letters

    i need help reading runescape letters.

    apparently the SRL has the ability to read the letters and numbers in rs and i need to know how to do that.

    some1 help

  2. #2
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    What runescape letters?
    The ones in the chatbox?

    T~M

  3. #3
    Join Date
    Aug 2009
    Posts
    164
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    like the prices of items in the grand exchange

  4. #4
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Look in GE.scar.. I'm not 100% sure it's there, but it should be either there or Text.scar. If not, then there should be a constant you can use. Good luck.

  5. #5
    Join Date
    Aug 2009
    Posts
    164
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    wow thats great but only problem is that im not too familiar with scar

    so im not entirely sure what you mean by GE.scar or Text.scar.. is that like a package or something that has functions or classes? and how could i use it?

  6. #6
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    It's in your SRL\misc\ folder. (Or SRL/core, I don't have SCAR on this computer) C:\Program Files\SCAR 3.21\SRL\SRL\misc\(Should be here). Text.scar might be in SRL\SRL\core\.. But I'm not entirely sure.

    Good luck I have to get off (boss is coming back soon ), but this community is extremely helpful ^^.

  7. #7
    Join Date
    Aug 2009
    Posts
    164
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok so i found that and in the SRL there is text and i think i can use the function FindText but how would i implement it and what would the font be because that is one of the parameters... is there a specific name to use or do i load fonts or is the RS font default?

  8. #8
    Join Date
    Aug 2009
    Posts
    164
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    UPDATE:
    i found on another thread to use the function GetTextAtEx but it has alot of parameters that i dont understand.. i could use help trying to make that function work with the GE prices..

  9. #9
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Well, you could use GetPage + Between, if you wanted. I'm not too good with text stuff, but if you wanna try GetPage + Between, then add me on MSN. panic._@live.com. If not, that's fine. ^^ Good luck with this.

  10. #10
    Join Date
    Aug 2009
    Posts
    164
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    im using this tutorial:
    http://www.villavu.com/forum/showthread.php?t=31983

    but i dont know how to implement a function from the SRL

  11. #11
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Why don't you post on that thread?

  12. #12
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    {*******************************************************************************
    function GetAmount(ItemX, ItemY: Integer): Integer;
    By: ZephyrsFury
    Description: Returns the amount of an item at coordinates (ItemX, ItemY).
      Returns approximate values for 'K' and 'M'.
    *******************************************************************************}


    function GetAmount(ItemX, ItemY: Integer): Integer;
    var
      S: string;
      Col, II: Integer;
      B: TBox;
      TPA: TPointArray;
      ATPA: T2DPointArray;
    begin
      if (FindColorsTolerance(TPA, 65536, ItemX - 50, ItemY - 50, ItemX + 50, ItemY + 50, 0)) then
      begin
        SortTPAFrom(TPA, Point(ItemX, ItemY));
        ATPA := SplitTPAEx(TPA, 5, 5);
        B := GetTPABounds(ATPA[0]);
        if (Length(ATPA[0]) < 15) or (B.X2 - B.X1 < 5) or (B.Y2 - B.Y1 < 5) then Exit;
        Result := 1;
        for II := 2 downto 0 do
          if (FindColorsTolerance(TPA, 7575987 * II * II - 6796134 * II + 65535, B.X1 - 10, B.Y1 - 10, B.X2 + 10, B.Y2 + 10, 0)) then
            Break;
        if (II < 0) then Exit;
        SortTPAFrom(TPA, Point((B.X1 + B.X2) shr 1, (B.Y1 + B.Y2) shr 1));
        ATPA := SplitTPAEx(TPA, 5, 5);
        TPA := ATPA[0];
        Col := 7575987 * II * II - 6796134 * II + 65535;
        B := GetTPABounds(TPA);
        S := Trim(GetTextAtEx(B.X1, B.Y1 - 1, 0, StatChars, False, False, 0, 1, Col, 5, True, tr_AllChars));
        Result := StrToIntDef(GetNumbers(S), 1);
        if (Pos('M', S) > 0) then Result := Result * 1000000 else
        if (Pos('K', S) > 0) then Result := Result * 1000;
      end;
    end;

    Just include SRL and try a GetAmount call. Get the point at which the item is at (x,y) and call it like so:

    SCAR Code:
    var
      Amount: Integer;

    if(FindColorTolerance(x,y,2953624,MIX1,MIY1,MIX2,MIY2,3))then
      Amount := GetAmount(x,y);

    Edit: Just realized that you are looking at prices in ge. misread, sorry.

    You are going to need to use GetTextAtEx to accomplish that.

    It has a lot of parameters:

    SCAR Code:
    GetTextAtEx(x, y: Integer; Tolerance: Integer; Chars: Integer; CheckShadow, CheckOutline: Boolean; MinSpacing, MaxSpacing: Integer; TextColor: Integer; TextLength: Integer; Strict: Boolean; Range: TCharRange) : String;

    x,y is where the text is at (beginning I believe). Tolerance is the tolerance for the color or location of the text. Chars is what kind of characters you want to search for. check shadow and outline is self explanatory (checks for shadow and checks for outlining around the text). min spacing and max spacing is the minimum and maximum amount of space allowed between letters. TextColor is the color of the text. TextLength is how many characters you want to search (max). Strict is an option for being strict on the text length I believe.

    I am sure that a tutorial would explain it better than I just did.
    Last edited by JAD; 08-20-2009 at 06:17 AM.

  13. #13
    Join Date
    Aug 2009
    Posts
    164
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    so i tried this code but it doesnt seem to get the text at all:

    procedure getText;
    var
    x,y : Integer;
    begin
    Answer := GetTextAtEx(363,191,50,UPChars,False,False,0,10,34 00255,80,False,tr_digits);
    WriteLn(Answer);
    end;
    any ideas? like how should my x and y be in the beginning.. keep in mind that its the GE price in the game so the color of the text and the position stay the same.. maybe my x and y are wrong? like where should they be in relation to the text..


    also someone mentioned to me to use IsTextInAreaEx to find the coordinates but no luck there either

    need help plzzzz

  14. #14
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by scuz 10 View Post
    so i tried this code but it doesnt seem to get the text at all:



    any ideas? like how should my x and y be in the beginning.. keep in mind that its the GE price in the game so the color of the text and the position stay the same.. maybe my x and y are wrong? like where should they be in relation to the text..


    also someone mentioned to me to use IsTextInAreaEx to find the coordinates but no luck there either

    need help plzzzz
    I'm pretty sure that the x and y are supposed to be just left of the text.

    If that doesn't fix anything, than maybe upchars isn't the correct type for the text.

  15. #15
    Join Date
    Aug 2009
    Posts
    164
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    k so first some1 said that the x and y locations have to be exact so i have to use IsTextInAreaEx to find the exact x and y locations.. but that isnt working

    second, im sure UpChars is right because i checked the pictures of the font, but another site said that UpChars needs to be like initialized or something but idk what theyre talking about...

  16. #16
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by scuz 10 View Post
    k so first some1 said that the x and y locations have to be exact so i have to use IsTextInAreaEx to find the exact x and y locations.. but that isnt working

    second, im sure UpChars is right because i checked the pictures of the font, but another site said that UpChars needs to be like initialized or something but idk what theyre talking about...
    They should load when SCAR loads (UpChars).

    Can you post how you are using IsTextInAreaEx please? I forgot that you needed to use that first (it's been a while since I used these functions).

  17. #17
    Join Date
    Aug 2009
    Posts
    164
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    IsTextInAreaEx(290,180,445,200,x,y,'325,487,777',50,UpChars,False,False,0,25,-1);
    im testing with rs in standard mode and testing with Blue Partyhat as the GE item if that helps..

    and can i add you in msn for easier communication?

  18. #18
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by scuz 10 View Post
    Code:
    IsTextInAreaEx(290,180,445,200,x,y,'325,487,777',50,UpChars,False,False,0,25,-1);
    im testing with rs in standard mode and testing with Blue Partyhat as the GE item if that helps..

    and can i add you in msn for easier communication?
    You can add me on msn: runescapemacro@hotmail.com

    But I don't think that I can be of much help on this issue. Text finding like that was always something I had problems with in the past, and it's not any easier now =/

    Sorry. Any non text finding related questions you have I'd be happy to help out with on msn going to bed now though.

    ~JAD

  19. #19
    Join Date
    Aug 2009
    Posts
    164
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  20. #20
    Join Date
    Aug 2009
    Posts
    164
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Update:

    Got it working!!

    Thanks!!

Thread Information

Users Browsing this Thread

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

Posting Permissions

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