@echo off
title Just Sctipt Client
for /f "delims=" %%a in ('inifile "cfg\config.ini" [Settings]') do %%a
if %settings.autohide%==true (
cmdfocus /min
)
for /f "delims=" %%a in ('inifile "cfg\lang.ini" [%settings.lang%]') do %%a
for /f "delims=" %%a in ('inifile "cfg\config.ini" [User]') do %%a
for /f "delims=" %%a in ('inifile "cfg\config.ini" [HOST]') do %%a
for /f "delims=" %%a in ('inifile "cfg\config.ini" [Script]') do %%a
for /f "delims=" %%a in ('curl "%host.url%?login=%user.login%&password=%user.password%&version=%script.version%&type=test"') do set code=%%a
echo %code%
if NOT %code%==2 (
if %code%==56 (
call :update
goto 1
) else (
echo Не удалось подключиться к серверу, попробуйте немного позже или свяжитесь с автором в ВК: vk.com/keller18306
cmdfocus /center /beep
pause>nul
exit /b
)
) else (
cls
goto 1
)
echo Ошибка!
cmdfocus /center /beep
pause>null
exit /b
:1
if %settings.debug%==true (
for /f "delims=" %%a in ('curl "%host.url%?login=%user.login%&password=%user.password%&version=%script.version%&type=update"') do set code=%%a
echo %code%
call :update
echo [%date% %time%] %lang.send_data_to_server%
) else (
for /f "delims=" %%a in ('curl "%host.url%?login=%user.login%&password=%user.password%&version=%script.version%&type=update"') do set code=%%a>nul
call update
)
TIMEOUT /T 5 /NOBREAK>nul
goto 1
echo Ошибка!
pause>nul
exit /b
rem ____________FUNCTIONS_____________
:update
if %code%==56 (
for /f "delims=" %%a in ('curl "%host.url%?get=update"') do set url=%%a
echo %url%
pause
if %settings.debug%==true (
echo %url%
wget -O update.zip %url%
7z e \update\update.zip -o\update\ -y
) else (
wget -O update.zip %url%>nul
7z e \update\update.zip -o\update\ -y>nul
)
pause
)
exit /b
rem ______________END_________________