Bamse Posted January 8, 2018 Share Posted January 8, 2018 Can someone explain how the pixelsearch works with left,top,right and bottom. Please use an image to explain it with. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 8, 2018 Developers Share Posted January 8, 2018 Which part from the helpfile is unclear for you? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
careca Posted January 8, 2018 Share Posted January 8, 2018 Trying to answer the OP question i came up with a question myself.. the remarks in the pixelsearch func say: The search direction varies as follows: Left-to-Right - left < right Right-to-Left - right < left Top-to-Bottom - top < bottom Bottom-to-Top - bottom < top Changing the search direction can be a useful optimization if the color being searched for frequently appears in in a specific quadrat of the search area since less searching is done if the search starts in the most common quadrant. My doubt is, how can i change the direction of the search? i don't see any parameter to define that, is it auto? I assume it is, and that should answer the OP. 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 Link to comment Share on other sites More sharing options...
Developers Jos Posted January 8, 2018 Developers Share Posted January 8, 2018 OK lets see you can figure this out by studying left-right as an example Quote Left-to-Right - left < right Right-to-Left - right < left So what exactly does this say ? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
PunkoHead Posted January 8, 2018 Share Posted January 8, 2018 Hi again, This example actually shows everything for it. As my example script I will show you what it does. I will open this webpage in the browser and will leave my SCITE windows on the right of it. On the webpage, I want it to move my cursor on the Facebook button. So what I will do first is start autoit window info and get the rectangle position. In order to do so: Move the pointer to the top left of the button and check the X result - in my case 445 - this will be your left for the function The top will be the Y result - in my case 754 Now move the pointer to the bottom right of the button and check the X result - in my case 527 - this will be your right for the function The bottom will be the Y result - in my case 787 To find the color, use the same program (autoit window info) and move the pointer to the color itself. I got result - 0x428BCA And now the function: ;~ Search for color 0x428BCA between these coords: $result = PixelSearch(445, 754, 527, 787, 0x428BCA) ;~ Move the mouse to the coords of the found color: MouseMove($result[0], $result[1]) Link to comment Share on other sites More sharing options...
careca Posted January 8, 2018 Share Posted January 8, 2018 (edited) @PunkoHead: I think the op knows how it works, seems he asked specifically the way it works @Jos: Ah! you are of course correct, i overlooked the '<' I just need to switch the values to search in the other direction. So in order to search from left to right i need to set the left value as the smaller one, and the right as the bigger. And in searching from right to left, the opposite, is that it? Edited January 8, 2018 by careca PunkoHead 1 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 Link to comment Share on other sites More sharing options...
Somerset Posted January 8, 2018 Share Posted January 8, 2018 27 minutes ago, Jos said: Which part from the helpfile is unclear for you? Jos There is a help file? JLogan3o13 and Jos 2 Link to comment Share on other sites More sharing options...
Bamse Posted January 8, 2018 Author Share Posted January 8, 2018 The specific thing that i am having problems with is that i don’t really understand how it is searching for the pixels. I don’t get how left,top,bottom and right is working. That's why i am asking one of you too draw a square and point out where left,top,bottom and right is I think that would help out! Link to comment Share on other sites More sharing options...
Developers Jos Posted January 8, 2018 Developers Share Posted January 8, 2018 Just now, Bamse said: That's why i am asking one of you too draw a square and point out where left,top,bottom and right is I think that would help out! Why draw something when it is described? So did you actually look at the description in the helfile .... and .... also read this whole thread as it has more info in it now about your question? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Bamse Posted January 8, 2018 Author Share Posted January 8, 2018 (edited) I understand everything else then left,top,right and bottom.Yes i have been reading the help file. Edited January 8, 2018 by Bamse Link to comment Share on other sites More sharing options...
Developers Jos Posted January 8, 2018 Developers Share Posted January 8, 2018 Just now, Bamse said: Yes i have been reading the help file. there where 2 parts in that last question. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Bamse Posted January 8, 2018 Author Share Posted January 8, 2018 I have read the whole thread. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 8, 2018 Developers Share Posted January 8, 2018 (edited) So the helpfile description states: Quote The search direction varies as follows: Left-to-Right - left < right Right-to-Left - right < left Top-to-Bottom - top < bottom Bottom-to-Top - bottom < top To translate the first line: It will scan from left-to-right when the Left parameter is smaller than the Right parameter. (I leave the rest for you to fill in) Does that make it any clearer for you? Jos Edited January 8, 2018 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
careca Posted January 8, 2018 Share Posted January 8, 2018 (edited) 10 minutes ago, Bamse said: The specific thing that i am having problems with is that i don’t really understand how it is searching for the pixels. I don’t get how left,top,bottom and right is working. In terms of coordinates, top left is zero. Meaning top = 0 left = 0 and bottom right is the max resolution, say you have a resolution of 800x600. right is 800 and bottom is 600. So in a search from left to right , top to bottom, it starts from 0 to 800, onto de next line.. so all pixels in line 0 then all pixels in line 1 etc Edited January 8, 2018 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 Link to comment Share on other sites More sharing options...
Bamse Posted January 8, 2018 Author Share Posted January 8, 2018 I am getting an error and i don’t know why WinActivate("Discord") ;~ Search for color 0x44D723 between these coords: $pix = PixelSearch(967, 0, 1919, 39, 0x44D723) ;~ Move the mouse to the coords of the found color: MouseMove($pix[0], $pix[1]) Link to comment Share on other sites More sharing options...
Developers Jos Posted January 8, 2018 Developers Share Posted January 8, 2018 (edited) 1 minute ago, Bamse said: I am getting an error .. and you want us to guess what that error is? My guess would be that you haven't looked at the example in the Helpfile!!!! Edited January 8, 2018 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Bamse Posted January 8, 2018 Author Share Posted January 8, 2018 I am LOOKING AT THE EXAMPLE CODE! Link to comment Share on other sites More sharing options...
Bamse Posted January 8, 2018 Author Share Posted January 8, 2018 I am guessing that the error has todo with the coordinates. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 8, 2018 Developers Share Posted January 8, 2018 (edited) So what is there YOU DO NOT HAVE USED? (guess you want to have a shouting match?) Edited January 8, 2018 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
careca Posted January 8, 2018 Share Posted January 8, 2018 My guess is Subscript used on non-accessible variable.: MouseMove($pix[0], $pix[1]) MouseMove($pix^ ERROR Because the script didnt find the pixel. Add some tolerance. $pix = PixelSearch(967, 0, 1919, 39, 0x44D723, 10) 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 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