Im making a .bat game, and currently when putting in a command the code is
set /p command=
What i want to know is if you can somehow have a time limit for inputting the commands. For example if your fighting a guard, and you haven’t put a command in for say 5 seconds, the guard attacks.
This is not something of dire need, I am just wondering more about the limitations im bound to, and i think i know the anawer anyway (the answer being that you cant)
Thanks
It can also be done with batch only.
You can create a second thread (in the same window) with
start /b.If this thread wait with
set /pfor user input, the main thread is not affected.This sample will wait for 5 seconds for userinput, if the user inputs text it is moved into a file, so the first thread can access it.