Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 如何使用%x%和%y%而不是14 32_Batch File - Fatal编程技术网

Batch file 如何使用%x%和%y%而不是14 32

Batch file 如何使用%x%和%y%而不是14 32,batch-file,Batch File,这是我的高级BAT到EXE转换器脚本: :start cls title Money Madness - The Game set o1 = 13 set o2 = 15 cls rem ChangeColor 11 0 rem ShadeBoxAt 6 31 15 1 4 rem ShadeBoxAt 20 32 1 19 4 rem ShadeBoxAt 6 50 14 1 4 rem ShadeBoxAt 6 32 1 18 4 rem ChangeColor 10 0 rem Locat

这是我的高级BAT到EXE转换器脚本:

:start
cls
title Money Madness - The Game
set o1 = 13
set o2 = 15
cls
rem ChangeColor 11 0
rem ShadeBoxAt 6 31 15 1 4
rem ShadeBoxAt 20 32 1 19 4
rem ShadeBoxAt 6 50 14 1 4
rem ShadeBoxAt 6 32 1 18 4
rem ChangeColor 10 0
rem Locate %o1% %o2%
echo a
pause

但我收到了一个错误:

查找[选项计数错误]

完整代码如下:




虽然我已经尝试过了,但我无法让它工作。

空格在
set
命令中很重要。您已经创建了一个名为
%o1%
的变量,其值为
13
,以及一个名为
%o2%
的变量,其值为
15
。删除空格(并添加引号,以免意外地在末尾添加额外空格)


Locate
不是批处理命令。您正在为此使用什么不受支持的第三方可执行文件?根据标题,我可以假设这是一个吗?
@echo off
:startup
title Money Madness - loading
rem ChangeColor 10 0
rem ShadeBoxAt 6 11 15 1 4
rem ShadeBoxAt 20 12 1 9 4
rem ShadeBoxAt 14 22 7 1 4
rem ShadeBoxAt 14 30 7 1 4
rem ShadeBoxAt 14 23 1 7 4
rem ShadeBoxAt 20 23 1 7 4
rem ShadeBoxAt 14 32 7 1 4
rem ShadeBoxAt 14 33 2 7 4
rem ShadeBoxAt 14 40 7 1 4
rem ShadeBoxAt 18 33 1 7 4
rem ShadeBoxAt 14 42 7 1 4
rem ShadeBoxAt 14 43 2 3 4
rem ShadeBoxAt 19 43 2 3 4
rem ShadeBoxAt 19 46 2 1 4
rem ShadeBoxAt 15 46 4 3 4
rem ShadeBoxAt 14 46 6 2 4
rem ShadeBoxAt 13 42 1 5 4
rem ShadeBoxAt 13 32 1 9 4
rem ShadeBoxAt 13 22 1 9 4
rem ShadeBoxAt 13 50 8 1 4
rem ShadeBoxAt 11 50 1 1 4
rem ShadeBoxAt 11 52 10 1 4
rem ShadeBoxAt 11 53 2 2 4
rem ShadeBoxAt 13 55 2 2 4
rem ShadeBoxAt 15 57 2 2 4
rem ShadeBoxAt 17 59 2 2 4
rem ShadeBoxAt 19 61 2 3 4
rem ShadeBoxAt 11 63 8 1 4
rem ShadeBoxAt 11 66 10 2 4
rem ShadeBoxAt 11 68 2 6 4
rem ShadeBoxAt 20 68 1 7 4
rem ShadeBoxAt 17 72 4 3 4
rem ShadeBoxAt 16 70 1 5 4
rem wait 3000
rem Locate 24 2
echo Press any key to continue to the menu screen
pause>nul
cls

:menu
cls
title Money Madness - Menu
rem ChangeColor 11 0
rem PrintBoxAt 1 1 25 80 2
rem PrintBoxAt 2 2 23 78 1
rem ChangeColor 15 0
rem Locate 8 30
echo Money Madness!
rem Locate 9 27
echo ---------------------
rem Locate 11 16
echo 1. Start
rem Locate 12 16
echo 2. Help
rem Locate 13 16
echo 3. Exit
rem Locate 15 16
echo Type the corresponding number, then press enter...
rem Locate 17 16
set /p MenuChoice=
if %MenuChoice% == 1 goto start
if %MenuChoice% == 2 goto help
if %MenuChoice% == 3 exit
goto menu

:help
cls
title Money Madness - Help
pause
goto menu

:start
cls
title Money Madness - The Game
set o1 = 13
set o2 = 15
cls
rem ChangeColor 11 0
rem ShadeBoxAt 6 31 15 1 4
rem ShadeBoxAt 20 32 1 19 4
rem ShadeBoxAt 6 50 14 1 4
rem ShadeBoxAt 6 32 1 18 4
rem ChangeColor 10 0
rem Locate %o1% %o2%
echo a
pause
:start
cls

title Money Madness - The Game

set "o1=13"
set "o2=15"

cls
rem ChangeColor 11 0
rem ShadeBoxAt 6 31 15 1 4
rem ShadeBoxAt 20 32 1 19 4
rem ShadeBoxAt 6 50 14 1 4
rem ShadeBoxAt 6 32 1 18 4
rem ChangeColor 10 0
rem Locate %o1% %o2%
echo a
pause