Page 1 of 1

Stuck with if functions

Posted: Thu Jan 20, 2022 9:17 pm
by 19Hellothere83
Hi to everyone

I am going crazy.
Trying to make an estim tease
But i am stuck on an evaluation page
See attachment

Explanation:
Imagecat can be a number from 1-9
It is set prior in the tease
On this page i must check the variable imagecat
If it is between 1 and 3 i send the tease to a certain page
If its not between 1-3 the tease send the player to another page

But it doesnt get over the page. I checked by using say and the tease gets stuck at the first if

Please help me :\'-(

Re: Stuck with if functions

Posted: Thu Jan 20, 2022 11:29 pm
by kerkersklave
Remove the semi-colon in all cases. A semi-colon ends a statement in Javascript. The if-actions in EOS expect an expression, i.e. something that evaluates to a value. If you end something in ; you do not care about the value it evaluates to, often it might not even have such a value. You just care about the side effect, so ; is only used, when you have a list of statements.

In most places in EOS you will only need an expression. There are only a few cases, where you can have multiple statments, e.g. eval-actions, the initial script.

Re: Stuck with if functions

Posted: Fri Jan 21, 2022 12:24 pm
by 19Hellothere83
The semicolon was the issue. Thanks a lot 😊