m pretty proud at this script :)
especially cause i found a way to make it millisecond precise lol
typ /reaction or push F7 to start
then it explains it all really...
it just checks how fast ur reaction is
my highscore, 204ms lol
alias reaction {
/window -c @reaction
window -paCk0 +bfnt @Reaction -1 -1 300 300
/drawtext @reaction 4 2 5 Push the dot when the color changes!
/drawtext @reaction 4 2 25 Top score: $iif(%topscore == $null,0,%topscore)
var %timer = $r(2000,8000)
.timer -m 1 %timer /react
}
alias f7 {
/window -c @reaction
window -paCk0 +bfnt @Reaction -1 -1 300 300
/drawtext @reaction 4 2 5 Push the dot when the color changes!
/drawtext @reaction 4 2 25 Top score: $iif(%topscore == $null,0,%topscore)
var %timer = $r(2000,8000)
.timer -m 1 %timer /react
}
on *:input:@result:{
if ($1 == quit) {
window -c @result
window -c @reaction
unset %dot
}
if ($1 == restart) {
/unset %dot
window -c @result
window -c @reaction
/reaction
}
}
on *:close:@Reaction:{
.timers off
window -c @result
unset %dot
}
menu @Reaction {
sclick:{
if (!%dot) {
window -c @reaction
}
if (%dot) {
var %time = $calc($ticks - %dot)
if (%time < %topscore) || (!%topscore) {
window -e @Result -1 -1 400 200
echo @Result Woohoo Good-job u have a new highscore!!
echo @result new top time is: %time
set %topscore %time ms
}
elseif (%time == %topscore) {
window -e @Result -1 -1 400 200
echo @Result Well good-job u have the exact same speed ;)
echo @result ur speed was %time
}
elseif (%time > %topscore) {
window -e @Result -1 -1 400 200
echo @Result Oh oh, that wasnt such a good time ;)
echo @result ur highscore is %topscore $+ , this score was %time
}
echo @result Wanna try again? typ restart in the edit-box
echo @result wanna quit? typ quit in the edit-box
}
}
}
alias react {
set %dot $ticks
/drawdot @reaction $r(4,13) 100 150 150
}