Hi,
I wrote a (live:) function that alternates the response output based on checking against variable values:
(live: 5s)
[
(if: $battle is 0 and $attack is 0)
[
<p>Defend.</p>
(put: 1 into $attack)
(put: 1 into $battle)
]
(elseif: $battle is 0 and $attack is 1)
[
<p>Attack.</p>
(put: 0 into $attack)
(put: 1 into $battle)
]
(else:)
[
<p>Alternate.</p>
(put: 0 into $battle)
]
]
This works great, but it takes 5 seconds for anything to show up onscreen.
What I would like to do is print something onscreen when the passage loads and then have it replaced by the (live:) function.
I am able to do this by including a (goto:) function within the (live:) function, but that creates a loop issue that I can’t fix, even with a (stop:) function (e.g., even after going to other passages, the timer continues to run and the passage continues to load). Of course, I could be implementing the (stop:) function incorrectly, so any help with that would be appreciated.
Regardless, I would like to know if anyone has a method oc accomplishing what I want to do.
Thanks!
Tim
Comments
1. Create the passage to store the modified version of your logic, I have named it Logic but you can name it whatever you like. 2. Modify your original main passage to look like the following:
As you have noted the (live:) macro does nothing until the time period you supply has passed and then once it starts it will continue to do whatever you have asked it to do forever until you either close down the tab/browser or you use a (stop:) macro to stop it.
Another question though, if you don’t mind… Is there a way to trigger the (stop:) macro if it’s not in the hook, for instance, with a link click?
T.
eg. Something like the following: You can then use something like a (click:) (or any other interactive event) to change the variable to true:
T.