Paste into mirc remote (ALT + R) and type;
/typespeed
Hit start and fire away. post your records ;D .. or any bugs :/
Oh yeah, you need mdx, edit the mdx alias to mdx root file
Or use your own alias. MDX File can be found here: http://wfs.myartsonline.com/downloads/mdx.dll
Screenshot:
alias mdx {
;; EDIT THIS TO MDX.DLL LINK
return mdx.dll
}
on *:DIALOG:*:init:*: {
dll $mdx SetMircVersion $version
dll $mdx MarkDialog $dname
}
alias typespeed {
dialog $iif($dialog(typespeed),-v,-m) typespeed typespeed
}
dialog typespeed {
title "Type Speed"
option dbu
size -1 -1 200 63
edit "", 1, 2 2 196 10, read
edit "", 2, 2 15 196 10
button "Start", 3, 2 35 196 13
text "", 4, 2 52 196 20, center
}
on *:DIALOG:typespeed:init:*: {
did -b typespeed 1,2
}
on *:DIALOG:typespeed:sclick:*: {
if ($did == 3) {
typespeed.generate
did -ra typespeed 1 Generating word list .. (3)
}
}
on *:DIALOG:typespeed:edit:*: {
if ($did == 2) {
if ($did(2).text == $did(1).text) {
inc %typespeed.words.completed
inc %typespeed.chars.completed $len($did(1).text)
typespeed.newword
}
elseif ($mid($did(1).text,1,$len($did(2).text)) == $did(2).text) {
dll $mdx SetColor 2 background $rgb(43,251,64)
dll $mdx SetColor 2 textbg $rgb(43,251,64)
}
else {
dll $mdx SetColor 2 background $rgb(255,39,39)
dll $mdx SetColor 2 textbg $rgb(255,39,39)
}
}
}
on *:DIALOG:typespeed:close:*: {
.timertypespeed.* off
unset %typespeed*
.remove typespeedtemp.dat
}
alias typespeed.start {
did -e typespeed 1,2
typespeed.newword
set %typespeed.start $calc($gmt + 60)
set %typespeed.words.completed 0
set %typespeed.chars.completed 0
did -b typespeed 3
.timertypespeed.update 60 1 typespeed.update
.timertypespeed.end 1 60 typespeed.end
typespeed.update
}
alias typespeed.newword {
did -ra typespeed 1 $read(typespeedtemp.dat,$calc(%typespeed.words.completed + 1))
did -rf typespeed 2
typespeed.update
dll $mdx SetColor 2 background reset
dll $mdx SetColor 2 textbg reset
}
alias typespeed.update {
did -ra typespeed 4 %typespeed.words.completed Words Completed // $calc(%typespeed.start - $gmt) seconds to go ..
}
alias typespeed.end {
did -rab typespeed 1,2 Finished
did -e typespeed 3
dialog.notice Completed typespeed test! Results; $str($chr(160),80) Words typed: %typespeed.words.completed $str($chr(160),50) Characters typed %typespeed.chars.completed
}
alias typespeed.generate {
if ($dialog(typespeed)) {
set %typespeed.generate.left 3
write -c typespeedtemp.dat
if ($sock(typespeed)) {
sockclose typespeed
}
sockopen typespeed www.unique-names.com 80
}
}
on *:SOCKOPEN:typespeed: {
sockwrite -nt $sockname GET /random-word.php HTTP/1.1
sockwrite -nt $sockname Host: www.unique-names.com
sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:typespeed: {
var %x
sockread %x
if ($regex(%x,</script><br/><h3 class='l'>Random Words</h3><table><tr><td valign="top"><ul>(.*)</ul></td><td valign="top"> </td></tr></table><br/><div>)) {
var %wl = $remove($replace($regml(1),<li>,$chr(32)),</li>,</ul></td><td valign="top"><ul>), %y = 1
while (%y <= $numtok(%wl,32)) {
write typespeedtemp.dat $gettok(%wl,%y,32)
inc %y
}
if (%typespeed.generate.left > 0) {
did -ra typespeed 1 Generating word list .. ( $+ %typespeed.generate.left $+ )
dec %typespeed.generate.left
sockclose typespeed
sockopen typespeed www.unique-names.com 80
}
else {
sockclose typespeed
typespeed.start
}
}
}
alias dialog.notice {
dialog $iif($dialog(dialog.notice),-v,-m) dialog.notice dialog.notice
did -ra dialog.notice 1 $1-
did -f dialog.notice 2
}
dialog dialog.notice {
size -1 -1 150 60
title "Notice"
option dbu
edit "", 1, 2 2 146 40, autovs vsbar multi read
button "Ok", 2, 98 44 50 13, ok
}