# 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

##### Share on other sites

i think this should work:

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

Mike

##### Share on other sites

doesnt help =(

Edited by lilandywandy
##### Share on other sites

Because the colour isn't 0x00F742.. original question.

qq

##### 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.

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
×
• Create New...