mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-16 08:07:23 +08:00
Opt: removed GOTO statement
-replaced by CALL statement to make it compatible with powershell
This commit is contained in:
112
alas.bat
112
alas.bat
@@ -6,7 +6,7 @@ SET CMD=%SystemRoot%\system32\cmd.exe
|
||||
:: -----------------------------------------------------------------------------
|
||||
color 8F
|
||||
:: -----------------------------------------------------------------------------
|
||||
goto check_Permissions
|
||||
call :check_Permissions
|
||||
:check_Permissions
|
||||
echo Administrative permissions required. Detecting permissions...
|
||||
|
||||
@@ -15,7 +15,7 @@ goto check_Permissions
|
||||
echo Success: Administrative permissions confirmed.
|
||||
echo Press any to continue...
|
||||
pause >nul
|
||||
goto continue
|
||||
call :continue
|
||||
) else (
|
||||
echo Failure: Current permissions inadequate.
|
||||
)
|
||||
@@ -66,7 +66,7 @@ for %%A in (%adb_empty%) do if %%~zA==0 (
|
||||
:: -----------------------------------------------------------------------------
|
||||
REM if adb_input = 0 load from adb_port.ini
|
||||
if [%adb_input%]==[] (
|
||||
goto load
|
||||
call :load
|
||||
)
|
||||
REM write adb_input on adb_port.ini
|
||||
echo %adb_input% >> %ADB_P%
|
||||
@@ -95,7 +95,7 @@ call %ADB% connect %ADB_PORT%
|
||||
echo initializing uiautomator2
|
||||
call %PYTHON% -m uiautomator2 init
|
||||
:: timout
|
||||
goto alas
|
||||
call :alas
|
||||
:: -----------------------------------------------------------------------------
|
||||
:alas
|
||||
color 8F
|
||||
@@ -115,11 +115,11 @@ color 8F
|
||||
echo.
|
||||
|
||||
set /P menu=
|
||||
if %menu%==1 GOTO en
|
||||
if %menu%==2 GOTO cn
|
||||
if %menu%==3 GOTO jp
|
||||
if %menu%==4 GOTO choose_update_mode
|
||||
if %menu%==exit GOTO EOF
|
||||
if %menu%==1 call :en
|
||||
if %menu%==2 call :cn
|
||||
if %menu%==3 call :jp
|
||||
if %menu%==4 call :choose_update_mode
|
||||
if %menu%==exit call :EOF
|
||||
|
||||
else (
|
||||
cls
|
||||
@@ -130,7 +130,7 @@ color 8F
|
||||
echo Press any key to retry to the menu...
|
||||
echo.
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
:en
|
||||
@@ -139,7 +139,7 @@ color 8F
|
||||
echo Python Found in %PYTHON% Proceeding..
|
||||
echo Opening alas_en.pyw in %ALAS_PATH%
|
||||
call %PYTHON% alas_en.pyw
|
||||
goto alas
|
||||
call :alas
|
||||
) else (
|
||||
echo :: it was not possible to open alas_en.pyw, make sure you have a folder toolkit
|
||||
echo :: inside AzurLaneAutoScript folder.
|
||||
@@ -147,7 +147,7 @@ color 8F
|
||||
echo Python Path: %PYTHON%
|
||||
echo.
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
:cn
|
||||
@@ -156,7 +156,7 @@ color 8F
|
||||
echo Python Found in %PYTHON% Proceeding..
|
||||
echo Opening alas_en.pyw in %ALAS_PATH%
|
||||
call %PYTHON% alas_cn.pyw
|
||||
goto alas
|
||||
call :alas
|
||||
) else (
|
||||
echo :: it was not possible to open alas_cn.pyw, make sure you have a folder toolkit
|
||||
echo :: inside AzurLaneAutoScript folder.
|
||||
@@ -164,7 +164,7 @@ color 8F
|
||||
echo Python Path: %PYTHON%
|
||||
echo.
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
:jp
|
||||
@@ -173,7 +173,7 @@ color 8F
|
||||
echo Python Found in %PYTHON% Proceeding..
|
||||
echo Opening alas_en.pyw in %ALAS_PATH%
|
||||
call %PYTHON% alas_jp.pyw
|
||||
goto alas
|
||||
call :alas
|
||||
) else (
|
||||
echo :: it was not possible to open alas_jp.pyw, make sure you have a folder toolkit
|
||||
echo :: inside AzurLaneAutoScript folder.
|
||||
@@ -181,7 +181,7 @@ color 8F
|
||||
echo Python Path: %PYTHON%
|
||||
echo.
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
:updater_menu
|
||||
@@ -204,12 +204,12 @@ color 8F
|
||||
echo.
|
||||
|
||||
set /P choice=
|
||||
if %choice%==1 GOTO LmeSzinc
|
||||
if %choice%==2 GOTO whoamikyo
|
||||
if %choice%==3 GOTO nightly
|
||||
if %choice%==4 GOTO gitee
|
||||
if %choice%==5 GOTO alas
|
||||
if %choice%==exit GOTO EOF
|
||||
if %choice%==1 call :LmeSzinc
|
||||
if %choice%==2 call :whoamikyo
|
||||
if %choice%==3 call :nightly
|
||||
if %choice%==4 call :gitee
|
||||
if %choice%==5 call :alas
|
||||
if %choice%==exit call :EOF
|
||||
|
||||
else (
|
||||
cls
|
||||
@@ -220,7 +220,7 @@ color 8F
|
||||
echo Press any key to return to the menu...
|
||||
echo.
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
:update_menu_local
|
||||
@@ -243,12 +243,12 @@ color 8F
|
||||
echo.
|
||||
|
||||
set /P choice=
|
||||
if %choice%==1 GOTO LmeSzinc_local
|
||||
if %choice%==2 GOTO whoamikyo_local
|
||||
if %choice%==3 GOTO nightly_local
|
||||
if %choice%==4 GOTO gitee_local
|
||||
if %choice%==5 GOTO alas
|
||||
if %choice%==exit GOTO EOF
|
||||
if %choice%==1 call :LmeSzinc_local
|
||||
if %choice%==2 call :whoamikyo_local
|
||||
if %choice%==3 call :nightly_local
|
||||
if %choice%==4 call :gitee_local
|
||||
if %choice%==5 call :alas
|
||||
if %choice%==exit call :EOF
|
||||
|
||||
else (
|
||||
cls
|
||||
@@ -259,7 +259,7 @@ color 8F
|
||||
echo Press any key to return to the menu...
|
||||
echo.
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
:LmeSzinc
|
||||
@@ -273,14 +273,14 @@ color 8F
|
||||
echo DONE!
|
||||
echo Press any key to proceed
|
||||
pause > NUL
|
||||
goto updater_menu
|
||||
call :updater_menu
|
||||
) else (
|
||||
echo :: Git not detected, maybe there was an installation issue
|
||||
echo check if you have this directory:
|
||||
echo AzurLaneAutoScript\toolkit\Git\cmd
|
||||
echo.
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
:whoamikyo
|
||||
@@ -294,13 +294,13 @@ color 8F
|
||||
echo DONE!
|
||||
echo Press any key to proceed
|
||||
pause > NUL
|
||||
goto updater_menu
|
||||
call :updater_menu
|
||||
) else (
|
||||
echo :: Git not detected, maybe there was an installation issue
|
||||
echo check if you have this directory:
|
||||
echo AzurLaneAutoScript\toolkit\Git\cmd
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
:nightly
|
||||
@@ -313,14 +313,14 @@ color 8F
|
||||
call %GIT% pull --ff-only whoamikyo nightly
|
||||
echo Press any key to proceed
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
) else (
|
||||
echo :: Git not detected, maybe there was an installation issue
|
||||
echo check if you have this directory:
|
||||
echo AzurLaneAutoScript\toolkit\Git\cmd
|
||||
echo.
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
:gitee
|
||||
@@ -334,13 +334,13 @@ color 8F
|
||||
echo DONE!
|
||||
echo Press any key to proceed
|
||||
pause > NUL
|
||||
goto updater_menu
|
||||
call :updater_menu
|
||||
) else (
|
||||
echo :: Git not detected, maybe there was an installation issue
|
||||
echo check if you have this directory:
|
||||
echo AzurLaneAutoScript\toolkit\Git\cmd
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
rem :check_connection
|
||||
@@ -356,7 +356,7 @@ rem if %errorlevel% == 0 (
|
||||
rem echo You have a good connection with Github! Proceeding...
|
||||
rem echo press any to proceed
|
||||
rem pause > NUL
|
||||
rem goto updater_menu
|
||||
rem call updater_menu
|
||||
rem ) else (
|
||||
rem echo :: You don't have a good connection out of China
|
||||
rem echo :: It might be better to update using Gitee
|
||||
@@ -364,7 +364,7 @@ rem echo :: Redirecting...
|
||||
rem echo.
|
||||
rem echo Press any key to continue...
|
||||
rem pause > NUL
|
||||
rem goto start_gitee
|
||||
rem call start_gitee
|
||||
rem )
|
||||
:: -----------------------------------------------------------------------------
|
||||
:toolkit
|
||||
@@ -389,13 +389,13 @@ rem )
|
||||
echo DONE!
|
||||
echo Press any key to proceed
|
||||
pause > NUL
|
||||
goto updater_menu
|
||||
call :updater_menu
|
||||
) else (
|
||||
echo :: Git not detected, maybe there was an installation issue
|
||||
echo check if you have this directory:
|
||||
echo AzurLaneAutoScript\toolkit\Git\cmd
|
||||
pause > NUL
|
||||
goto updater_menu
|
||||
call :updater_menu
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
rem Keep local changes
|
||||
@@ -416,10 +416,10 @@ color 7C
|
||||
echo.
|
||||
|
||||
set /P choice=
|
||||
if %choice%==1 GOTO updater_menu
|
||||
if %choice%==2 GOTO update_menu_local
|
||||
if %choice%==3 GOTO alas
|
||||
if %choice%==exit GOTO EOF
|
||||
if %choice%==1 call :updater_menu
|
||||
if %choice%==2 call :update_menu_local
|
||||
if %choice%==3 call :alas
|
||||
if %choice%==exit call EOF
|
||||
|
||||
else (
|
||||
cls
|
||||
@@ -430,7 +430,7 @@ color 7C
|
||||
echo Press any key to return to the menu...
|
||||
echo.
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
:LmeSzinc_local
|
||||
@@ -444,14 +444,14 @@ color 7C
|
||||
echo DONE!
|
||||
echo Press any key to proceed
|
||||
pause > NUL
|
||||
goto update_menu_local
|
||||
call :update_menu_local
|
||||
) else (
|
||||
echo :: Git not detected, maybe there was an installation issue
|
||||
echo check if you have this directory:
|
||||
echo AzurLaneAutoScript\toolkit\Git\cmd
|
||||
echo.
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
:whoamikyo_local
|
||||
@@ -465,13 +465,13 @@ color 7C
|
||||
echo DONE!
|
||||
echo Press any key to proceed
|
||||
pause > NUL
|
||||
goto update_menu_local
|
||||
call :update_menu_local
|
||||
) else (
|
||||
echo :: Git not detected, maybe there was an installation issue
|
||||
echo check if you have this directory:
|
||||
echo AzurLaneAutoScript\toolkit\Git\cmd
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
:nightly_local
|
||||
@@ -484,14 +484,14 @@ color 7C
|
||||
call %GIT% stash pop
|
||||
echo Press any key to proceed
|
||||
pause > NUL
|
||||
goto update_menu_local
|
||||
call :update_menu_local
|
||||
) else (
|
||||
echo :: Git not detected, maybe there was an installation issue
|
||||
echo check if you have this directory:
|
||||
echo AzurLaneAutoScript\toolkit\Git\cmd
|
||||
echo.
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
:gitee_local
|
||||
@@ -505,13 +505,13 @@ color 7C
|
||||
echo DONE!
|
||||
echo Press any key to proceed
|
||||
pause > NUL
|
||||
goto update_menu_local
|
||||
call :update_menu_local
|
||||
) else (
|
||||
echo :: Git not detected, maybe there was an installation issue
|
||||
echo check if you have this directory:
|
||||
echo AzurLaneAutoScript\toolkit\Git\cmd
|
||||
pause > NUL
|
||||
goto alas
|
||||
call :alas
|
||||
)
|
||||
:: -----------------------------------------------------------------------------
|
||||
::Add paths
|
||||
@@ -558,5 +558,3 @@ rem )
|
||||
:: -----------------------------------------------------------------------------
|
||||
:EOF
|
||||
exit
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user