totoita Posted February 28, 2016 Share Posted February 28, 2016 (edited) Hi, Windows 7 64 bits Autoit 3.5.4 Adding an or in my while loop create a problem, even if 1 comparison is true it won t exit the while. This did not work, it won t exit the will loop, even if $resultt5 return 1 Local $resultt1 = 10 Local $resultt2 = 10 Local $resultt3 = 10 Local $resultt4 = 10 Local $resultt5 = 10 ConsoleWrite(@CRLF & "in the cherche function:" & @CRLF) While ( $resultt1 <> 1 or $resultt2 <> 1 or $resultt3 <> 1 or $resultt4 <> 1 or $resultt5 <> 1 ) $resultt1 = _ImageSearchArea('gc11.bmp', 1, 988, 300, 1498, 860, $xobjectivepos, $yobjectivepos, 85) $resultt2 = _ImageSearchArea('gc12.bmp', 1, 988, 300, 1498, 860, $xobjectivepos, $yobjectivepos, 85) $resultt3 = _ImageSearchArea('gc13.bmp', 1, 988, 300, 1498, 860, $xobjectivepos, $yobjectivepos, 85) $resultt4 = _ImageSearchArea('gc14.bmp', 1, 988, 300, 1498, 860, $xobjectivepos, $yobjectivepos, 85) $resultt5 = _ImageSearchArea('gc5.bmp', 1, 988, 300, 1498, 860, $xobjectivepos, $yobjectivepos, 85) ConsoleWrite("cherche 5:" & $resultt5 & @CRLF) ; return 1 ConsoleWrite("cherche 1:" & $resultt1 & @CRLF); return 0 sleep (100) WEnd ConsoleWrite("crate result ds fct cherche:" & @CRLF & $resultt1 & @CRLF & $resultt2 & @CRLF & $resultt3 & @CRLF & $resultt4 & @CRLF & $resultt5 & @CRLF) MouseMove($xobjectivepos, $yobjectivepos,0) This work, it exit the while loop Local $resultt1 = 10 Local $resultt2 = 10 Local $resultt3 = 10 Local $resultt4 = 10 Local $resultt5 = 10 ConsoleWrite(@CRLF & "in the cherche function:" & @CRLF) While ( $resultt5 <> 1 ) $resultt1 = _ImageSearchArea('gc11.bmp', 1, 988, 300, 1498, 860, $xobjectivepos, $yobjectivepos, 85) $resultt2 = _ImageSearchArea('gc12.bmp', 1, 988, 300, 1498, 860, $xobjectivepos, $yobjectivepos, 85) $resultt3 = _ImageSearchArea('gc13.bmp', 1, 988, 300, 1498, 860, $xobjectivepos, $yobjectivepos, 85) $resultt4 = _ImageSearchArea('gc14.bmp', 1, 988, 300, 1498, 860, $xobjectivepos, $yobjectivepos, 85) $resultt5 = _ImageSearchArea('gc5.bmp', 1, 988, 300, 1498, 860, $xobjectivepos, $yobjectivepos, 85) ConsoleWrite("cherche 5:" & $resultt5 & @CRLF) ; return 1 ConsoleWrite("cherche 1:" & $resultt1 & @CRLF); return 0 sleep (100) WEnd ConsoleWrite("crate result ds fct cherche:" & @CRLF & $resultt1 & @CRLF & $resultt2 & @CRLF & $resultt3 & @CRLF & $resultt4 & @CRLF & $resultt5 & @CRLF) MouseMove($xobjectivepos, $yobjectivepos,0) Someone might help me to debug this ? Do not comment the same variable for $xobjectivepos and $yobjectivepos in the imagesearch parameters, i know i have to fix this...it s not the pbl. Thanks. Ps:how do i delete a post in this forum? (see the post below) Edited February 28, 2016 by totoita Link to comment Share on other sites More sharing options...
totoita Posted February 28, 2016 Author Share Posted February 28, 2016 (edited) 4 minutes ago, totoita said: Edited February 28, 2016 by totoita Link to comment Share on other sites More sharing options...
Developers Jos Posted February 28, 2016 Developers Share Posted February 28, 2016 You need an AND relation in your test in stead of an OR! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
totoita Posted February 28, 2016 Author Share Posted February 28, 2016 (edited) ok.. thought or statement was working like 0 or 0 or 0 or 0 or 1 = 1 so true and statement was working like 0 and 0 and 0 and 0 and 1 = 0 so false I probably mix this with another language..well..i will try thanks for helping..it works ( I just try) Edited February 28, 2016 by totoita 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