Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

random delay using macro timed in sugarcube 2

edited December 2015 in Help! with 2.0
is it possible to add random delay for timed macro ? here's my code
<<set $myDelay to random(5,15)>>
<<timed $myDelay>>
  // we will do something here 
<</timed>>

if it's not possible, can you show me another method so i can have similar function like that ?

any help will be appreciated. thx before

Comments

  • edited December 2015
    Yes. You simply need to format the delay properly. As noted in the documentation, the delay argument must be a valid CSS time value (e.g. 5s or 500ms). So, assuming you're attempting a delay of 5–15 seconds, you'd want something like the following:
    <<set $myDelay to random(5, 15) + "s">>
    
  • awesome .... thx TME
Sign In or Register to comment.