Skip to content

Commit fc03131

Browse files
committed
Opt: Removed deprecated code
1 parent 096a387 commit fc03131

File tree

5 files changed

+49
-69
lines changed

5 files changed

+49
-69
lines changed

alas.bat

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
:: Alas Run Tool v3
33
:: Author: whoamikyo (https://kyo.ninja)
44
:: Version: 3.0
5-
:: Last updated: 2020-08-22
5+
:: Last updated: 2020-08-23
66
:: >>> Get updated from: https://github.com/LmeSzinc/AzurLaneAutoScript <<<
77
@echo off
88
pushd "%~dp0"
99
setlocal EnableDelayedExpansion
10-
set "Version=3.0"
11-
set "lastUpdated=2020-08-22"
10+
set "Version=3.0"
11+
set "lastUpdated=2020-08-23"
1212
:: Remote repo
13-
set "Remoterepo=https://raw.githubusercontent.com/LmeSzinc/AzurLaneAutoScript/master/toolkit"
13+
set "Remoterepo=https://raw.githubusercontent.com/LmeSzinc/AzurLaneAutoScript/master/toolkit"
1414

1515
rem ================= Preparation =================
1616

1717
:: Set the root directory
18-
set "root=%~dp0"
18+
set "root=%~dp0"
1919
set "root=%root:~0,-1%"
2020
cd "%root%"
2121

@@ -53,10 +53,10 @@ rem echo Language: %Language% & echo Region: %Region% & echo SystemType: %System
5353
rem echo http_proxy: %http_proxy% & echo https_proxy: %https_proxy%
5454
echo DeployMode: %DeployMode%
5555
rem echo KeepLocalChanges: %KeepLocalChanges%
56-
rem echo RealtimeMode: %RealtimeMode%
57-
rem echo FirstRun: %FirstRun%
56+
echo RealtimeMode: %RealtimeMode%
57+
echo FirstRun: %FirstRun%
5858
rem echo IsUsingGit: %IsUsingGit%
59-
rem echo Serial: %Serial%
59+
echo Serial: %Serial%
6060
setLocal EnableDelayedExpansion
6161
set "STR=Alas Run Tool %Version%^"
6262
set "SIZE=100"
@@ -150,7 +150,7 @@ set "LEN=0"
150150
:strLen_Loop
151151
if not "!!STR:~%LEN%!!"=="" set /A "LEN+=1" & goto :strLen_Loop
152152
set "equal====================================================================================================="
153-
set "spaces====================================================================================================="
153+
set "spaces====================================================================================================="
154154
call echo %%equal:~0,%SIZE%%%
155155
set /a "pref_len=%SIZE%-%LEN%-2"
156156
set /a "pref_len/=2"
@@ -247,13 +247,13 @@ rem ================= OPTION 5 =================
247247
:Setting
248248
cls
249249
setLocal EnableDelayedExpansion
250-
set "STR2=Advanced Settings^!"
250+
set "STR2=Advanced Settings^!"
251251
set "SIZE=100"
252252
set "LEN=0"
253253
:strLen_Loop
254254
if not "!!STR2:~%LEN%!!"=="" set /A "LEN+=1" & goto :strLen_Loop
255-
set "equal====================================================================================================="
256-
set "spaces====================================================================================================="
255+
set "equal====================================================================================================="
256+
set "spaces====================================================================================================="
257257
call echo %%equal:~0,%SIZE%%%
258258
set /a "pref_len=%SIZE%-%LEN%-2"
259259
set /a "pref_len/=2"
@@ -266,11 +266,10 @@ echo. & echo [0] Return to the Main Menu
266266
echo. & echo [1] Select Download Region
267267
echo. & echo [2] Set Global Proxy
268268
echo. & echo [3] Set SERIAL (For ADB connect)
269-
echo. & echo [4] (Disable/Enable) Network connection test while updating
270-
echo. & echo [5] (Disable/Enable) Realtime Connection Mode (Only Bluestacks Beta)
271-
echo. & echo [6] (Disable/Enable) Keep local changes
272-
echo. & echo [7] Change default Branch to update (master/dev)
273-
echo. & echo [8] Reset Settings
269+
echo. & echo [4] (Disable/Enable) Realtime Connection Mode (Only Bluestacks Beta)
270+
echo. & echo [5] (Disable/Enable) Keep local changes
271+
echo. & echo [6] Change default Branch to update (master/dev)
272+
echo. & echo [7] Reset Settings
274273
echo. & echo.
275274
echo ====================================================================================================
276275
set opt2_choice=-1
@@ -280,11 +279,10 @@ if "%opt2_choice%"=="0" goto MENU
280279
if "%opt2_choice%"=="1" goto Region_setting
281280
if "%opt2_choice%"=="2" goto Proxy_setting
282281
if "%opt2_choice%"=="3" goto Serial_setting
283-
if "%opt2_choice%"=="4" goto NetworkTest_setting
284-
if "%opt2_choice%"=="5" goto Realtime_mode
285-
if "%opt2_choice%"=="6" goto Keep_local_changes
286-
if "%opt2_choice%"=="7" goto Branch_setting
287-
if "%opt2_choice%"=="8" goto Reset_setting
282+
if "%opt2_choice%"=="4" goto Realtime_mode
283+
if "%opt2_choice%"=="5" goto Keep_local_changes
284+
if "%opt2_choice%"=="6" goto Branch_setting
285+
if "%opt2_choice%"=="7" goto Reset_setting
288286
echo Please input a valid option.
289287
goto ReturnToSetting
290288

@@ -315,7 +313,7 @@ echo.
315313
setlocal EnableDelayedExpansion
316314
if /i "%opt6_op5_choice%"=="Y" (
317315
set /p opt6_op5_choice= Please input - SERIAL ^(DEFAULT 127.0.0.1:5555 ^):
318-
if "!opt6_op5_choice!"=="" ( set "opt6_op5_choice=127.0.0.1:5555" )
316+
if "!opt6_op5_choice!"=="" ( set "opt6_op5_choice=127.0.0.1:5555" )
319317
call command\Config.bat Serial !opt6_op5_choice!
320318
echo.
321319
echo The serial was set successfully.
@@ -375,9 +373,9 @@ if /i "%opt6_opt3_choice%"=="T" (
375373
set /p opt6_opt3_proxyHost= Please input - Proxy Host ^(DEFAULT http://127.0.0.1 ^):
376374
set /p opt6_opt3_httpPort= Please input - Http Port ^(DEFAULT 1080 ^):
377375
set /p opt6_opt3_httpsPort= Please input - Https Port ^(DEFAULT 1080 ^):
378-
if "!opt6_opt3_proxyHost!"=="" ( set "opt6_opt3_proxyHost=http://127.0.0.1" )
379-
if "!opt6_opt3_httpPort!"=="" ( set "opt6_opt3_httpPort=1080" )
380-
if "!opt6_opt3_httpsPort!"=="" ( set "opt6_opt3_httpsPort=1080" )
376+
if "!opt6_opt3_proxyHost!"=="" ( set "opt6_opt3_proxyHost=http://127.0.0.1" )
377+
if "!opt6_opt3_httpPort!"=="" ( set "opt6_opt3_httpPort=1080" )
378+
if "!opt6_opt3_httpsPort!"=="" ( set "opt6_opt3_httpsPort=1080" )
381379
call command\Config.bat ProxyHost !opt6_opt3_proxyHost!
382380
call command\Config.bat HttpPort !opt6_opt3_httpPort!
383381
call command\Config.bat HttpsPort !opt6_opt3_httpsPort!
@@ -413,14 +411,6 @@ if /i "%opt6_opt6_choice%"=="Y" (
413411
) else ( echo Invalid input. Cancelled. )
414412
goto ReturnToSetting
415413

416-
:NetworkTest_setting
417-
call command\Config.bat NetTest
418-
goto ReturnToSetting
419-
420-
:Upgrade_setting
421-
call command\Config.bat UpgradeOnlyViaGitHub
422-
goto ReturnToSetting
423-
424414
rem ================= FUNCTIONS =================
425415

426416
:ReturnToSetting

command/Config.bat

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ if NOT exist %cfg_File% (
2626
( echo Language = %Language%
2727
echo Region = %Region%
2828
echo SystemType = %SystemType%
29-
echo NetTest = enable
29+
echo NetTest = disable
3030
echo KeepLocalChanges = disable
3131
echo RealtimeMode = disable
32-
echo AdbConnect = enable
32+
echo AdbConnect = disable
3333
echo Serial = %Serial%
3434
echo FirstRun = %FirstRun%
3535
echo IsUsingGit = %IsUsingGit%
@@ -43,19 +43,17 @@ copy %cfg_File% %cfg_File%.bak > NUL
4343
type NUL > %cfg_File%
4444
goto :eof
4545

46-
4746
:Config_Common2
4847
del /Q %cfg_File%.bak >NUL 2>NUL
4948
cd ..
5049
goto :eof
5150

52-
5351
:: There are 3 types of configuration items: assignable, toggle-able, or both.
5452
:: Assignable : You should call it with an argument `%2`.
5553
:: Toggle-able: No argument `%2`. If it is already enabled, set it to disabled and vice versa.
5654
:: Both : If you call it without argument `%2`, toggle it. Otherwise assign it.
5755

58-
:: Toggle-able: SystemType, ProxyHint, FFmpeg, NetTest, UpgradeOnlyViaGitHub
56+
:: Toggle-able: SystemType
5957
:: Assignable : Language, Region, ProxyHost, HttpPort, HttpsPort
6058
:: Both : Proxy
6159

@@ -131,19 +129,6 @@ for /f "delims=" %%i in (%cfg_File%.bak) do (
131129
)
132130
goto :eof
133131

134-
:Config_NetTest
135-
for /f "delims=" %%i in (%cfg_File%.bak) do (
136-
set "cfg_Temp=%%i"
137-
set "cfg_Content=!cfg_Temp!"
138-
if "!cfg_Temp!"=="NetTest = disable" ( set "cfg_Content=NetTest = enable" && set "cfg_State=enable" )
139-
if "!cfg_Temp!"=="NetTest = enable" ( set "cfg_Content=NetTest = disable" && set "cfg_State=disable" )
140-
echo !cfg_Content!>>%cfg_File%
141-
)
142-
if "%cfg_State%"=="enable" (
143-
echo Network connection test while upgrading: enabled ^(DEFAULT^)
144-
) else echo Network connection test while upgrading: disabled
145-
goto :eof
146-
147132
:Config_IsUsingGit
148133
for /f "delims=" %%i in (%cfg_File%.bak) do (
149134
set "cfg_Content=%%i"
@@ -207,17 +192,4 @@ for /f "delims=" %%i in (%cfg_File%.bak) do (
207192
)
208193
goto :eof
209194

210-
:Config_UpgradeOnlyViaGitHub
211-
for /f "delims=" %%i in (%cfg_File%.bak) do (
212-
set "cfg_Temp=%%i"
213-
set "cfg_Content=!cfg_Temp!"
214-
if "!cfg_Temp!"=="UpgradeOnlyViaGitHub = disable" ( set "cfg_Content=UpgradeOnlyViaGitHub = enable" && set "cfg_State=enable" )
215-
if "!cfg_Temp!"=="UpgradeOnlyViaGitHub = enable" ( set "cfg_Content=UpgradeOnlyViaGitHub = disable" && set "cfg_State=disable" )
216-
echo !cfg_Content!>>%cfg_File%
217-
)
218-
if "%cfg_State%"=="enable" (
219-
echo Upgrade you-get via: GitHub_Releases
220-
) else echo Upgrade you-get via: PyPI.org ^(DEFAULT^)
221-
goto :eof
222-
223195
rem ================= End of File =================

command/GenerateConsoleBatch.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ goto :eof
5353
:GenerateDownloadBatch_Common2
5454
( REM :: Show the instructions
5555
echo title Alas Console Debugger
56-
echo echo Alas Console Debugger
56+
echo echo This is an console to run adb, git, python and pip.
5757
echo echo adb devices
5858
echo echo git log
5959
echo echo python -V

command/Get.bat

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
call :Import_%~1
1212
goto :eof
1313

14-
1514
rem ================= FUNCTIONS =================
1615

17-
1816
:: %cd%: "%root%"
1917
:: Get %Language% , %Region% , %SystemType%
2018
:Import_Main
@@ -77,6 +75,26 @@ echo =========================================================================
7775
echo Press any to continue...
7876
pause > NUL
7977

78+
rem set template=%root%\config\template.ini
79+
rem setlocal enabledelayedexpansion
80+
rem for /f "delims=" %%i in (!template!) do (
81+
rem set line=%%i
82+
rem if "x!line:~0,9!"=="xserial = " (
83+
rem set serial=!line:~9!
84+
rem )
85+
rem )
86+
rem echo =========================================================================
87+
rem echo Old Serial: %serial%
88+
rem echo New Serial: %serial_input%
89+
rem echo =========================================================================
90+
rem echo Press any to continue...
91+
rem pause > NUL
92+
rem for /f "delims=" %%i in ('type "%template%" ^& break ^> "%template%" ') do (
93+
rem set line=%%i
94+
rem >>"%template%" echo(!line:%serial%=%serial_input%!
95+
rem )
96+
rem )
97+
rem endlocal
8098
goto :eof
8199

82100

command/Log.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ call :Log_init
1919
call :GetPackagesInfo
2020
( echo pipVer: %log_pipVer%
2121
echo adbutilsVer: %log_adbutilsVer%
22-
echo python_Levenshtein: %log_LevenshteinVer%
2322
echo numpy: %log_numpyVer%
2423
echo scipy: %log_scipyVer%
2524
echo pillow: %log_pillowVer%
@@ -34,6 +33,7 @@ echo mxnet: %log_mxnetVer%
3433
echo cnocr: %log_cnocrVer%
3534
echo gooey: %log_gooeyVer%
3635
echo colored: %log_coloredVer%
36+
echo Python Levenshtein: %log_LevenshteinVer%
3737
echo pyocr: %log_pyocrVer%) >> %deploy_log_file%
3838
call :Log_common
3939
goto :eof

0 commit comments

Comments
 (0)