vendredi 31 juillet 2015

Imacros if else error

Hello stackoverflow i need you help with a script im trying to make. The script im trying to make is a cointoss script that does the following.

The first part i want it to do is insert a amount i want to play with.

If i win insert same value as the first bet and set my datasource back to the first line.

If i loose use datasource to insert a new value and play again.

Here is what i came up with:

Cointoss.js

VERSION BUILD=8920312 RECORDER=FX

SET !DATASOURCE cointoss25.csv
SET !DATASOURCE_COLUMNS 1
SET !DATASOURCE_LINE {{!LOOP}}

if(iimPlay(WIN.iim)>0)
{
iimPlay(WINPLAY.iim)
}
else if(iimPlay(LOOSE.iim)>0)
{
iimPlay(LOOSEPLAY.iim)
}

WIN.iim Script

SEARCH SOURCE=TXT:"You guessed right! You win"

WINPLAY.iim Script

TAG POS=1 TYPE=A ATTR=TXT:PLAY<SP>AGAIN
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:bet CONTENT=25
TAG POS=1 TYPE=IMG ATTR=SRC:http://ift.tt/1KEZmid
SET !DATASOURCE_LINE 1

LOOSE.iim Script

SEARCH SOURCE=TXT:"You guessed wrong. Try again!"

LOOSEPLAY.iim Script

TAG POS=1 TYPE=A ATTR=TXT:PLAY<SP>AGAIN
TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:bet CONTENT={{!COL1}}
TAG POS=1 TYPE=IMG ATTR=SRC:http://ift.tt/1KEZmid

The problem is i keep getting this error:

SyntaxError: missing ; before statement, line NaN (Error code: -991)

Aucun commentaire:

Enregistrer un commentaire