Shakala Posted June 1, 2010 Share Posted June 1, 2010 (edited) My Problem: Ok, so im playing around with Tesseract and Autoit and Ive run into a small problem.I want to search a box that only shows when you move your mouse over the object. The box is a random size and shape AND it only appears when your mouse is over the object. If you move your mouse off the object onto the box, then it disappears. My Question: Is there a way for autoit to be able to recognize a new box appearing, and thenbe able to check the coordinates of the corners or something to get the size of it?The Main Gist: I roll my mouse over the image, a random box appears, text is in the box, read whats in the boxand only whats in the box.What i can already do: I am able to make it successfully read the text inside the box and around the box, but i want it to be more precise in what it is reading and set it ONLY to whats inside the box. When i set it to read the square in the box andoutside the box, i get results back that aren't helpful in the least bit. If there is any more information i can give to help make this easier to answer, just let me know.Its realllllly late here and im just trying to type this before i go to bed. Thanks for the help in advance~ShakalaEDIT: Aditional Information: This box that appears is located inside another window, when you roll over it, and use *Autoit Window Information*,it still says it's part of the main window. So as far as i know, using the winwaitactive and wingetpos wont help with this at all. Edited June 1, 2010 by Shakala Link to comment Share on other sites More sharing options...
JohnOne Posted June 1, 2010 Share Posted June 1, 2010 (edited) You want to be looking at WinExists() to detect the window. WinActivate() if its not already active. WinGetPos() to get the co-ordinates of the window, which you can use for your calculations. Edited June 1, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Shakala Posted June 1, 2010 Author Share Posted June 1, 2010 This box that appears is located inside another window, when you roll over it, and use *Autoit Window Information*, it still says it's part of the main window. So as far as i know, using the winwaitactive and wingetpos wont help with this at all. Thanks ~Shakala Link to comment Share on other sites More sharing options...
Shakala Posted June 2, 2010 Author Share Posted June 2, 2010 Hm, well not trying to be impatient or anything, but i felt it was time for another bump. Any ideas guys? Link to comment Share on other sites More sharing options...
Shakala Posted June 3, 2010 Author Share Posted June 3, 2010 Upp =( Link to comment Share on other sites More sharing options...
JohnOne Posted June 3, 2010 Share Posted June 3, 2010 What type of box is it? standard windows gui, flash, tooltip .... AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Shakala Posted June 3, 2010 Author Share Posted June 3, 2010 What type of box is it? standard windows gui, flash, tooltip ....That probably would of been good to mention... It was for a flash game. Which is why i had problems. I seem to of misplaced the link to the game so it doesn't matter really, but if it wont take much timei would like to see how it would have been done. Thanks~Shakala Link to comment Share on other sites More sharing options...
JohnOne Posted June 3, 2010 Share Posted June 3, 2010 Hmmm, flash games eh, not everyone is a big fan of them. I can give you a direction, as you know the functions you mentioned wont help you, so your only way forward is the pixel functions and image UDFs. If I remember there is Imagesearch and FindBmp knocking about the forum along with some others, you will have to find them. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Shakala Posted June 3, 2010 Author Share Posted June 3, 2010 I already got the image search one, but since the box keeps changing, and the text inside is also changing, it wont work the way i want. and ill look for the find bmp one and take a look at it and see what i can do. anyone else got an idea? Link to comment Share on other sites More sharing options...
junkew Posted June 18, 2010 Share Posted June 18, 2010 I already got the image search one, but since the box keeps changing, and the text inside is also changing, it wont work the way i want. and ill look for the find bmp one and take a look at it and see what i can do.anyone else got an idea?The source of findbmp can help you out in a direction especially the part to get the getdibits part.Steps to do it1. Determine the maximum size of the box you want to get2. When you want to take a look if there is a box on the screen you capture the area to investigate (can be full screen but thats probably slow) based on the x and y coordinates of your mouse3. With the getdibits (see findbmp source) you can get a long byte(string) where you can search for a certain pattern4. You can work that out to do a dumphex and analyse how the box is recognizable5. see also color replacing logic http://www.autoitscript.com/forum/index.php?showtopic=112341 to rule out certain areas (with several replaces you will remove all color till only the color of the box is left and then you determine the dimensions. 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