i was wondering if it is possible to make a batch code so they have to hit a certain key a certain amount of times with in a limited time if they dont they go to :fail if they do they goto :success
post code if possible if you dont want to post a code for it just tell me wether its possible or not
code help
Moderator: DosItHelp
-
- Expert
- Posts: 1167
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: code help
The easiest way to go about doing this would be to get the system time, have the user hit the key x number of times, get the system time again, and compare the two times, going to :fail if the difference between the two times is greater than whatever threshold you were thinking of.
However, I get the impression that you want the other kind of "do-a-thing-x-times-in-under-y-seconds" where the timer counts down while the user is hitting the button. I've never personally implemented anything like that, but I've seen topics on here about multithreading and Dave Benham's SNAKE game looks for key presses while the program is doing other things by using XCOPY, so it's definitely possible.
However, I get the impression that you want the other kind of "do-a-thing-x-times-in-under-y-seconds" where the timer counts down while the user is hitting the button. I've never personally implemented anything like that, but I've seen topics on here about multithreading and Dave Benham's SNAKE game looks for key presses while the program is doing other things by using XCOPY, so it's definitely possible.
-
- Posts: 26
- Joined: 03 Dec 2013 12:34
Re: code help
thankyou for the reply thats what i needed to know 
