user3001055
user3001055

Reputation: 143

iMacros Javascript MouseEvent

how to detect 'You Win!' or 'You Lose!' content to implement different tasks.

Currently I'm using this method :

Main.iim

returncode = iimPlay("betwin.iim");
if (returncode == 1 ) {
min_submit(); //doing task 1
}

var returncode2 = iimPlay("betlose.iim");
if (returncode2 == 1 ){
double_submit(); //doing task 2             
}

Betwin.iim

TAG POS=1 TYPE=DIV ATTR=ID:win CONTENT=EVENT:MOUSEOVER

Betlose.iim

TAG POS=1 TYPE=DIV ATTR=ID:lose CONTENT=EVENT:MOUSEOVER

HTML

<div id="result" class="center">
    <div id="win" class="bold center">You Win!</div>
    <div id="lose" class="bold center"></div>
</div>

Since the page always contain the two divs, so the betwin and betlose always true return 1. Is there anyway to detect the content of div tag ?

Upvotes: 1

Views: 935

Answers (1)

edinvnode
edinvnode

Reputation: 3547

<div id="result" class="center">
    <div id="win" class="bold center">You Win!</div>
    <div id="lose" class="bold center"></div>
</div>

If I am correct in this case text that appears is You Win! So try to use these codes.

Betwin.iim

TAG POS=1 TYPE=DIV ATTR=ID:win&&:You<SP>Win* CONTENT=EVENT:MOUSEOVER

Betlose.iim

TAG POS=1 TYPE=DIV ATTR=ID:lose&&TXT:You<SP>Lose* CONTENT=EVENT:MOUSEOVER

Check is the Betlose.iim text You Lose!. If not try to use correct text.

Upvotes: 1

Related Questions