-
Notifications
You must be signed in to change notification settings - Fork 95
/
Copy pathStartBot.bat
107 lines (104 loc) · 2.82 KB
/
StartBot.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
@echo off
cls
echo ### ###
echo # BotStarter - CorpNewt #
echo ### ###
echo.
set "thisDir=%~dp0"
set "rd=Redis-x64-5.0.14.1"
set "rdold=Redis-x64-3.2.100"
set "redis=redis-server.exe"
set "start=Start.bat"
set "ld=Lavalink"
set "lud=Lavalink-Updater"
set "lava=Lavalink.bat"
set "lavajar=Lavalink.jar"
set /a wait=5
if EXIST "%thisDir%\%lud%\%lava%" (
echo Starting Lavalink server...
pushd "%thisDir%\%lud%"
start "" cmd.exe /c "%lava%"
popd
echo Waiting %wait% seconds...
echo.
) else (
if EXIST "%thisDir%\%ld%\%lava%" (
echo Starting Lavalink server...
pushd "%thisDir%\%ld%"
start "" cmd.exe /c "%lava%"
popd
echo Waiting %wait% seconds...
echo.
) else (
if EXIST "%thisDir%\%ld%\%lavajar%" (
echo !! WARNING: Located older Lavalink install, consider using Lavalink-Updater:
echo https://github.com/corpnewt/Lavalink-Updater
echo.
echo Starting Lavalink server...
pushd "%thisDir%\%ld%"
start "" java -jar "%lavajar%"
popd
echo Waiting %wait% seconds...
echo.
) else (
echo "%thisDir%\%lud%\%lava%"
echo does not exist!
echo.
echo You can get it from:
echo https://github.com/corpnewt/Lavalink-Updater
echo.
pause
exit /b
)
)
)
timeout %wait%
echo.
REM Only start the Redis server if we're using the redis
REM branch of CorpBot.py
if EXIST "%thisDir%\Cogs\PandorasDB.py" (
if EXIST "%thisDir%\%rd%\%redis%" (
echo Starting database...
pushd "%thisDir%\%rd%"
start "" "%redis%"
popd
echo Waiting %wait% seconds...
echo.
) else (
if EXIST "%thisDir%\%rdold%\%redis%" (
echo !! WARNING: Located older redis install, consider updating via the following link:
echo https://github.com/tporadowski/redis/releases/download/v5.0.14.1/Redis-x64-5.0.14.1.zip
echo.
echo Starting database...
pushd "%thisDir%\%rdold%"
start "" "%redis%"
popd
echo Waiting %wait% seconds...
echo.
) else (
echo "%thisDir%\%rd%\%redis%"
echo does not exist!
echo.
echo You can get it from:
echo https://github.com/tporadowski/redis/releases/download/v5.0.14.1/Redis-x64-5.0.14.1.zip
echo.
pause
exit /b
)
)
timeout %wait%
echo.
)
if EXIST "%thisDir%\%start%" (
echo Starting bot...
start cmd /c "%thisDir%\%start%"
echo.
) else (
echo "%thisDir%\%start%"
echo does not exist!
pause
exit /b
)
echo.
echo Done.
timeout %wait%