Moderators Melba23 Posted June 1, 2017 Moderators Share Posted June 1, 2017 GeneNight, I am almost convinced that your friend wrote a simple app - what I do not understand is why you are trying to automate it using ImageSearch. To automate the app in any manner you must have some way of telling which question is currently being shown and which of the options is the correct answer - so why not just send the corresponding key (A-D) to select the answer rather than trying to recognise its image on screen? Other responders, How many times do we have to ask people not to provide answers, or even respond at all, if one of the Mods is involved in deciding the legitimacy of a thread? Perhaps we need to make an example of someone at some point "pour encourager les autres"..... 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 Link to comment Share on other sites More sharing options...
GeneNight Posted June 1, 2017 Author Share Posted June 1, 2017 (edited) 3 hours ago, Melba23 said: GeneNight, I am almost convinced that your friend wrote a simple app - what I do not understand is why you are trying to automate it using ImageSearch. To automate the app in any manner you must have some way of telling which question is currently being shown and which of the options is the correct answer - so why not just send the corresponding key (A-D) to select the answer rather than trying to recognise its image on screen? Other responders, How many times do we have to ask people not to provide answers, or even respond at all, if one of the Mods is involved in deciding the legitimacy of a thread? Perhaps we need to make an example of someone at some point "pour encourager les autres"..... M23 When I started the bot, I was thinking which way was the best to take. There were 2 choises, ImageSearch or Tesseract UDF, since the examples of the Tesseract UDF weren't working anymore because the site is offline, I decided to go for ImageSearch. If you do have a different way to detect the question and then the aswer, I'm ready to hear your tip. Thank you anyway. Edited June 1, 2017 by GeneNight Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 1, 2017 Moderators Share Posted June 1, 2017 GeneNight, Have you used the AutoIt Window Info tool (Au3Info.exe in your AutoIt installation folder) to see if you can get any text from the GUI? That would make the whole thing trivial. 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 Link to comment Share on other sites More sharing options...
GeneNight Posted June 1, 2017 Author Share Posted June 1, 2017 (edited) I do know about the tool, but how can I exactly see if I can get the text? May you explain me please? I'm sorry but I'm kind of new to this language. Edited June 1, 2017 by GeneNight Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 1, 2017 Moderators Share Posted June 1, 2017 GeneNight, Run the tool and look to see if there is anything on the "Visible text" or "Hidden text" tabs of the tool when the app window is highlighted. I would not be surprised if there was nothing as the window is probably not a standard Windows GUI, but you never know. 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 Link to comment Share on other sites More sharing options...
GeneNight Posted June 1, 2017 Author Share Posted June 1, 2017 (edited) 9 minutes ago, Melba23 said: GeneNight, Run the tool and look to see if there is anything on the "Visible text" or "Hidden text" tabs of the tool when the app window is highlighted. I would not be surprised if there was nothing as the window is probably not a standard Windows GUI, but you never know. M23 Thank you for the explanation, anyway, as you were saying because it isn't a normal windows GUI, I only get this information. Visible text: QWidgetClassWindow ScreenBoardClassWindow QWidgetClassWindow sub centralWidgetWindow Hidden text: QLabelClassWindow qt_rubberbandWindow Edited June 1, 2017 by GeneNight Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 1, 2017 Moderators Share Posted June 1, 2017 GeneNight, When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unnecessarily. You might like to look at this thread which has been a great success in reading various GUIs - but as I have not used it myself I cannot help you further. 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 Link to comment Share on other sites More sharing options...
GeneNight Posted June 1, 2017 Author Share Posted June 1, 2017 (edited) I didnt mean that, I'm sorry. Anyway, it looks like quite complex for my knowledge to this language and to the English language aswell :/. I think it possible to use an OCR fuction for my purpose and I saw you answering to that post, so I guess you know enough about it to help me out. Anyway, if the OCR cannot help me with my purpose, then I'll just wait for other responders. Thank you. Edited June 1, 2017 by GeneNight Link to comment Share on other sites More sharing options...
anthonyjr2 Posted June 1, 2017 Share Posted June 1, 2017 As I think Melba has made up his mind on whether or not this is against the rules, I can give you a tip on OCR. The newest version of Tesseract has been moved to Github here, so if you want the latest version then download it there. A UDF to use Tesseract can be found here: although that is very old and may require a few changes to get working. The UDF I'm using right now required a bunch of tweaks for me to get working a year or two ago. I have a very large amount of experience with OCR so if you need any more help just let me know. UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI= Link to comment Share on other sites More sharing options...
GeneNight Posted June 1, 2017 Author Share Posted June 1, 2017 As I said my English is poor and I didn't understand why I broke the rules by saying something. Anyway, if I did, I'm sorry. Thank you for replying me about the OCR. I got only one question, do you know how long it takes to read an image? They are like 200 questions, so, does it affect the speed of the fuction such as imagesearch? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 1, 2017 Moderators Share Posted June 1, 2017 GeneNight, You seem fixated on either OCR or ImageSearch as a solution - there might be an easier way. As I mentioned earlier in the thread, how do you know which question is being shown in the app and which of the 4 answers is correct? If we knew how you were going to determine that, we might be able to suggest an alternative method which will meet your strict time requirements - because I doubt either of your 2 current avenues will be able to do so. 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 Link to comment Share on other sites More sharing options...
GeneNight Posted June 1, 2017 Author Share Posted June 1, 2017 Melba23, You don't know which question will be shown, but what you do know is the answer for that specific question. As I said, the answer will change the position (A,D), it won't always be the same one. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 1, 2017 Moderators Share Posted June 1, 2017 GeneNight, Understood - looks like you are stuck with your current choices then. 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 Link to comment Share on other sites More sharing options...
anthonyjr2 Posted June 1, 2017 Share Posted June 1, 2017 I don't have any comment on the speed. I would say it is probably faster than imagesearch but I honestly can't say for sure. You'll have to do tests yourself for that. I can say that in my own scripts OCR is usually quicker, but I am using it differently than you are. UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI= Link to comment Share on other sites More sharing options...
junkew Posted June 1, 2017 Share Posted June 1, 2017 If your friend maintains the app he should be able to set the accessibility properties of all elements. Professional developers should use them. As it are qtwidgets you can try to see whats visible with simplespy as you can find in iuiautomation thread as earlier given. See if element highlights and post output here. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
ngskicker Posted June 1, 2017 Share Posted June 1, 2017 @GeneNight Is that Android App, Nox is Android emu, when comes to Android Apps running on emulator, you have verry little choice to automate it with AutoiIt. Link to comment Share on other sites More sharing options...
GeneNight Posted June 2, 2017 Author Share Posted June 2, 2017 Thank your for replying me guys, @ngskicker Unfortunately I did know that but I wanted to be sure by asking someone who knows a bit more than me. Anyway, right now I'm still using imagesearch fuction to finish my project, one thing that I have to do is to try my program on a better hardware because mine is really old. @junkew I really don't know about what you are talking about because I'm not an Android programmer. I will let my friend read your reply and then I'll tell you. My last chance is to try to make an "always win bot", if you correctly answer to 4 questions (every sequence is composed of 5), you win anyway. That wasn't the best choice, but I guess is the one that I have to take. Again thanks guys. Link to comment Share on other sites More sharing options...
GeneNight Posted June 5, 2017 Author Share Posted June 5, 2017 (edited) Hi there guys, I'm here to give you some news. I managed to add 125 questions to the bot but that's not enough for an "always win". That's why I was thinking, why not just slow down the application instead of trying to make the fuction faster... which looks like impossible. Because I'm using an emulator I decided to slow down it with a simple program kill -STOP and kill -CONT , I would like to add a fuction like that to my bot without using an external program. May someone help me with that? Edited June 5, 2017 by GeneNight Link to comment Share on other sites More sharing options...
GeneNight Posted June 6, 2017 Author Share Posted June 6, 2017 Answer to myself: Just a little bit of effort and I found out this UDF which is just amazing Link to comment Share on other sites More sharing options...
junkew Posted June 6, 2017 Share Posted June 6, 2017 see this and try what simplespy gives you back on the text elements you try. Be explicit on what highlights (whole window or QtElements within it) FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
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