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

Post all technical issues and questions here. We'll gladly help you wherever we can.
Post Reply
mckig
Explorer
Explorer
Posts: 39
Joined: Sat Jan 04, 2020 2:57 pm

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

Post 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 865 times
switch case, possible solution?
switch case, possible solution?
Screenshot 2022-02-17 225728.jpg (32.24 KiB) Viewed 865 times
RemiHiyama
Explorer At Heart
Explorer At Heart
Posts: 203
Joined: Thu Feb 28, 2019 3:30 pm
I am a: Switch

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

Post 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
Auto: Replaces selected instances of the word "not" with the word "definitely".
Domi-nation
Explorer
Explorer
Posts: 38
Joined: Fri Sep 29, 2017 8:35 am

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

Post 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.
mckig
Explorer
Explorer
Posts: 39
Joined: Sat Jan 04, 2020 2:57 pm

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

Post 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!
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests