It looks like you're new here. If you want to get involved, click one of these buttons!
Menu option one <span id="suc5">(5 success)</span> Menu option two <span id="suc10">(10 success)</span> Success: <<set $rate to 0>><span id="success-rate">$rate</span> <<set $bReady to false>> <<set $cDown to 10>><span id="countdown">$cDown</span> seconds remaining! <span id="statusQ"></span> <<button "the button">> <<if $bReady is true>> <<set $randPoint to random(5)>> <<if $randPoint eq 2 or $randPoint eq 3>> <<set $rate to 0>> <<else>> <<set $rate++>> <</if>> <<replace "#success-rate">>$rate<</replace>> <<if $rate eq 5>> <<replace "#suc5">> <a data-passage="Hell" class="karma-link">Open</a><</replace>> <<elseif $rate eq 10>> <<replace "#suc10">> <a data-passage="Heaven" class="karma-link">Open</a><</replace>> <</if>> <<else>> <<replace "#statusQ">>not yet!!<</replace>> <</if>> <</button>> <<set $command to "<<timed 1s>>">> <<for $i to 0; $i lt $cDown; $i++>> <<set $command += "<<set $cDown -= 1>><<replace \"#countdown\">>$cDown<</replace>><<set $bReady to false>><<next>>">> <</for>> <<set $command += "<<replace \"#countdown\">>Ready<</replace>><<replace \"#statusQ\">><</replace>><<set $bReady to true>><</timed>>">> <<print $command>>
Comments
Anyway, the following should be more or less what you wanted: You'll note that I made it disable the button, so that it cannot be clicked on, and moved the timer display nearer to the button, to make it look a bit nicer.