Jump to content

Need help


Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...