Reaction Test

By ReQueST on Oct 01, 2005

Its a reaction test. Its to see how long it takes for you to react on a certain event.

It highlights the letter A or B or C.

Its then up to you to click the matching button.

It started by right clicking the channel, and select: Recation Test, or type: /react.

Have fun.

menu channel {
  Reaction Test: /react
}

alias React { dialog -md React React }

dialog React {
  size -1 -1 100 125
  option -dbu
  title "Reaction Test."
  box "Reaction Speed", 1, 5 5 90 100
  text "Click the matching button.",8, 10 15 80 20, center
  text "A", 2, 33 28 15 15, center
  text "B", 3, 47 28 15 15, center
  text "C", 4, 61 28 15 15, center
  button "A", 5, 33 43 13 20, center
  button "B", 6, 48 43 13 20, center
  button "C", 7, 63 43 13 20, center
  box "Result:", 9, 5 65 90 40
  text "Speed:", 10, 10 76 25 10
  edit "", 11, 40 75 50 10, read
  text "Best:", 14, 10 90 25 10
  edit "", 15, 40 90 50 10, read
  button "Start", 12, 15 110 30 10
  button "Copy", 13, 55 110 30 10
}

on *:dialog:React:*:* {
  if ($devent == init) { did -b React 2,3,4 | set %react.keypress 0 | $iif(%react.pr,did -a React 15 $bytes(%react.pr,b) $+ ms,did -a React 15 0) }
  if ($devent == sclick) {
    if ($did == 12) {
      if (%react.keypress == 0) {
        did -b React 2,3,4
        echo 3 -ag - When one of the letters lights up, press the matching button.
        set %react.ran $rand(2,4) 
        .timer 1 %react.ran /did -e React %react.ran
        .timer 1 %react.ran /set %react.ticks $ticks
        set %react.keypress 1
      }
      else { echo 3 -ag - You have to press the matching button to the letter first, before you can start again! }
    }
    elseif ($did == 13) {
      if ($did(11).text) { if ($did(15).text || $did(11).text) { clipboard $null | clipboard -an Reaction speed: $did(11).text $+ , Personal best: $did(15).text | echo 3 -ag - Copied to clipboard. Press CTRL+V to paste. } }
    }
    elseif ($did == 5) { 
      if (%react.keypress == 1) {  
        if ($calc($did - 3) == %react.ran) { 
          did -ar React 11 $bytes($calc($ticks - %react.ticks),b) $+ ms
          set %react.keypress 0
          if (!%react.pr) { set %react.pr 999999 }
          if ($calc($ticks - %react.ticks) <= %react.pr) { set %react.pr $calc($ticks - %react.ticks) | did -ar React 15 $bytes(%react.pr,b) $+ ms }
        }
      } 
    }
    elseif ($did == 6) {  
      if (%react.keypress == 1) {  
        if ($calc($did - 3) == %react.ran) { 
          did -ar React 11 $bytes($calc($ticks - %react.ticks),b) $+ ms
          set %react.keypress 0
          if (!%react.pr) { set %react.pr 999999 }
          if ($calc($ticks - %react.ticks) <= %react.pr) { set %react.pr $calc($ticks - %react.ticks) | did -ar React 15 $bytes(%react.pr,b) $+ ms }
        }
      } 
    }
    elseif ($did == 7) {  
      if (%react.keypress == 1) {  
        if ($calc($did - 3) == %react.ran) { 
          did -ar React 11 $bytes($calc($ticks - %react.ticks),b) $+ ms
          set %react.keypress 0
          if (!%react.pr) { set %react.pr 999999 }
          if ($calc($ticks - %react.ticks) <= %react.pr) { set %react.pr $calc($ticks - %react.ticks) | did -ar React 15 $bytes(%react.pr,b) $+ ms }
        }
      } 
    }
  }
  if ($devent == close) { echo 3 -ag - Thanks for testing your Reaction Speed. }
}

Comments

Sign in to comment.
ReQueST   -  Oct 03, 2005

Thnx.. More buttons was annoying, and this isnt really ment as a game, but i didnt know what else to tag it.

 Respond  
Noutrious   -  Oct 02, 2005

Good, good dude! Go on like this and you will be next VoP :DD ok peace..!

 Respond  
KuTsuM   -  Oct 01, 2005

cool, kind of like simon.. kind of

 Respond  
tank59   -  Oct 01, 2005

Not a bad little script. Would be alot nicer if the the game would keep looping until you stop it instead of pushing start everytime. Also maybe make a few more buttons or space them out a bit more as it\'s kinda easy to push the button.

 Respond  
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.