Souls Posted December 17, 2006 Share Posted December 17, 2006 Ok, I have a problem with PixelGetColor script. What can i do to make a script that check an entire horizontal line? I have an idea but i dont know if it works: If (PixelGetColor (465) = 0xFFA500) Then Exit Will that check all the horizontal line 465 for that color, and if it finds it will it exit the program? Ok second problem: I found a new script (for me) it is PixelSearch Can I use Pixel check to check a screen rectangle and if in the rectangle appears the color0xFFA500 can it close the program? thx in advance Link to comment Share on other sites More sharing options...
martin Posted December 17, 2006 Share Posted December 17, 2006 Ok, I have a problem with PixelGetColor script. What can i do to make a script that check an entire horizontal line? I have an idea but i dont know if it works: If (PixelGetColor (465) = 0xFFA500) Then Exit Will that check all the horizontal line 465 for that color, and if it finds it will it exit the program? Ok second problem: I found a new script (for me) it is PixelSearch Can I use Pixel check to check a screen rectangle and if in the rectangle appears the color0xFFA500 can it close the program? thx in advance for $n = 0 to $screenwid - 1 if PixelGetColor($n,465) = $SearchCol then exitloop next Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Souls Posted December 17, 2006 Author Share Posted December 17, 2006 I didn't understand T_T Link to comment Share on other sites More sharing options...
Zedna Posted December 17, 2006 Share Posted December 17, 2006 Or another way: use PixelChecksum() Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Souls Posted December 17, 2006 Author Share Posted December 17, 2006 But it sais that PixelChecksum only checks if something has changed in the area, I need one that stops the program when certain color appears Link to comment Share on other sites More sharing options...
Zedna Posted December 17, 2006 Share Posted December 17, 2006 (edited) But it sais that PixelChecksum only checks if something has changed in the area, I need one that stops the program when certain color appearsYou may calculate PixelChecksum before. And if some color changes then also PixelChecksum will return changed number.EDIT: sorry maybe you are right and it's not proper solution for your needs. Edited December 17, 2006 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
martin Posted December 18, 2006 Share Posted December 18, 2006 I didn't understand T_Tfor $n = 0 to $screenwid - 1if PixelGetColor($n,465) = $SearchCol then exitloopnextThis will check along the line at row 465 one pixel at a time from the left to the end. You need When the search color is found it will stop searching.I should have used @DesktopWidth - 1 instead of $screenwid, and said $SearchCol = 0xFFA500. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Dizzydbd Posted December 19, 2006 Share Posted December 19, 2006 (edited) OMG ppl i think this guy is more uncertain what to do now then before. 1st of all the function is Pixelgetcolor(x,y) . 465 is for sure not a coordonate. Second of all PixelGetColor is returning a decimal value and u are trying to compare it with a hex value >.< Also u can use PixelSearch(x, y,x,y 0xFFA500, 5) ; same x and y as before (u can also use an interval) If NOT @error Then EXIT PS: if u wanna search it on a line or column then use martin's example or for PixelSearch just don't keep x or y equales EX: pixelsearch(1,465,1024,465,0xFFA500, 5) Edited December 19, 2006 by Dizzydbd Link to comment Share on other sites More sharing options...
mikehunt114 Posted December 19, 2006 Share Posted December 19, 2006 OMG ppl i think this guy is more uncertain what to do now then before. 1st of all the function is Pixelgetcolor(x,y) . 465 is for sure not a coordonate.What planet are you from? Even though his syntax might have been incorrect, this is assuredly an y-coordinate. In case you didn't notice, that syntax error was corrected in the first reply. Second of all PixelGetColor is returning a decimal value and u are trying to compare it with a hex value >.<Correct. @OP: If you wish to match Hex values, use the Hex() or Dec() functions. Also u can use PixelSearch(x, y,x,y 0xFFA500, 5) ; same x and y as before (u can also use an interval) If NOT @error Then EXITIt is a bad habit to treat @error as a boolean value. @OP: $search = PixelSearch(0, 465, @DesktopWidth, 465, $color) If IsArray($search) Then Exit PS: if u wanna search it on a line or column then use martin's example or for PixelSearch just don't keep x or y equales EX: pixelsearch(1,465,1024,465,0xFFA500, 5)Martin's example was right on the nose, but your post is confusing since it refers to PixelSearch, not PixelGetColor such as Martin demonstrated. Your example is correct, if the screen's horizontal resolution is 1024 pixels. @DesktopWidth (also suggested by Martin) seems like a better option to me. In conclusion, Martin's posts showed a viable solution. I think only you were confused. IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
Dizzydbd Posted December 19, 2006 Share Posted December 19, 2006 actually i'm making game's scripts for some time and PixelSearch is best to use over PixelGetColor. And i wasn't confused at all ... i just didn't read all the posts entirely Link to comment Share on other sites More sharing options...
Kohr Posted December 19, 2006 Share Posted December 19, 2006 actually i'm making game's scripts for some time and PixelSearch is best to use over PixelGetColor. And i wasn't confused at all ... i just didn't read all the posts entirely Why would searching an area vs. searching 1 pixel be best? If you can accomplish the test on just a single pixel then it is more efficient.Kohr AutoIt LinksAutoIt CrapsGrid_PixelSearchAdvancedPixelGrab 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