Jump to content
Sign in to follow this  
ForsakenGod

Pixelsearch

Recommended Posts

ForsakenGod

Hello,

I want to say i am new to autoit and its great features . I ve tried alot today but idk why i cant fix it . I am trying to make an program that would search for 2 colors in a given area . If there is 1 color spotted it should sleep for x time and check if the color is still there if yes sleep 2 more times and then perform an action if the color changes it should perform an action . Anyone who can help me with it ? I dont know how to make an search for 2 colors it would be on small area so i dont really care about speed of search just please explain me how to do it step by step . And also if someone would be so kind i would like to know how to make more complicated conditions like if the color is there and pixelsearch found the color and i ve slept the x time etc . Also is there possibility to force the programm to check for the change of color while it sleeps ?

Here is what i ve done so far i dont know whats bad but it gives me error . Started with AutoIt today :)

$color = PixelSearch(1537 ,22 ,1549 ,515)

if $color = 0xFFFF00 Then
    MouseClick("left",102,55,1,0)
    Sleep( 4000)
    MouseClick("left",1048,729,1,0)
else if $color = 0x8000FF Then
    MouseClick("left",23,59,1,0)
    Sleep( 4000)
    MouseClick("left",1048,729,1,0)

If anyone could help me it would be great.

Thank you for your time.

Unreal

Share this post


Link to post
Share on other sites
ForsakenGod

ok ill try it out ay other suggestions ? :)

Share this post


Link to post
Share on other sites
Kiroshi

don't forget to end your if statements

Share this post


Link to post
Share on other sites
jvanegmond

ForsakenGod, keep your questions about one particular topic in one thread.

http://www.autoitscript.com/forum/index.php?showtopic=105565

Edited by Manadar

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  

×