VOGONS


First post, by curvedline

User metadata
Rank Newbie
Rank
Newbie

@ECHO OFF
CLS

ECHO shift = when you are hanging over the trap, OR FIGHT AND KILL
ECHO shift + arrow = walk
ECHO shift + L = next level
ECHO.
ECHO control Q = exit to dos
ECHO control G = save the position where you were
ECHO control L = load only while program is loading at start
ECHO control A = go to beginning of the level
ECHO control R = give up
ECHO.

choice /C:QC "Q to abort or C to continue"
IF ErrorLevel 2 GOTO :CONTINUE
IF ErrorLevel 1 GOTO :END

:CONTINUE
prince megahit

:END

Is there a way to do this like below with "CHOICE" or any other batch command I dont know
because DOSBOX says it doesnt support SET VAR=INPUT:
i dont want to press C to continue, i want to use any parts of my body like elbow to press any key with eyes closed while watching video

ECHO Q. quit
ECHO press any other key to play
ECHO.
SET VAR=DUMMY
SET /P VAR=INPUT:
IF /I %VAR%==Q GOTO :EOF
IF /I %VAR%==DUMMY GOTO :CONTINUE
GOTO :CONTINUE

Reply 1 of 4, by jakethompson1

User metadata
Rank Oldbie
Rank
Oldbie

I can't think of a way to do this from command.com directly, but you could write a short .COM file GETQ.COM:

C:\>debug getq.com
-a
mov ah,1
int 21
sub al,51
jz 10a
sub al,20
mov ah,4c
int 21

-r cx
:e
-w
-q

When you execute GETQ, the ERRORLEVEL will be 0 if they hit q or Q, and something other than zero (i.e. if errorlevel 1 ...) if they pressed anything else.

Reply 2 of 4, by curvedline

User metadata
Rank Newbie
Rank
Newbie

ECHO Q. abort
ECHO press any key to play
ECHO.

getq.com
IF ErrorLevel 1 GOTO :CONTINUE
IF ErrorLevel 0 GOTO :END

:CONTINUE
prince megahit

:END
worked, thanks, this was a unbelievable way to achieve the effect of any key press
what if errorlevel is 2 or 3, so i tried below
*****************************************
getq.com
IF ErrorLevel NEQ 0 GOTO :CONTINUE
GOTO :END
:CONTINUE
-----------------
getq.com
IF NOT ErrorLevel 0 GOTO :CONTINUE
GOTO :END
:CONTINUE

both didnt work. i forgot old DOS syntax
****************************************

lets say this is a file abc.txt
-a
mov ah,1
int 21
sub al,51
jz 10a
sub al,20
mov ah,4c
int 21

-r cx
e
-w
-q

is there a way to import this abc.txt? i know there was a way
maybe like debug abc.txt which will produce abc.bin and rename abc.bin to abc.com or something
or like exe2bin.exe abc.bin
you might as well show me if there is a way
i couldnt find it in internet

Reply 3 of 4, by zirkoni

User metadata
Rank Member
Rank
Member

I think this should work:

@echo off
cls
choice /cabcdefghijklmnoprstuvwxyz0123456789q /n "Press Q to quit, any other key to continue"
if errorlevel 36 goto quit

:continue
echo Pressed any key
goto eof

:quit
echo Pressed Q

:eof

Of course this works only for the alphanumeric keys so space, alt, ctrl, etc are not "any key" in this case.

https://youtube.com/@zirkoni42

Reply 4 of 4, by curvedline

User metadata
Rank Newbie
Rank
Newbie

@ECHO OFF
CLS
ECHO ==================
ECHO Prince of Persia 1
ECHO ==================
ECHO up + left = single left jump
ECHO left / up = run and jump to the left
ECHO SHIFT = walk/hang
ECHO.
ECHO SHIFT = draw and attack
ECHO SHIFT + up = block
ECHO.
ECHO SHIFT L = next level
ECHO SHIFT T = add lives
ECHO.
ECHO CTRL G = save
ECHO CTRL L = load only at intro
ECHO CTRL Q = quit
ECHO.
ECHO CTRL A = restart
ECHO CTRL R = new game
ECHO ====================================
ECHO.

choice /C:abcdefghijklmnoprstuvwxyz0123456789q /n "Q to quit or any other key to continue"
IF ErrorLevel 36 GOTO :END
GOTO :CONTINUE

:CONTINUE
prince megahit

:END

i mostly use ESC, SPACEBAR, ENTER area or just dropping my arm on keyboard somewhere, i dont wanna slightly lift my arm and reach to any specific key. it is nothing like 1/1000 actions, however, when i do this 1 especially, my brain receives a slightly dull aching signal from my damaged shoulders at times, saying to me like save your muscle for a better use and fun in which to make me forget dull ache.
i will keep the batch as backup. thanks for a help