eKolin Posted May 24, 2016 Posted May 24, 2016 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
mikell Posted May 24, 2016 Posted May 24, 2016 ? $str = "some text" &@crlf& "John has won GUI45n with a score of 5!" &@crlf& "some other text" Msgbox(0,"", $str) $key = "John has won" $res = StringRegExpReplace($str, '(?s).*' & $key & '\h*(\w+).*', "$1") Msgbox(0,"", $res)
xcaliber13 Posted May 24, 2016 Posted May 24, 2016 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.
eKolin Posted May 24, 2016 Author Posted May 24, 2016 @mikell @xcaliber13 Thanks for the replies, gonna try to understand everything that u've wrote there with #Help option in editor (The text would be in an image, would it affect the code?)
Moderators JLogan3o13 Posted May 24, 2016 Moderators Posted May 24, 2016 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!
eKolin Posted May 24, 2016 Author Posted May 24, 2016 @JLogan3o13 Ok. The font size and colour would be exact as shown in the image. 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
eKolin Posted May 24, 2016 Author Posted May 24, 2016 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
Moderators Melba23 Posted May 26, 2016 Moderators Posted May 26, 2016 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 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Skysnake Posted May 26, 2016 Posted May 26, 2016 http://Regex101.com Skysnake Why is the snake in the sky?
Moderators JLogan3o13 Posted May 26, 2016 Moderators Posted May 26, 2016 (edited) @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 May 26, 2016 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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now