-1
我爲了好玩而批量製作遊戲。在遊戲中,我想參加一些遊戲,你可以試圖說服某人給你更多的錢用於任務或做某事。每次我嘗試這樣做時,都會收到一條消息,說明「失敗」不會被識別爲內部或外部命令,可操作程序或批處理文件。 我的代碼看起來像這樣錯誤地批評批處理組
@echo off
SETLOCAL EnableDelayedExpansion
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
set "DEL=%%a"
)
color 0a
Echo King Redwood: So 2000?
pause >nul
echo.
call :colorText 09 "1. 2500"
echo.
call :colorText 0e "2. 3000"
echo.
call :colorText 0c "3. 4000"
echo.
echo 4. 2000
echo.
set /p purs=Enter:
if %purs% == 1 goto CheckB
if %purs% == 2 goto CheckY
if %purs% == 3 Goto CheckR
if %purs% == 4 goto Convo
:CheckB
set bleu=%random:~-2,1%
if %bleu% GTR 10 (
goto CheckB)
if %bleu% LSS 0 (
goto CheckB)
set num = 2
set reward = 2500
goto Res
:Res
if %bleu% GEQ %num% goto Succeed
if NOT %bleu% GEQ %num% goto Fail
:Succeed
Echo OK 2500 will work.
pause >nul
goto end
:Fail
echo If 2000 isn't good enough for you, I'll just have someone else do it.
:end
exit
:colorText
echo off
<nul set /p ".=%DEL%" > "%~2"
findstr /v /a:%1 /R "^$" "%~2" nul
del "%~2" > nul 2>&1i
基本上,我只有它第一個成立。
我很喜歡任何類型的編碼。此外,:colorText是不是我的,我不很記得我從
您在哪裏看到我需要添加此@FloatingKiwi – QuantumPrimus
對不起,我在我的示例中修改了一下邏輯。我現在做了一個編輯。把這個放在你稱之爲'goto fail'的線上。 – FloatingKiwi
我這樣做了,但是現在它從來沒有迴應失敗,即使我做了9次。你知道爲什麼會這樣嗎? @FloatingKiwi? – QuantumPrimus