Sign in to follow this  
Followers 0
dickjones007

pixelchecksum dont work for me

6 posts in this topic

#1 ·  Posted (edited)

this is my code, why doesnt it work?

$checksum0 = PixelChecksum(355+129,145+1, 400+129,190+1)
$checksum1 = PixelChecksum(460+129,145+1, 505+129,190+1)
$checksum2 = PixelChecksum(510+129,145+1, 555+129,190+1)
$checksum3 = PixelChecksum(560+129,145+1, 605+129,190+1)
$bluepixel = PixelChecksum(380+129,150+1, 380+129,150+1)
;~  MsgBox(0,0,$checksum0)
;~  MsgBox(0,0,$checksum1)
;~  MsgBox(0,0,$checksum2)
;~  MsgBox(0,0,$checksum3)
 
While $bluepixel = PixelChecksum(380+129,150+1, 380+129,150+1)
  Sleep(1000)
WEnd
    
Sleep(3000)
If $checksum0=$checksum1 Then
    Sleep(1000)
    MouseClick("primary",480+129,170)
ElseIf $checksum0=$checksum2 Then
    Sleep(1000)
    MouseClick("primary",530+129,170)
ElseIf $checksum0=$checksum3 Then
    Sleep(1000)
    MouseClick("primary",580+129,170)
EndIf

from the code you can see what i am trying to do, but what this code does is it just exits after WEND loop. it does not continue to IF condition.

but when i disable WEND then IF works just fine.

how to continue script after WENDy is satisfied (fullfilled) :unsure:

Edited by dickjones

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

While Loop continue because $bluepixel stay to the same value !

Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

What makes you so sure that the If block is not being tested?

because when i run IF without WHILE part it executes perfectly

Share this post


Link to post
Share on other sites

solved it

i just had to move $checksums behind WHILE and it works

didnt know that kind of syntax is important

now it works just the way i want it

$bluepixel = PixelChecksum(380+40,150+6, 380+40,150+6)

While $bluepixel = PixelChecksum(380+40,150+6, 380+40,150+6)
  Sleep(1000)
WEnd

$checksum0 = PixelChecksum(355+42,145+6, 400+42,190+6)
$checksum1 = PixelChecksum(460+40,145+6, 505+40,190+6)
$checksum2 = PixelChecksum(510+40,145+6, 555+40,190+6)
$checksum3 = PixelChecksum(560+40,145+6, 605+40,190+6)
    
Sleep(3000)
If $checksum0=$checksum1 Then
    Sleep(1000)
    MouseClick("primary",480+42,170)
ElseIf $checksum0=$checksum2 Then
    Sleep(1000)
    MouseClick("primary",530+42,170)
ElseIf $checksum0=$checksum3 Then
    Sleep(1000)
    MouseClick("primary",580+42,170)
EndIf

every day is a new experience :unsure:

Share this post


Link to post
Share on other sites

While Loop continue because $bluepixel stay to the same value !

i know but then area changes and while ends

but as i said i solved it :unsure:

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