dickjones007 Posted May 13, 2011 Posted May 13, 2011 (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) Edited May 13, 2011 by dickjones
JohnOne Posted May 14, 2011 Posted May 14, 2011 What makes you so sure that the If block is not being tested? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
wakillon Posted May 14, 2011 Posted May 14, 2011 (edited) While Loop continue because $bluepixel stay to the same value ! Edited May 14, 2011 by wakillon AutoIt 3.3.18.0 X86 - SciTE 5.5.7 - WIN 11 24H2 X64 - Other Examples Scripts
dickjones007 Posted May 14, 2011 Author Posted May 14, 2011 What makes you so sure that the If block is not being tested?because when i run IF without WHILE part it executes perfectly
dickjones007 Posted May 14, 2011 Author Posted May 14, 2011 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
dickjones007 Posted May 14, 2011 Author Posted May 14, 2011 While Loop continue because $bluepixel stay to the same value !i know but then area changes and while endsbut as i said i solved it
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now