Jump to content
Sign in to follow this  
bigassmuffin

Shade Variation

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...