PennController for IBEX › Forums › Support › Can we randomize time with newTimer() ? › Reply To: Can we randomize time with newTimer() ?
March 21, 2022 at 5:45 pm
#7934
Participant
All right! Thank you!!! Considering the Var method above,
timerd1duration = 400+Math.round(1200*Math.random()) // <------------- are we creating an object (such as we do in R?) i tried this, but it returned me an error. Shouldn't It be a a new Var too?
,
newTimer("timer-D1",timerd1duration).start().wait()
,
getText("D1").remove()
,
what about the D1 text? shouldn’t I keep it too? Would it be sth like this?
timerd1duration = 400+Math.round(1200*Math.random()) // (which returned the error)
,
newText("D1", "<br><b>+</b>")
.cssContainer({
"font-size":"100px",
"color":"blue"})
.center()
.print()
,
newTimer("timer-D1",400+Math.round(1600*Math.random()))
.start()
.wait()
,
getText("D1")
.remove()
,
etc
-
This reply was modified 3 years, 7 months ago by
Larissa_Cury.