Merge remote-tracking branch 'origin/master'

This commit is contained in:
LmeSzinc 2020-06-27 04:17:30 +08:00
commit 78bf0f5940
4 changed files with 99 additions and 70 deletions

124
alas.bat
View File

@ -2,11 +2,18 @@
@echo off
pushd "%~dp0"
title ALAS run
SET ADB=%~dp0python-3.7.6.amd64\Lib\site-packages\adbutils\binaries\adb.exe
SET PYTHON=%~dp0python-3.7.6.amd64\python.exe
:: -----------------------------------------------------------------------------
SET RENAME="python-3.7.6.amd64"
if exist %RENAME% (
rename %RENAME% toolkit
)
SET ADB=%~dp0toolkit\Lib\site-packages\adbutils\binaries\adb.exe
SET PYTHON=%~dp0toolkit\python.exe
SET CMD=%SystemRoot%\system32\cmd.exe
SET LMESZINC=https://github.com/LmeSzinc/AzurLaneAutoScript.git
SET WHOAMIKYO=https://github.com/whoamikyo/AzurLaneAutoScript.git
SET ENV=https://github.com/whoamikyo/alas-env.git
SET GITEE_URL=https://gitee.com/lmeszinc/AzurLaneAutoScript.git
:: -----------------------------------------------------------------------------
goto check_Permissions
:check_Permissions
@ -84,7 +91,7 @@ goto alas
if %menu%==1 GOTO en
if %menu%==2 GOTO cn
if %menu%==3 GOTO jp
if %menu%==4 GOTO check_connection
if %menu%==4 GOTO updater_menu
if %menu%==exit GOTO EOF
else (
@ -107,7 +114,7 @@ goto alas
call %PYTHON% alas_en.pyw
goto alas
) else (
echo :: it was not possible to open alas_en.pyw, make sure you have a folder python-3.7.6.amd64
echo :: it was not possible to open alas_en.pyw, make sure you have a folder toolkit
echo :: inside AzurLaneAutoScript folder.
echo.
pause > NUL
@ -122,7 +129,7 @@ goto alas
call %PYTHON% alas_cn.pyw
goto alas
) else (
echo :: it was not possible to open alas_cn.pyw, make sure you have a folder python-3.7.6.amd64
echo :: it was not possible to open alas_cn.pyw, make sure you have a folder toolkit
echo :: inside AzurLaneAutoScript folder.
echo.
pause > NUL
@ -137,7 +144,7 @@ goto alas
call %PYTHON% alas_jp.pyw
goto alas
) else (
echo :: it was not possible to open alas_jp.pyw, make sure you have a folder python-3.7.6.amd64
echo :: it was not possible to open alas_jp.pyw, make sure you have a folder toolkit
echo :: inside AzurLaneAutoScript folder.
echo.
pause > NUL
@ -145,7 +152,7 @@ goto alas
)
:: -----------------------------------------------------------------------------
rem :updater
rem SET GIT_ALAS=%~dp0python-3.7.6.amd64\Git\cmd\git.exe
rem SET GIT_ALAS=%~dp0toolkit\Git\cmd\git.exe
rem SET GLP=%GIT_ALAS%
rem SET ALAS_PY=alas.py
rem if exist %ALAS_PY% (
@ -157,7 +164,7 @@ rem goto updater_menu
rem )
rem :: -----------------------------------------------------------------------------
:updater_menu
SET GIT_ALAS=%~dp0python-3.7.6.amd64\Git\cmd\git.exe
SET GIT_ALAS=%~dp0toolkit\Git\cmd\git.exe
SET GLP=%GIT_ALAS%
cls
echo.
@ -171,7 +178,8 @@ SET GLP=%GIT_ALAS%
echo 1. https://github.com/LmeSzinc/AzurLaneAutoScript (Main Repo, When in doubt, use it)
echo 2. https://github.com/whoamikyo/AzurLaneAutoScript (Mirrored Fork)
echo 3. https://github.com/whoamikyo/AzurLaneAutoScript (nightly build, dont use)
echo 4. Back to main menu
echo 4. https://gitee.com/lmeszinc/AzurLaneAutoScript.git (Recommended for CN users)
echo 5. Back to main menu
echo.
echo :: Type a 'number' and press ENTER
echo :: Type 'exit' to quit
@ -181,7 +189,8 @@ SET GLP=%GIT_ALAS%
if %choice%==1 GOTO LmeSzinc
if %choice%==2 GOTO whoamikyo
if %choice%==3 GOTO nightly
if %choice%==4 GOTO alas
if %choice%==4 GOTO gitee
if %choice%==5 GOTO alas
if %choice%==exit GOTO EOF
else (
@ -211,7 +220,7 @@ SET GLP=%GIT_ALAS%
) else (
echo :: Git not detected, maybe there was an installation issue
echo check if you have this directory:
echo AzurLaneAutoScript\python-3.7.6.amd64\Git\cmd
echo AzurLaneAutoScript\toolkit\Git\cmd
echo.
pause > NUL
goto updater_menu
@ -232,7 +241,7 @@ SET GLP=%GIT_ALAS%
) else (
echo :: Git not detected, maybe there was an installation issue
echo check if you have this directory:
echo AzurLaneAutoScript\python-3.7.6.amd64\Git\cmd
echo AzurLaneAutoScript\toolkit\Git\cmd
pause > NUL
goto updater_menu
)
@ -251,58 +260,87 @@ SET GLP=%GIT_ALAS%
) else (
echo :: Git not detected, maybe there was an installation issue
echo check if you have this directory:
echo AzurLaneAutoScript\python-3.7.6.amd64\Git\cmd
echo AzurLaneAutoScript\toolkit\Git\cmd
echo.
pause > NUL
goto updater_menu
)
:: -----------------------------------------------------------------------------
:check_connection
cls
echo.
echo :: Checking For Internet Connection to Github...
echo.
timeout /t 2 /nobreak > NUL
rem :check_connection
rem cls
rem echo.
rem echo :: Checking For Internet Connection to Github...
rem echo.
rem timeout /t 2 /nobreak > NUL
ping -n 1 google.com -w 20000 >nul
rem ping -n 1 google.com -w 20000 >nul
if %errorlevel% == 0 (
echo You have a good connection with Github! Proceeding...
echo press any to proceed
pause > NUL
goto updater_menu
) else (
echo :: You don't have a good connection out of China
echo :: It might be better to update using Gitee
echo :: Redirecting...
echo.
echo Press any key to continue...
pause > NUL
goto start_gitee
)
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 ) else (
rem echo :: You don't have a good connection out of China
rem echo :: It might be better to update using Gitee
rem echo :: Redirecting...
rem echo.
rem echo Press any key to continue...
rem pause > NUL
rem goto start_gitee
rem )
:: -----------------------------------------------------------------------------
:start_gitee
:gitee
call %GLP% --version >nul
if %errorlevel% == 0 (
echo GIT Found! Proceeding..
echo Updating from LmeSzinc repository..
call %GLP% fetch origin master
call %GLP% reset --hard origin/master
call %GLP% pull --ff-only origin master
call %GLP% fetch lmeszincgitee master
call %GLP% reset --hard lmeszincgitee/master
call %GLP% pull --ff-only lmeszincgitee master
echo DONE!
echo Press any key to proceed
pause > NUL
goto alas
goto updater_menu
) else (
echo :: Git not detected, maybe there was an installation issue
echo check if you have this directory:
echo AzurLaneAutoScript\python-3.7.6.amd64\Git\cmd
echo.
echo AzurLaneAutoScript\toolkit\Git\cmd
pause > NUL
goto alas
goto updater_menu
)
:: -----------------------------------------------------------------------------
:toolkit
call %GLP% --version >nul
if %errorlevel% == 0 (
echo GIT Found! Proceeding..
echo Updating toolkit..
call cd toolkit
echo ## initializing toolkit..
call %GIT% init
call %GIT% config --global core.autocrlf false
echo ## Adding files
call %GIT% add -A
echo ## adding origin..
call %GIT% remote add origin %ENV%
echo Fething...
call %GIT% fetch origin master
call %GIT% reset --hard origin/master
echo Pulling...
call %GIT% pull --ff-only origin master
call cd ..
echo DONE!
echo Press any key to proceed
pause > NUL
goto 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
)
:: -----------------------------------------------------------------------------
:EOF
exit

View File

@ -3,9 +3,9 @@ setlocal EnableDelayedExpansion
title Dev_tools
pushd "%~dp0"
:: -----------------------------------------------------------------------------
SET ADB_PATH=%~dp0python-3.7.6.amd64\Lib\site-packages\adbutils\binaries\adb.exe
SET ADB_PATH=%~dp0toolkit\Lib\site-packages\adbutils\binaries\adb.exe
SET ADB=%ADB_PATH%
SET PYTHON_PATH=%~dp0python-3.7.6.amd64\python.exe
SET PYTHON_PATH=%~dp0toolkit\python.exe
SET PYTHON=%PYTHON_PATH%
:: -----------------------------------------------------------------------------
goto check_Permissions
@ -109,7 +109,7 @@ CALL %ADB% connect %ADB_PORT%
pause > NUL
goto dev_menu
) else (
echo :: it was not possible to open dev_tools.emulator_test, make sure you have a folder python-3.7.6.amd64
echo :: it was not possible to open dev_tools.emulator_test, make sure you have a folder toolkit
echo :: inside AzurLaneAutoScript folder.
echo.
pause > NUL
@ -125,7 +125,7 @@ CALL %ADB% connect %ADB_PORT%
pause > NUL
goto dev_menu
) else (
echo :: it was not possible to open dev_tools.button_extract, make sure you have a folder python-3.7.6.amd64
echo :: it was not possible to open dev_tools.button_extract, make sure you have a folder toolkit
echo :: inside AzurLaneAutoScript folder.
echo.
pause > NUL
@ -141,7 +141,7 @@ CALL %ADB% connect %ADB_PORT%
pause > NUL
goto dev_menu
) else (
echo :: it was not possible to open dev_tools.grids_debug, make sure you have a folder python-3.7.6.amd64
echo :: it was not possible to open dev_tools.grids_debug, make sure you have a folder toolkit
echo :: inside AzurLaneAutoScript folder.
echo.
pause > NUL
@ -157,7 +157,7 @@ CALL %ADB% connect %ADB_PORT%
pause > NUL
goto dev_menu
) else (
echo :: it was not possible to open dev_tools.item_stastistics, make sure you have a folder python-3.7.6.amd64
echo :: it was not possible to open dev_tools.item_stastistics, make sure you have a folder toolkit
echo :: inside AzurLaneAutoScript folder.
echo.
pause > NUL
@ -173,7 +173,7 @@ CALL %ADB% connect %ADB_PORT%
pause > NUL
goto dev_menu
) else (
echo :: it was not possible to open dev_tools.relative_crop, make sure you have a folder python-3.7.6.amd64
echo :: it was not possible to open dev_tools.relative_crop, make sure you have a folder toolkit
echo :: inside AzurLaneAutoScript folder.
echo.
pause > NUL
@ -189,7 +189,7 @@ CALL %ADB% connect %ADB_PORT%
pause > NUL
goto dev_menu
) else (
echo :: it was not possible to open dev_tools.map_extractor, make sure you have a folder python-3.7.6.amd64
echo :: it was not possible to open dev_tools.map_extractor, make sure you have a folder toolkit
echo :: inside AzurLaneAutoScript folder.
echo.
pause > NUL
@ -205,7 +205,7 @@ CALL %ADB% connect %ADB_PORT%
pause > NUL
goto dev_menu
) else (
echo :: it was not possible to open dev_tools.word_template_extractor, make sure you have a folder python-3.7.6.amd64
echo :: it was not possible to open dev_tools.word_template_extractor, make sure you have a folder toolkit
echo :: inside AzurLaneAutoScript folder.
echo.
pause > NUL
@ -246,7 +246,7 @@ goto adbss
pause > NUL
goto dev_menu
) else (
echo :: it was not possible to open dev_tools.uiautomator2_screenshot, make sure you have a folder python-3.7.6.amd64
echo :: it was not possible to open dev_tools.uiautomator2_screenshot, make sure you have a folder toolkit
echo :: inside AzurLaneAutoScript folder.
echo.
pause > NUL

View File

@ -1,24 +1,15 @@
# How to use updater.bat
# How to Update
* This only will work if you have download the repository with GIT, if you downloaded the .zip you will have to delete the folder and download it again through GIT, see step 2.
* [Download and install the last GIT version](https://git-scm.com/download/win) (It is not necessary if you installed with Easy_Install-V2.bat)
* Open the file `Easy_Install-V2.bat` with any text editor
* Change the `C:\Program Files\Git\cmd` for the path that you are installed, you don't usually need to change it, but make sure it is installed in the same path as it is in the file., if you installed with `Easy_Install-V2.bat` it's probably all right and there's no need to do anything else
* It is important that the path you enter is the same as the one with the git.exe file as shown in the image.
Step 1. Run alas.bat
![](how_to_update.assets/git.png)
* In `Easy_Install-V2.bat` we have 3 source options, I'm just going to tell you to use source 1 and only use another if someone tells you to do it or likes to test new adventures.
Step 2. Select
option 4 to select the updater
# How to Download repository through GIT
Step 3. Select which repo to pull from, if in doubt go with option 1.
* Like above, you need GIT installed and make sure it is installed in the same path as it's in the file in the file `Easy_Install-V2.bat`.
* If you already download `AzurLaneAutoScript-master.zip`, just extract and double-click in `Easy_Install-V2.bat`, then the repository will be cloned again, but now the .git folder will be created.
* If you haven't downloaded the .zip, just download the `Easy_Install-V2.bat` file, create a folder where you want ALAS to be downloaded, put `dEasy_Install-V2.bat` inside that folder and click.
This will update your ALAS.
If you do it right, you will have a similar result, so only what has been changed will be downloaded again.
![](how_to_update.assets/update.png)
If you do not have a alas.bat with the update option, please download a fresh copy from newest release.
# DO NOT ADD FILES MANUALLY INSIDE THE ALAS FOLDER, THIS WILL CAUSE CONFLICTS AND YOU WILL HAVE TO DOWNLOAD EVERYTHING AGAIN.

View File

@ -12,7 +12,7 @@ class Connection:
_adb_binary = ''
adb_binary_list = [
r'.\adb\adb.exe',
r'.\python-3.7.6.amd64\Lib\site-packages\adbutils\binaries\adb.exe',
r'.\toolkit\Lib\site-packages\adbutils\binaries\adb.exe',
r'.\python\Lib\site-packages\adbutils\binaries\adb.exe',
]