This repository has been archived by the owner on Oct 5, 2022. It is now read-only.
forked from DeathShadow/Contra
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRUN-Contra.cmd
101 lines (90 loc) · 2.67 KB
/
RUN-Contra.cmd
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
@echo off
setlocal enableextensions
pushd %~dp0
for %%* in (.) do @title %%~n*
popd
endlocal
fsutil dirty query %systemdrive% >nul
if %errorLevel% == 0 (
echo Don't run Contra as administrator! You shouldn't need to run Contra as administrator. If you do, then you're doing it wrong!
pause
goto stop
)
rem Contra run script v3.0 by photofroggy
rem Released under a Creative Commons 3.0 license.
rem This is used to launch Contra.
rem It's also a shell for the process.
if not exist phpbin (
if not exist run.php (
echo =========================== WARNING: LAUNCH ERROR =============================
echo.
echo ** It looks as though you are trying to launch Contra from outside the bot
echo ** folder. This does not tend to work on Windows. Please cd to the bot's
echo ** directory before trying again, or double-click RUN-Contra.cmd to run
echo ** the bot.
echo.
echo ===============================================================================
pause
goto stop
)
)
for /f "eol=# delims=" %%g in (phpbin) do set phpbin=%%g
set args=%1
if not exist "%phpbin%" goto nophp
"%phpbin%" run.php %1
goto loop
:nophp
echo You must have PHP installed! Change the file path in ~/phpbin to the correct
echo file path.
pause
goto stop
:loop
if exist "storage\bat\quit.bcd" (
del storage\bat\quit.bcd
del storage\lock
goto stop
)
if exist "storage\bat\restart.bcd" (
del storage\bat\restart.bcd
del storage\lock
goto refresher
)
if exist "storage\bat\update.bcd" (
del storage\bat\update.bcd
del storage\lock
goto update
)
if !%1==! goto stopped
if %1==--bot goto stopped
if %1==--debug goto stopped
goto stop
:refresher
echo ===============================================================================
echo ** Contra is restarting.
echo ** One moment please...
echo ===============================================================================
"%phpbin%" run.php %1
goto loop
:update
echo ===============================================================================
echo ** Contra is updating.
echo ** One moment please...
echo ===============================================================================
"%phpbin%" run.php %1
goto loop
:stopped
echo ===============================================================================
echo ** Contra has stopped.
goto confirm
:confirm
set /p input=** Would you like to reboot? [y/n]
if %input%==y goto continue
if %input%==Y goto continue
if %input%==n goto stop
if %input%==N goto stop
goto confirm
:continue
echo ===============================================================================
"%phpbin%" run.php %1
goto loop
:stop