Sign in to follow this  
Followers 0
bigassmuffin

Shade Variation

9 posts in this topic

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



In the help file.(Might only be beta I can't remember) Search for PixelSearch

Share this post


Link to post
Share on other sites

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.


Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by Valuater

NEWHeader1.png

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

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

you only need to change this one line..... to PixelSearch

YOU can do it

If (PixelGetColor(28, 59) == 0x6B7539) Then

8)


NEWHeader1.png

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


[center]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.[/center]

Share this post


Link to post
Share on other sites

ty, works gr8 SMOKE

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  
Followers 0