bigassmuffin Posted June 1, 2006 Share Posted June 1, 2006 I have this code, (It's longer...just afer someone can help with this, I can figure the rest out), and I want a shade variation, like any shade of the color within lets say 010, it will still continue the options... While 1 If (PixelGetColor(28, 59) == 0x6B7539) Then ;If pixel color is 0x6B7539 MouseMove(28, 59, 0) ;then move to mouse coordinates (28, 59) MouseDown ( "left" ) ;and left click the mouse Sleep(5000) ;Wait 5 seconds SomeFunction() ;Start Some Function EndIf WEnd Func SomeFunction() If (PixelGetColor(985, 359) == 0x7B96DE) Then ;If pixel color is 0x6B7539 MouseMove(985, 359, 0) ;then move to mouse coordinates (28, 59) MouseDown ( "left" ) ;and left click the mouse Sleep(5000) ;Wait 5 seconds SomeOtherFunction() ;Start Some Function EndIf EndFunc;==>SomeFunction Func SomeOtherFunction() EndFunc;==>SomeOtherFunction ------------------------------------------------------------------- So in the codes: If (PixelGetColor(28, 59) == 0x6B7539) Then and If (PixelGetColor(985, 359) == 0x7B96DE) Then I want the colors 0x6B7539 and 0x7B96DE to be varied 10 colors or a sahde of colors.. THANKS FOR ANY HELP ~bigassmuffin Link to comment Share on other sites More sharing options...
bucky002 Posted June 1, 2006 Share Posted June 1, 2006 In the help file.(Might only be beta I can't remember) Search for PixelSearch Link to comment Share on other sites More sharing options...
Nomad Posted June 1, 2006 Share Posted June 1, 2006 No, pixelsearch exists in the non-beta version, and you'll need it for a shade variation, pixelcheck doesn't accept a shade variation. Just make the search area small, like a 2x2 area. Link to comment Share on other sites More sharing options...
Valuater Posted June 1, 2006 Share Posted June 1, 2006 (edited) Bucky is correct... remember that pixelgetcolor searches this amount of area "." ( one dot ) while pixelsearch allows for a small boxed area ( you define ) and color varience you also should have a small sleep in your while/Wend loop 8) ... Nomad is correct also Edited June 1, 2006 by Valuater Link to comment Share on other sites More sharing options...
bigassmuffin Posted June 1, 2006 Author Share Posted June 1, 2006 so can someone use the same coords and stuff that I did to do same settings but with the pixel search with a 1*1 box or something? Id appreciate this SO much Link to comment Share on other sites More sharing options...
Valuater Posted June 1, 2006 Share Posted June 1, 2006 so can someone use the same coords and stuff that I did to do same settings but with the pixel search with a 1*1 box or something?Id appreciate this SO muchyou only need to change this one line..... to PixelSearchYOU can do itIf (PixelGetColor(28, 59) == 0x6B7539) Then 8) Link to comment Share on other sites More sharing options...
bigassmuffin Posted June 1, 2006 Author Share Posted June 1, 2006 It's not working, I now have: While 1 If $coord = PixelSearch( 28, 59, 28, 59, 0x6B7539, 10 ) Then ;If pixel color is 0x6B7539 MouseMove(28, 59, 0) ;then move to mouse coordinates (28, 59) MouseDown ( "left" ) ;and left click the mouse Sleep(5000) ;Wait 5 seconds SomeFunction() ;Start Some Function EndIf WEnd Func SomeFunction() If $coord = PixelSearch( 28, 59, 28, 59, 0x7B96DE, 10 ) Then ;If pixel color is 0x7B96DE MouseMove(985, 359, 0) ;then move to mouse coordinates (28, 59) MouseDown ( "left" ) ;and left click the mouse Sleep(5000) ;Wait 5 seconds SomeOtherFunction() ;Start Some Function EndIf EndFunc;==>SomeFunction Func SomeOtherFunction() EndFunc;==>SomeOtherFunction I get an error though.., Any help please? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 1, 2006 Moderators Share Posted June 1, 2006 Did you look on how to see what PixelSearch() returns if successful in the help file?While 1 $coord = PixelSearch( 28, 59, 28, 59, 0x6B7539, 10 ) If IsArray($coord) Then ;If pixel color is 0x6B7539 MouseClick("left", 28, 59, 1, 1) ;then move to mouse coordinates (28, 59) Sleep(5000) ;Wait 5 seconds SomeFunction() ;Start Some Function EndIf WEnd Func SomeFunction() $coord = PixelSearch( 28, 59, 28, 59, 0x7B96DE, 10 ) If IsArray($coord) Then ;If pixel color is 0x7B96DE MouseClick("left", 985, 359, 1, 1) ;then move to mouse coordinates (28, 59) Sleep(5000) ;Wait 5 seconds SomeOtherFunction() ;Start Some Function EndIf EndFunc;==>SomeFunction Func SomeOtherFunction() EndFunc;==>SomeOtherFunction Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
bigassmuffin Posted June 1, 2006 Author Share Posted June 1, 2006 ty, works gr8 SMOKE 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