Sign in to follow this  
Followers 0
lilandywandy

Need help

5 posts in this topic

While 1

If PixelGetColor(120,777) = Dec("7b7984") Then

Sleep(500)

Send("{F1}")

Sleep(7000)

Send("{F2}")

Sleep(200)

Send("{F1}")

Sleep(7000)

Send("{F2}")

Send("{F2}")

Sleep(200)

Send("{F2}")

EndIf

If PixelGetColor(368,707) = Dec("00f742") Then

Sleep(5000)

Else

MouseClick("right", 75,568, 1, 0)

MouseClick("right", 119,568, 1, 0)

MouseClick("right", 75,568, 1, 0)

MouseClick("right", 119,568, 1, 0)

MouseClick("right", 162,568, 1, 0)

MouseClick("right", 193,568, 1, 0)

MouseClick("right", 228,568, 1, 0)

EndIf

Wend

Func mExit()

Exit

EndFunc

for the part:

If PixelGetColor(368,707) = Dec("00f742") Then

Sleep(5000)

how come it sleeps after the mouse clicks? how can i make it sleep right when 368,707 turns to 00f42

Share this post


Link to post
Share on other sites



i think this should work:

If PixelGetColor(368,707) = Dec(0x00f742) Then 
Sleep(5000)
...

Mike

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

doesnt help =(

Edited by lilandywandy

Share this post


Link to post
Share on other sites

Just curious, is the else statement supposed to be there?

The way you have it it should read pixel color, and if it is true for the Dec() then sleep 5 seconds, but, you have the "Else" statement that says if it isn't true to do the mouseclicks.

Are you wanting it to "MouseClick" when the "If" statement is true only? Otherwise it looks ok.

See what you have is... a loop that continues to search for both "If" statements:

If PixelGetColor(120,777) = Dec("7b7984") Then

And

If PixelGetColor(368,707) = Dec("00f742") Then

Sleep(5000)

It continues this until you stop it... so after the "mouseclicks it goes through the series again... and ultimately hits the correct pixel color to sleep(5000) for PixelGetColor(368,707) = Dec("00f742").

Hope this helps.


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