Page 1 of 1

Eos question.

Posted: Tue Apr 14, 2020 2:36 pm
by ChaChan
I was wondering if it was possible to have 2 Goto lines in a row. Where the first Goto would lead to an Enabled page(s) at first but later on it would lead to Disabled page(s) but would get ignored because of that. Then it would choose the next Goto line which would lead to an Enabled page(s).

Re: Eos question.

Posted: Tue Apr 14, 2020 5:16 pm
by undeniable_denial
From the help page:
Pages can be "enabled" or "disabled". The only difference is that when using a Goto action with a wildcard target, e.g. "page*", only enabled pages will be considered as possible targets.
For example, let's assume your pages are called repeatA (enabled) and repeatB (disabled).
A Goto-action with a pattern repeat* will 100% goto repeatA, because it's the only one enabled.
You can then disable A and enable B and the next time it will go the other way.

Re: Eos question.

Posted: Tue Apr 14, 2020 8:16 pm
by fapnip
While undeniable_denial probably answers your question better with a correct solution, I'll give a more direct answer:

No. If you have two gotos, one right after the other, the second will never trigger. If the first goto doesn't have any enabled pages it will fail, log an error on the console, and never continue to the second. If it has enabled pages, it will go to one of those, never continuing to the second goto.

If you wanted to implement a terrible hack (please don't), you could put a 0.1s asynchronous hidden timer before the first goto with what would have been your second goto action. In this case, if the first goto fails, the goto in the asynchronous timer would pick up the slack. But, if the second goto doesn't contain any enabled pages, it would fail as well. Regardless, it would be far better to structure your pages in a way that wouldn't require such a hack.

Re: Eos question.

Posted: Tue Apr 14, 2020 9:46 pm
by undeniable_denial
Fair point, but I would like to clarify, that you can indeed go to a disabled page if there is an exact match. The disabling-functionality only affects the wildcard-patterns and it seemed to me that relying on that functionality was ChaChan's primary intention with stacking Gotos being an attempt to get there.

Re: Eos question.

Posted: Tue Apr 14, 2020 10:22 pm
by fapnip
Good point. Yes, enable/disable only applies to wildcard matches.

It seemed like ChaChan was after a way to move on to one group of pages after another group had been exhausted? If so, I suppose my hack work work for that -- but again, I'm hesitant to recommend anyone use it.

Re: Eos question.

Posted: Wed Apr 15, 2020 6:40 pm
by kerkersklave
I would just use an if-action to do that.
You can check using the API whether a page is enabled or just use your own variable.

Re: Eos question.

Posted: Wed Apr 15, 2020 7:14 pm
by fapnip
kerkersklave wrote: Wed Apr 15, 2020 6:40 pmYou can check using the API whether a page is enabled
For a single page, yes, but I don't think there's a way to do that for a group of pages, is there? Does pages.isEnabled('page-group-*') work?

Re: Eos question.

Posted: Thu Apr 16, 2020 10:44 am
by kerkersklave
fapnip wrote: Wed Apr 15, 2020 7:14 pm
kerkersklave wrote: Wed Apr 15, 2020 6:40 pmYou can check using the API whether a page is enabled
For a single page, yes, but I don't think there's a way to do that for a group of pages, is there? Does pages.isEnabled('page-group-*') work?
Hm, no, probably not. Maybe you can enumerate all pages and resolve the wildcard yourself.

Re: Eos question.

Posted: Sat Apr 18, 2020 5:27 am
by ChaChan
Well, thanks for your replies guys. I´m not gonna implement the hack and coding aint my strongpoint either, so guess
i´ll add more pages then.