Jump to content

Detect text (pretty simple imo)


Recommended Posts

Basicly what i want to do is to detect certain words with numbers (case sensitive).

John has won GUI45n with a score of 5!

It would search for exact "John has won". Bolded text is what i need. It would have to send the bolded text to the active window. (p.s. the text wouldn't be bolded.)

Any suggestions how the code should look like? Thanks in advance ;)

Link to comment
Share on other sites

Look in the help file.   StringRegExp

This code pulls the whole line that begins with either a 1 or 2.   Little mod and you should be able to get what you are looking for

$sFile = FileRead("Path to your file")
Local $aResults[0]

$aResults = StringRegExp($sFile, "(?m)^[12].*", 3)

_ArrayDisplay($aResult)

Best I can do for you. But should get you on the right track.  

Link to comment
Share on other sites

  • Moderators
9 minutes ago, eKolin said:

 (The text would be in an image, would it affect the code?)

Yes, it would. Why don't you post a screenshot of the image with the text so we can see what we are dealing with?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

@JLogan3o13 Ok. The font size and colour would be exact as shown in the image.
V911EGT.png
It would search for that text in certain coordinates, let's pretend it's (100,200,200,300).
Like i said in my upper post, it's case sensitive, can contain numbers, letters, signs ":" and "/".
It would have to check the area every 10ms, if true then "send(Found)" AND repeat the loop after 1 minute (after sending the "found")

It sounds a bit more complex than i thought xD Thanks in advance ;)

Link to comment
Share on other sites

Doubleposting since i didin't find a way to edit my post.

What i need is to find a certain "word" that's always random.

John has won GUI45n with a score of 5!

 

"John has won" and "with a score of 5!" Will always be the same, while GUI45n can be anything that's made of 6 letters. I need to respond it with send(/GUI45n), yes i additionaly need the slash. Hope that you guys will understand me despite how bad my grammar nd stuff is. I would be really greatful if someone would write this code for me:)

Link to comment
Share on other sites

  • Moderators

eKolin,

Quote

John has won GUI45n with a score of 5!

That sounds very much like a game - have you read the Forum rules? What is this app that you are attempting to automate?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

@Skysnake you have been around long enough to know that when a Moderator weighs in with a question as to the legitimacy of a thread, that is not the time for you to continue posting. Wait until that question is answered by the OP.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...