Type Speed Test

By Jonesy44 on Aug 12, 2008

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:
Image

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">&nbsp;</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
}

Comments

Sign in to comment.
Jonesy44   -  Oct 25, 2008

You dont have to get through each one...

 Respond  
Bullet_Dodger   -  Oct 25, 2008

To many words lolol 8/10

 Respond  
Jonesy44   -  Aug 12, 2008

Okay, i\'ve found a few good sounds; i\'ll add them in with a check to see if they are actually there on each system so you dont get all these annoying errors :P

 Respond  
NIGathan   -  Aug 12, 2008

Cool :D

 Respond  
Jonesy44   -  Aug 12, 2008

okay sweet. i\'ll checkit out :D

 Respond  
NIGathan   -  Aug 12, 2008

\"C:/WINDOWS/Media/Windows XP Ding.wav\" is the sound you hear if you try to backspace too much, it would be good for it.

Hmm the slashes disappeared :/ I replaced them with backslashes

 Respond  
Jonesy44   -  Aug 12, 2008

The time limit isn\'t all that important, as long as it gives a relative number. so 2 minutes would be words/2

And if you know of a default windows beep or something. i\'ll add an splay :P

 Respond  
NIGathan   -  Aug 12, 2008

Maybe you could add a sound for when you type a wrong letter and allow you to choose the time limit?

 Respond  
Jonesy44   -  Aug 12, 2008

Thanks NIGathan :]

 Respond  
NIGathan   -  Aug 12, 2008

Nice jonesy, I like it. :D
7/10

 Respond  
Jonesy44   -  Aug 12, 2008

Wayhay! thanks babees <3
lol

UPDATE: Now Downloads 160 words per round from a website using a socket (Y)

 Respond  
Eugenio   -  Aug 12, 2008

yeah sorry but it aint usefull or very usefull and its not exceptional lol
/me rates 7 ? just for you Jonesy ;p

 Respond  
Jonesy44   -  Aug 12, 2008

Thanks Eugenio ..6 .. :( thanks anyways.

 Respond  
Eugenio   -  Aug 12, 2008

rofl this pwnz, I already have MDX xD
/me rates 6

 Respond  
Jonesy44   -  Aug 12, 2008

If you would like some BT, i will provide

 Respond  
BlueThen   -  Aug 12, 2008

any screenshots?

 Respond  
EL   -  Aug 12, 2008

Lol man use DE u can jsut move to the id tab an then click on the crap u want an shows the id associated with it.And cooll thanks.`-.-´

 Respond  
Jonesy44   -  Aug 12, 2008

lol, updated the size just for you EL

 Respond  
Jonesy44   -  Aug 12, 2008

nah, i get lost with IDs lol

 Respond  
EL   -  Aug 12, 2008

Ahh ok why not use a dialog editor? fack of alot faster an easyer?

 Respond  
Jonesy44   -  Aug 12, 2008

Yep, and okay. nice one :P

BTW; that extra space. i forgot to trim it down. i start all(ish) dialogs at 200x100 px

 Respond  
EL   -  Aug 12, 2008

Yeah well you return error message if u dont have MDX thats why i said that.Oh yeah that would be cool a lil word socket.`-.-´

 Respond  
Jonesy44   -  Aug 12, 2008

Yep, i guess so. I was working on a socket to retrieve a word list :p

MDX Makes it so much better; believe me :p but u can use it w/o mdx

 Respond  
EL   -  Aug 12, 2008

Pretty cool but you should make a version with out the mdx some how and why such a huge space in yur dialog?.And can u make them liek actual words? just randomize the list?.`-.-´

 Respond  
Jonesy44   -  Aug 12, 2008
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.