Friday, August 9, 2013

VBScript - Measure your reaction time

VBScript - Measure your reaction time


Here is a VBScript code for an HTML application (hta file) which can measure your reaction time. The user will have to click on the a button and wait for an instruction. Then when the program tells you to click the stop button click it as soon as popssible. My highscore is 0.281 seconds. Try to beat that!
To make the program save the following code as a file with .hta extension using notepad.

 <html>
<head>
<title>Reaction Time</title>
<HTA:APPLICATION
  APPLICATIONNAME="Reaction Time"
  ID="ReactionTime"
  VERSION="1.0"
  MAXIMIZEBUTTON="no"
  SCROLL="no"/>
</head>

<script language="VBScript">

Sub Window_OnLoad
   Dim width,height
   width=360
   height=285
   self.ResizeTo width,height
   self.MoveTo (screen.AvailWidth-width)/2,(screen.AvailHeight-height)/2
End Sub

Function StartTime
memb.value = 0
Shuffle()
End Function

Function Shuffle
info.value = "Prepare..."
rtim.value = ""
TimerID = SetTimeOut("StartRTime()", Int((Rnd*10000)-3000))
End Function

Function StartRTime
info.value = "PRESS STOP!"
mema.value = Timer
End Function

Function StopTime
If (info.value <> "PRESS STOP!") Then
info.value = "Wait..."
Else If (Timer-mema.value > 5) Then
MsgBox("You are too late! Press Start for a new round!")
Else If (memb.value = "1") Then
MsgBox("Press Start for a new round!")
Else
nowa = Timer
dura = Round(nowa-mema.value, 3)
rtim.value = dura
memb.value = 1
End If
End If
End If
End Function

</script>

<body bgcolor="white">
<input type="hidden" id="mema">
<input type="hidden" id="memb">
<table align="center" width="300" border="1">
<caption><hr><b>REACTION TIME</b><hr></caption>
<tr>
<td colspan="2">Measure your reaction time with this program! Just obey the commands shown in the instruction box!</td>
</tr>
<tr>
<td align="right">Instruction: </td>
<td align="left"><input type="text" id="info" size="12" maxlength="0"></td>
</tr>
<tr>
<td align="center" colspan="2"><input type="button" value="START" onClick="StartTime"> <input type="button" value="STOP" onClick="StopTime"></td>
</tr>
<tr>
<td align="right">Your reaction time is: </td>
<td align="left"><input type="text" id="rtim" maxlength="0" size="8"> seconds!</td>
</tr>
</table>
</body>
</html>

What is Torrent file and how it works?

Torrent is an unofficial term used for BitTorrent. Bittorrent is a peer-to-peer protocol that works without the need for a central server. This means that not a server is responsible for sending you information, but you connect directly other available network members to get data transferred. In other words, BitTorrent’s “swarm” consists of many personal computers connected to each other directly through BT protocol. - See more at: http://www.alltechbuzz.net/2013/08/how-bittorrent-technology-works.html#sthash.OnmHCfHi.dpuf

What is Torrent file and how it works?

Torrent is an unofficial term used for BitTorrent. Bittorrent is a peer-to-peer protocol that works without the need for a central server. This means that not a server is responsible for sending you information, but you connect directly other available network members to get data transferred. In other words, BitTorrent’s “swarm” consists of many personal computers connected to each other directly through BT protocol. - See more at: http://www.alltechbuzz.net/2013/08/how-bittorrent-technology-works.html#sthash.OnmHCfHi.dpuf

What is Torrent file and how it works?

Torrent is an unofficial term used for BitTorrent. Bittorrent is a peer-to-peer protocol that works without the need for a central server. This means that not a server is responsible for sending you information, but you connect directly other available network members to get data transferred. In other words, BitTorrent’s “swarm” consists of many personal computers connected to each other directly through BT protocol. - See more at: http://www.alltechbuzz.net/2013/08/how-bittorrent-technology-works.html#sthash.OnmHCfHi.dpuf
World Wide Web is full of so-called „Torrents“, internet users often speak about “torrent files” and use different portals to find them. Let’s go a little bit deeper into the past and understand what is really meant under this term. - See more at: http://www.alltechbuzz.net/2013/08/how-bittorrent-technology-works.html#sthash.OnmHCfHi.dpuf
World Wide Web is full of so-called „Torrents“, internet users often speak about “torrent files” and use different portals to find them. Let’s go a little bit deeper into the past and understand what is really meant under this term. - See more at: http://www.alltechbuzz.net/2013/08/how-bittorrent-technology-works.html#sthash.OnmHCfHi.dpuf
World Wide Web is full of so-called „Torrents“, internet users often speak about “torrent files” and use different portals to find them. Let’s go a little bit deeper into the past and understand what is really meant under this term. - See more at: http://www.alltechbuzz.net/2013/08/how-bittorrent-technology-works.html#sthash.OnmHCfHi.dpuf
World Wide Web is full of so-called „Torrents“, internet users often speak about “torrent files” and use different portals to find them. Let’s go a little bit deeper into the past and understand what is really meant under this term. - See more at: http://www.alltechbuzz.net/2013/08/how-bittorrent-technology-works.html#sthash.OnmHCfHi.dpuf
World Wide Web is full of so-called „Torrents“, internet users often speak about “torrent files” and use different portals to find them. Let’s go a little bit deeper into the past and understand what is really meant under this term. - See more at: http://www.alltechbuzz.net/2013/08/how-bittorrent-technology-works.html#sthash.OnmHCfHi.dpuf

No comments:

Post a Comment