Results 1 to 4 of 4

Thread: Searching a string within a string?

  1. #1
    Join Date
    Nov 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Searching a string within a string?

    Hey guys I am writing an autominer and am using the OCR function GetUpText to confirm that I am actually clicking on a rock and not a pixel of the same color. The problem is that sometimes GetUpText reads the wrong input in the upper corner by adding a '( or some random character.

    I want to search for a particular string within the GetUpText return string.

    How do I do this?

  2. #2
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    In general, you use the function Pos() to search a substr in a str.

    For the case of up text, use IsUpText, in SRL.
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

  3. #3
    Join Date
    Nov 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Works like a charm! Thanks for the prompt response!

  4. #4
    Join Date
    Jan 2008
    Location
    Ontario, Canada
    Posts
    7,805
    Mentioned
    5 Post(s)
    Quoted
    3 Post(s)

    Default

    Not a problem!
    Writing an SRL Member Application | [Updated] Pascal Scripting Statements
    My GitHub

    Progress Report:
    13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you 
                        have serious physchological problems
    13:46 <@BenLand100> HE GETS IT!
    13:46 <@BenLand100> HE FINALLY GETS IT!!!!1

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
  •