Page 1 of 1

EOS HELP Bypassing an "Image Action" by using an "Eval Action"

Posted: Fri Feb 18, 2022 3:59 am
by mckig
I am trying to use a switch case to determine which image from a gallery or files to use. I want to do this instead of a lengthy nested "if else" statement where I put an image under the "if-then" statement and create another "If Action" under the "if-else" statement.

Is there the equivalent to "pages.goto(pageName)" for images, or am I out of luck? My knowledge of JavaScript isn't great so try to stay patient with me if there is a complex workaround.

I am using OEOS as well, if that has any options.

I'm trying to avoid first picture by doing some equivalent process in the second picture.

nested if statement
nested if statement
Screenshot 2022-02-17 225604.jpg (26.1 KiB) Viewed 1437 times
switch case, possible solution?
switch case, possible solution?
Screenshot 2022-02-17 225728.jpg (32.24 KiB) Viewed 1437 times

Re: EOS HELP Bypassing an "Image Action" by using an "Eval Action"

Posted: Fri Feb 18, 2022 5:00 am
by RemiHiyama
mckig wrote: Fri Feb 18, 2022 3:59 amIs there the equivalent to "pages.goto(pageName)" for images, or am I out of luck? My knowledge of JavaScript isn't great so try to stay patient with me if there is a complex workaround.
Vanilla EOS does not have an option for this, and it's annoying sometimes. OpenEOS does. https://github.com/fapnip/openeos/wiki/ ... ad-onerror

Re: EOS HELP Bypassing an "Image Action" by using an "Eval Action"

Posted: Fri Feb 18, 2022 10:07 am
by Domi-nation
Sadly, you can't do that with javascript since the js functions we can use are limited and we don't have access to the DOM.

On the other hand, you don't need to nest your if statements.

You can use :
if(attack === 'normal') image1
if (attack === 'weak and helpful') image2

Without using the else statement.

Re: EOS HELP Bypassing an "Image Action" by using an "Eval Action"

Posted: Sat Feb 19, 2022 3:06 am
by mckig
RemiHiyama wrote: Fri Feb 18, 2022 5:00 am Vanilla EOS does not have an option for this, and it's annoying sometimes. OpenEOS does. https://github.com/fapnip/openeos/wiki/ ... ad-onerror
Thanks for the help! I'll try this out and see how it works.
Domi-nation wrote: Fri Feb 18, 2022 10:07 am Sadly, you can't do that with javascript since the js functions we can use are limited and we don't have access to the DOM.

On the other hand, you don't need to nest your if statements.

You can use :
if(attack === 'normal') image1
if (attack === 'weak and helpful') image2

Without using the else statement.
If OEOS turns out to be tedious, I will definitely use this method instead! Thanks!