dickjones007 Posted May 13, 2011 Share 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 Link to comment Share on other sites More sharing options...
JohnOne Posted May 14, 2011 Share 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. Link to comment Share on other sites More sharing options...
wakillon Posted May 14, 2011 Share Posted May 14, 2011 (edited) While Loop continue because $bluepixel stay to the same value ! Edited May 14, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
dickjones007 Posted May 14, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
dickjones007 Posted May 14, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
dickjones007 Posted May 14, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
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