adjist Posted April 30, 2020 Posted April 30, 2020 (edited) Hello, feeling kind of stupid right now as I already had this working earlier, accidentally deleted the code, came back to my pc and now I cannot remember what I did. The basis of what i'm wanting to do is pixelsearch inside of a window specified from wingetpos Local $a = WinGetPos("example") $example = PixelSearch($a[0] + 585, $a[1] + 259, $a[0] + 621, $a[1] + 289, 0xDF2C33,10) if not(@error) Then ControlClick("example", '', '', "left", 1, 892, 433) endif It gets the window position fine, but then it seems like the pixelsearch function doesnt work, at all. Edited April 30, 2020 by adjist
alienclone Posted April 30, 2020 Posted April 30, 2020 i have a solution, but not for your code. i keep all my scripts in folders that are backed up on the cloud, mainly Google Drive, Dropbox, and OneDrive, with their respective syncing apps installed. If i ever delete, or otherwise completely fubar my code i can just grab a previous version from the cloud, saves me from many hassles and headaches. If @error Then MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!") EndIf "Yeah yeah yeah patience, how long will that take?" -Ed Gruberman REAL search results | SciTE4AutoIt3 Editor Full Version
Nine Posted April 30, 2020 Posted April 30, 2020 (edited) Shouldn't you use the array result of the PixelSearch ? Instead of using static coordinates ? Also remember that ControlClick uses coordinates WITHIN the control. Edited April 30, 2020 by Nine “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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
careca Posted April 30, 2020 Posted April 30, 2020 @Nine from what i understand it could be a condition, more than a find and click situation. Maybe it's like, if a certain color exists in a certain place, then click this button, which is fixed. I just don't understand the bit: $a[0] + 621, $a[1] + 289 If you would be so kind to explain why you made it this way.. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
adjist Posted April 30, 2020 Author Posted April 30, 2020 5 hours ago, careca said: @Nine from what i understand it could be a condition, more than a find and click situation. Maybe it's like, if a certain color exists in a certain place, then click this button, which is fixed. I just don't understand the bit: $a[0] + 621, $a[1] + 289 If you would be so kind to explain why you made it this way.. Yes that's correct, I want to search an area within the window, and then click a button within the window if the certain color is found
Nine Posted April 30, 2020 Posted April 30, 2020 Did you read my second comment about ControlClick ? If you want/need more help, you will have to give us more details on what is the application, provide screen shot, give autoit info tool results. The more info we have, more likely we will be able to help you out. “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) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
careca Posted April 30, 2020 Posted April 30, 2020 (edited) I think the user did not understand the remark. I'll try to clarify: Remove the coordinates from the controlclick line (no coords = clicks the center of the control) and insert the control id of the control you're trying to click, you can't do it like it is. Unless the button is at least 892px wide and 433px height, it will click outside of it. Actually without the id it won't. ControlClick("example", '', 'IDHERE', "left", 1) Or, i think you may be looking for a different function, like this: MouseClick("left", 892, 433, 1, 1) Edited April 30, 2020 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
adjist Posted May 1, 2020 Author Posted May 1, 2020 1 hour ago, careca said: I think the user did not understand the remark. I'll try to clarify: Remove the coordinates from the controlclick line (no coords = clicks the center of the control) and insert the control id of the control you're trying to click, you can't do it like it is. Unless the button is at least 892px wide and 433px height, it will click outside of it. Actually without the id it won't. ControlClick("example", '', 'IDHERE', "left", 1) Or, i think you may be looking for a different function, like this: MouseClick("left", 892, 433, 1, 1) The controlclick works perfectly fine, the issue is when I try to pixelsearch. I am trying to "dynamically" search for the pixel, as in, getting the top left coord of a window, and then moving down to where I want to search for the pixel. If you understand that at all I had tried using PixelCoordMode and adding the hWnd to the pixelsearch but it didnt seem to work either.
careca Posted May 1, 2020 Posted May 1, 2020 Right, so, $a[0] + 585, $a[1] + 259, $a[0] + 621, $a[1] + 289 You want to start the search: 585 pixels to the right of the left border, 259 pixels to the top border, 621 from the right border, and 289 from the bottom border? Wouldn't this mean you are searching in some sort of offset mode? I don't understand the logic behind this line. The image shows my understanding of that code: the blue represents the window, and the red, the portion you are searching. Which of the PixelCoordMode did you use? When you change the mode, you have to adapt the code. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Bert Posted May 1, 2020 Posted May 1, 2020 11 hours ago, adjist said: The controlclick works perfectly fine, the issue is when I try to pixelsearch. I am trying to "dynamically" search for the pixel, as in, getting the top left coord of a window, and then moving down to where I want to search for the pixel. If you understand that at all I had tried using PixelCoordMode and adding the hWnd to the pixelsearch but it didnt seem to work either. We understand perfectly WHAT you want. We are asking WHY you want it that way. In other words - what is your REASON for needing pixel search? (other than it is what you already have and you just want to fix it.) Why are you not open to a different solution that would make your code more stable? Pixel searching - it is by far the WORST way to automate. Very unstable due to highly prone to changes by the program you are trying to automate, windows changing sizes, updates to the OS or the application by the developers of the software, display size, you name it. You ONLY use it if there is no choice to do something else. That is why we are asking you the question. The Vollatran project My blog: http://www.vollysinterestingshit.com/
adjist Posted May 1, 2020 Author Posted May 1, 2020 (edited) Nevermind, ended up being able to fix it myself Edited May 1, 2020 by adjist
careca Posted May 1, 2020 Posted May 1, 2020 Awesome, how did you fix? Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
adjist Posted May 2, 2020 Author Posted May 2, 2020 5 hours ago, careca said: Awesome, how did you fix? realized this was a thing, lol.
careca Posted May 2, 2020 Posted May 2, 2020 That would be the same as this i guess. Opt("PixelCoordMode", 0) ;1=absolute, 0=relative, 2=client Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
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