I'm created two variables that play different iimPlay functions. However, the code always execute the first if statement and ignore the 2nd statement.
Main.js
var ReturnCode = iimPlay("win.iim");
var returncode2 = iimPlay("lose.iim"); //
if (ReturnCode = 1) { *//when returncode =1 means complete execute*
iimPlay("reset.iim");
}
if (returncode2 = 1 ) {
iimPlay("double.iim");
}
Win.iim
IMAGESEARCH POS=1 IMAGE=C:\win.png CONFIDENCE=65
imagesearch will always execute no matter match or not
Lose.iim
IMAGESEARCH POS=1 IMAGE=C:\lose.png CONFIDENCE=65
imagesearch will always execute no matter match or not
HTML tag
<div id="game-result" class="balance-change fail">
<span id="result-text">
LOST
</span> </div>
Problem : Whenever the iimPlay("win.iim") detects win or lose image, it still execute the first statement as fact that lose image should execute the second if statement.