Daylino Posted May 30, 2021 Share Posted May 30, 2021 Hi, im trying to click a random point inside an outlined Area like the one i Attached here. Im thinking of 2 Methods: 1. Scanning from left to right and top to bottom with pixelgetcolour so i get all the Outline coords. Then calculate all points in between min and max found coords for every horizontal line. I think that would be very bad from performance perspektive (it needs to be done quick for my use, optimal in a few ms). 2. Getting the first outline pixel found with pixelsearch and then moving the mouse down, left an right until colour found again. So basically "scanning" the area within the outline with my mouse and writing every coord where colour is not found to an array. But i think that would be very slow too. Some more Information: Outline Colour is not Black, the image attached is only for demonstrating purposes. The shape is not a star, its random everytime but always a closed line. And the outline is exactly 1px, not a fat line like in the image. Am i thinking to complicated here? Or is there maybe a thing like "PixelSearchAll" so i get an array of coords? Please excuse my bad English and thank you for your Help! Link to comment Share on other sites More sharing options...
Bert Posted May 30, 2021 Share Posted May 30, 2021 A heads up for you. Forgive me if I'm incorrect on this. If you are asking for help in coding something for a game, that is a non-starter here. The way you are describing it strongly suggest that is your intent. Feel free to review the forum rules if you have any questions. If your intent is to interact with a program that isn't game automation or interacting with a game server or an emulator that runs a game, would you be so kind in letting us know the name of the application please? Once I have that, I would be happy to assist you. I ask for it is highly likely someone else has solved your issue already and I can simply point you to it. Thanks in advance. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Daylino Posted May 30, 2021 Author Share Posted May 30, 2021 It is not for Game Automation or something like that. I have read the Rules. I need this for phpmyadmin, i want to automatic import new sql files that i get from my Server every 30mins. To do this, i need to Navigate and click Different links and inputs. I dont want to use Webdriver so please dont suggest that and cant use imagesearch, because its on a virtual machine and imagesearch dont work. The Problem is, the things i need to click are outlined from css, but when i move the mouse to the first found Pixel it dont activate the link or button, because its not registering a hoverevent for the link. I need to move a little bit further into the outlined area to actually register a hover event and can click the link. But i cant do this with a random move from the found point, because the shapes are different and sometimes it would move over the endpoint where i can click. So i thought of getting all pixels in the outlined area and move my mouse to a point near the middle of the area. But to do this, i need all the pixels that are in the area to make my calculations and get a clickable point regardless of the shape. I hope you understand what i mean, if not please ask and i will try to explain further, but i hope you get my point Link to comment Share on other sites More sharing options...
Nine Posted May 30, 2021 Share Posted May 30, 2021 How about UIAutomation ? In any case, PixelGetColor can be extremely slow (especially on Win10). I believe the best approach would be to capture the screen area of interest and transfer it to a 2D array. Then you can search for specific patterns without requesting multiple reads of the screen. Please show a real example of the screen you want to interact with. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Daylino Posted May 30, 2021 Author Share Posted May 30, 2021 (edited) #include <Array.au3> Global $TopLeftX = 0 Global $TopLeftY = 0 Global $BotRightX = 10 Global $BotRightY = 10 Global $Array[$BotRightX - $TopLeftX + 1][$BotRightY - $TopLeftY + 1] For $i = 0 To UBound($Array) - 1 For $j = 0 To UBound($Array, 2) - 1 $Array[$i][$j] = PixelGetColor($TopLeftX + $i, $TopLeftY + $j) Next Next _ArrayDisplay($Array) Thanks i just found this on the Forums, thats exactly what i needed. With this array i can Do my maths. You can close this. P.S. Dont know why it writes in orange, maybe cause i pasted the Code and messed things up Edited May 30, 2021 by Melba23 Fixed formatting Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 30, 2021 Moderators Share Posted May 30, 2021 Daylino, When you post code in future please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. Thanks in advance for your cooperation. 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...
Bert Posted June 1, 2021 Share Posted June 1, 2021 Seeing how you get this from a virtual server every 30 minutes - could you not make a script that runs on the virtual server that takes all the files and copies them to a specific folder? That should be simple to do. Then all you need to do is import the contents of the folder to where you want. The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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