Jump to content

pixelchecksum dont work for me


Recommended Posts

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

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