Results 1 to 7 of 7

Thread: How To Read Specific Text?

  1. #1
    Join Date
    Aug 2010
    Posts
    122
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default How To Read Specific Text?

    Part II:

    After using your:

    Code:
    function GetPrice: string;    //this is what reads the values
    begin
      Wait(500+random(50));
      Result := GetTextAtExWrap(252, 286, 273, 298, 0, 5, 2, 39372, 5, StatChars);
    end;
    Could I also call this number later?

    I tried to do so:

    Code:
     TypeSendEx(GetPrice);  //hoping that this types the "low" value and hits enter
    But it does not seem to work.











    I am trying to read:



    Can someone help me, or point me to a tutorial that discusses this?

    Thank you
    Last edited by Mister Snow; 05-14-2012 at 11:18 PM.

  2. #2
    Join Date
    Mar 2007
    Posts
    5,125
    Mentioned
    275 Post(s)
    Quoted
    901 Post(s)

    Default

    What I tested with:


    Simba Script:

    Simba Code:
    program Text;
      {$i SRL/srl.simba}

    function GetPrice: string;
    begin
      Result := GetTextAtExWrap(146, 285, 351, 298, 0, 5, 2, 39372, 5, StatChars);
    end;

    begin
    ClearDebug;
    writeln(GetPrice);
    end.

    Result:
    Code:
    1'295
    Successfully executed.
    Hope that is what you are looking for.

    Forum account issues? Please send me a PM

  3. #3
    Join Date
    Aug 2010
    Posts
    122
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by [J]ustin View Post
    What I tested with:


    Simba Script:

    Simba Code:
    program Text;
      {$i SRL/srl.simba}

    function GetPrice: string;
    begin
      Result := GetTextAtExWrap(146, 285, 351, 298, 0, 5, 2, 39372, 5, StatChars);
    end;

    begin
    ClearDebug;
    writeln(GetPrice);
    end.

    Result:
    Code:
    1'295
    Successfully executed.
    Hope that is what you are looking for.

    Awesome, thank you a bunch for your help.

  4. #4
    Join Date
    Aug 2010
    Posts
    122
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Part II:

    After using your:

    Code:
    function GetPrice: string;    //this is what reads the values
    begin
      Wait(500+random(50));
      Result := GetTextAtExWrap(252, 286, 273, 298, 0, 5, 2, 39372, 5, StatChars);
    end;
    Could I also call this number later?

    I tried to do so:

    Code:
     TypeSendEx(GetPrice);  //hoping that this types the "low" value and hits enter
    But it does not seem to work. It will just sit there and not type anything. No errors are thrown or anything.

  5. #5
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Simba Code:
    {$I SRL/SRL.Simba}

    Function GetPriceBox(Box: TBox): Integer;
    var
      Text: String;
    begin
      Text:= GetTextAtExWrap(Box.X1, Box.Y1, Box.X2, Box.Y2, 0, 5, 2, 39372, 55, 'StatChars');
      Result:= StrToIntDef(ExtractFromStr(Text, Numbers), 0);
    end;

    var
      ItemPrice, TotalPrice: TBox;

    begin
      SetupSRL;

      ItemPrice:= IntToBox(538, 267, 602, 278);   //From the pictures you posted.. Obviously you need to change these values.
      TotalPrice:= IntToBox(671, 417, 736, 429);  //Same as above..

      writeln(GetPriceBox(ItemPrice));
      writeln(GetPriceBox(TotalPrice));

      TypeSendEx(ToStr(GetPriceBox(ItemPrice), False);
    end.
    I am Ggzz..
    Hackintosher

  6. #6
    Join Date
    Aug 2010
    Posts
    122
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Simba Code:
    {$I SRL/SRL.Simba}

    Function GetPriceBox(Box: TBox): Integer;
    var
      Text: String;
    begin
      Text:= GetTextAtExWrap(Box.X1, Box.Y1, Box.X2, Box.Y2, 0, 5, 2, 39372, 55, 'StatChars');
      Result:= StrToIntDef(ExtractFromStr(Text, Numbers), 0);
    end;

    var
      ItemPrice, TotalPrice: TBox;

    begin
      SetupSRL;

      ItemPrice:= IntToBox(538, 267, 602, 278);   //From the pictures you posted.. Obviously you need to change these values.
      TotalPrice:= IntToBox(671, 417, 736, 429);  //Same as above..

      writeln(GetPriceBox(ItemPrice));
      writeln(GetPriceBox(TotalPrice));

      TypeSendEx(ToStr(GetPriceBox(ItemPrice), False);
    end.

    hmm, closed the parenthesis and still am getting errors:
    [Error] (24:50): Invalid number of parameters at line 23
    Compiling failed.

  7. #7
    Join Date
    Dec 2009
    Location
    R_GetPlayerLoc;
    Posts
    2,235
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Mister Snow View Post
    hmm, closed the parenthesis and still am getting errors:
    [Error] (24:50): Invalid number of parameters at line 23
    Compiling failed.
    the last line should be

    Simba Code:
    TypeSendEx(ToStr(GetPriceBox(ItemPrice)), False);

    Unless your missing a parameter there...
    "Logic never changes, just the syntax" - Kyle Undefined?

    Remember, The Edit Button Is There For A Reason!!!

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
  •