How fast can you get from A-Z on your keyboard?
Take this test & find out :)
Simple snippet for when you're bored, hammer those keys & try for a new record. Post your records here! =D
menu * {
-
A-Z Speed Test:azspd
}
alias azspd dialog $iif($dialog(azspd),-v,-m azspd) azspd
alias azspd.upd did -ra azspd 2 $+($round($calc(($ticks - %azspd.sta) /1000),2),s)
alias azspd.currchr noop $regex($did(azspd,3),/\[(.)\]/) | return $regml(1)
alias azspd.currloc noop $regex($did(azspd,3),/(.*)\[.\]/) | return $len($regml(1))
dialog azspd {
title A-Z Speed Test
size -1 -1 200 90
option pixels
text Time --, 1, 10 10 40 20
text 0.00s, 2, 50 10 40 20
text [A]BCDEFGHIJKLMNOPQRSTUVWXYZ, 3, 10 30 200 20
edit "", 4, 10 60 40 20, center
button Exit, 5, 90 59 100 21, cancel
}
on *:dialog:azspd:*:*: {
if $devent == init { did -f $dname 4 | unset %azspd.* }
elseif $devent == edit && $did == 4 {
if !%azspd.sta && $did(4) == A { set %azspd.sta $ticks | .timerazspd 0 0 azspd.upd }
elseif $did(4) == Z && $azspd.currloc == 25 { .timerazspd* off | dialog -x $dname | noop $input(Test completed in -- $+($round($calc(($ticks - %azspd.sta) /1000),2),s!),oi,A-Z Info) | halt }
if $did(4) == $azspd.currchr { var %yx = ABCDEFGHIJKLMNOPQRSTUVWXYZ | did -ra $dname 3 $left(%yx,$calc($azspd.currloc +1)) $+ $+([,$mid(%yx,$calc($azspd.currloc +2),1),]) $+ $right(%yx,$calc(24- $azspd.currloc)) }
did -r $dname 4
}
elseif $devent == close { unset %azspd.* | .timerazspd* off }
}
awesome script!
You're still missing the exit button though :P
elseif $devent == sclick && $did == 5 { .dialog -x $dname }
Also you need to unset the variables and timer on $devent == init as well because sometimes it's just not doing it when the dialog closes
if $devent == init { unset %azspd.* | .timerazspd* off | did -f $dname 4 }
I'm really enjoying this xD