**(event: //[[harlowe:lambda|Lambda]]//) → //[[harlowe:changer|Changer]]//** Hooks that have this [[harlowe:changer|changer]] attached will only be run when the given condition becomes true. === Example usage: === ''%%(event: when time > 5s)[Oops, I forgot the next link: [[Go east]].]%%'' === Rationale: === While the [[harlowe:live|(live:)]] macro is versatile in providing time-based text updating, one of its common uses - checking if some variable has changed using [[harlowe:if|(if:)]], and then displaying a hook and stopping the macro with [[harlowe:stop|(stop:)]] - is rather cumbersome. This macro provides that functionality in a shorter form - the example above is equivalent to: ''%%{(live: 0.2s)[ (if: time > 5s)[ Oops, I forgot the next link: [[Go east]]. ] ]}%%'' === Details: === This macro only takes a "when" [[harlowe:lambda|lambda]], which is like a "where" lambda but with "where" changed to "when" for readability purposes. This lambda doesn't have a temp variable before "when" - it doesn't iterate over anything, except, perhaps, moments in time. Because (event:) hooks only run once, the [[harlowe:stop|(stop:)]] macro is unnecessary here. Currently, you **cannot** attach (event:) to a [[harlowe:command|command]] (such as in ''%%(event: when $a is 1)(link-goto:"?")%%''). You have to wrap the command in a hook (such as ''%%(event:when $a is 1)[(link-goto:"?")]%%''). === See also: === [[harlowe:live|(live:)]]