Choice command half second delay?

January 19, 2012 at 02:17:50
Specs: Vista, Intel core 2 duo 1,83 GHz/3 GB RAM
Is ti possible to have the delay in the choice command to be 0.5 secound's?
Or is it a work around?

The code for the program:

echo off
color 02
title Snake is coming
set i=goto m

::set a0= too set f10= ::

set x=4
set y=c

cls
:m
cls
echo move with "wasd"
echo.
echo #############
echo #%a0%%a1%%a2%%a3%%a4%%a5%%a6%%a7%%a8%%a9%%a10%#
echo #%b0%%b1%%b2%%b3%%b4%%b5%%b6%%b7%%b8%%b9%%b10%#
echo #%c0%%c1%%c2%%c3%%c4%%c5%%c6%%c7%%c8%%c9%%c10%#
echo #%d0%%d1%%d2%%d3%%d4%%d5%%d6%%d7%%d8%%d9%%d10%#
echo #%e0%%e1%%e2%%e3%%e4%%e5%%e6%%e7%%e8%%e9%%e10%#
echo #%f0%%f1%%f2%%f3%%f4%%f5%%f6%%f7%%f8%%f9%%f10%#
echo #############
choice /c wsdai /n /d i /t
if %ERRORLEVEL% == 1 goto up
if %ERRORLEVEL% == 2 goto down
if %ERRORLEVEL% == 3 goto right
if %ERRORLEVEL% == 4 goto left
if %ERRORLEVEL% == 5 %i%
goto %move%

:up
set i=goto up
if %y% == a goto m

::set a0= too f10= ::
if %y% == b set y=2
if %y% == c set y=3
if %y% == d set y=4
if %y% == e set y=5
if %y% == f set y=6
set /a y=%y%-1
if %y% == 1 set y=a
if %y% == 2 set y=b
if %y% == 3 set y=c
if %y% == 4 set y=d
if %y% == 5 set y=e
set %y%%x%=+
goto m

:down
set i=goto down
if %y% == f goto m

::set a0= too set f10= ::
if %y% == a set y=1
if %y% == b set y=2
if %y% == c set y=3
if %y% == d set y=4
if %y% == e set y=5
set /a y=%y%+1
if %y% == 2 set y=b
if %y% == 3 set y=c
if %y% == 4 set y=d
if %y% == 5 set y=e
if %y% == 6 set y=f
set %y%%x%=+
goto m

:right
set i=goto right
if %x% == 10 goto m

::set a0= too set f10= ::
set /a x=%x%+1

set %y%%x%=+
goto m

:left
set i=goto left
if %x% == 0 goto m

::set a0= too set f10= ::
set /a x=%x%-1

set %y%%x%=+
goto m


See More: Choice command half second delay?

Report •

#1
March 6, 2012 at 13:30:11
I don't know about using choice but you could use ping -n 1 -w 500 1.1.1.1>nul to pause for half a second. Here is an example of it in action:

@echo off
echo hi
ping -n 1 -w 500 1.1.1.1>nul
echo hi again
pause

Using that, however it is nearly impossible to tell that there is even a delay. Hope that helped.


Report •

#2
March 6, 2012 at 14:20:42
or nircmd;

nircmd wait 500

Happy is ONE who says I am an OttoMAN.


Report •

#3
March 6, 2012 at 15:48:13
^^ ping is incredibly unreliable and depends more on your computer's speed and your internet speed in some cases - it isn't a half second delay by any means, but no there is no workaround without outside programs to get a half second delay (I have a program to do it though)

Report •
Related Solutions


Ask Question