Skip to content

Commit 6efad86

Browse files
author
Kaila_Btw
committed
Add Parameter Support for CLI Autostart - Batch 1
Compile_windows/run_windows - Makes compile and run #FABULOUS#. adds TIMEOUT delay for error checking. Long wait times after actual errors. Short wait times after regular build/launch. Also fixes bug where cmd run windows would occasionally not close when the client was manually closed. gradlew - adds 30s timeout after "fail" error is thrown. Add 3s timeout after compile before autoclose. Launch Multiple Bots Example - directions to edit a script to launch several clients at a time. AsgarnianIce - add FULL food selector from food array as a test case for adding to other scripts, primarily K_paladins. Allows food selection to work for parameters and CLI parameters for autostart. Various scripts - remove unneeded imports. remove some "else break" from loops.
1 parent 9ad4358 commit 6efad86

39 files changed

+6531
-5931
lines changed

compile_windows.bat

+14
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1+
@echo off
2+
echo ###############################################
3+
echo # #
4+
echo # Compiling IdleRSC Botting Client #
5+
echo # #
6+
echo ############################################### 
7+
18
gradlew.bat build
9+
10+
@rem pause here will NEVER activate unless gradle build fails to process.
11+
@rem previously cmd would close without any error codes
12+
13+
echo  ERROR: Could not Compile 
14+
pause
15+

gradlew.bat

+96-92
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,96 @@
1-
@rem
2-
@rem Copyright 2015 the original author or authors.
3-
@rem
4-
@rem Licensed under the Apache License, Version 2.0 (the "License");
5-
@rem you may not use this file except in compliance with the License.
6-
@rem You may obtain a copy of the License at
7-
@rem
8-
@rem https://www.apache.org/licenses/LICENSE-2.0
9-
@rem
10-
@rem Unless required by applicable law or agreed to in writing, software
11-
@rem distributed under the License is distributed on an "AS IS" BASIS,
12-
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
@rem See the License for the specific language governing permissions and
14-
@rem limitations under the License.
15-
@rem
16-
17-
@if "%DEBUG%"=="" @echo off
18-
@rem ##########################################################################
19-
@rem
20-
@rem Gradle startup script for Windows
21-
@rem
22-
@rem ##########################################################################
23-
24-
@rem Set local scope for the variables with windows NT shell
25-
if "%OS%"=="Windows_NT" setlocal
26-
27-
set DIRNAME=%~dp0
28-
if "%DIRNAME%"=="" set DIRNAME=.
29-
@rem This is normally unused
30-
set APP_BASE_NAME=%~n0
31-
set APP_HOME=%DIRNAME%
32-
33-
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
34-
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
35-
36-
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
37-
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
38-
39-
@rem Find java.exe
40-
if defined JAVA_HOME goto findJavaFromJavaHome
41-
42-
set JAVA_EXE=java.exe
43-
%JAVA_EXE% -version >NUL 2>&1
44-
if %ERRORLEVEL% equ 0 goto execute
45-
46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
51-
52-
goto fail
53-
54-
:findJavaFromJavaHome
55-
set JAVA_HOME=%JAVA_HOME:"=%
56-
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
57-
58-
if exist "%JAVA_EXE%" goto execute
59-
60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
65-
66-
goto fail
67-
68-
:execute
69-
@rem Setup the command line
70-
71-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
72-
73-
74-
@rem Execute Gradle
75-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
76-
77-
:end
78-
@rem End local scope for the variables with windows NT shell
79-
if %ERRORLEVEL% equ 0 goto mainEnd
80-
81-
:fail
82-
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83-
rem the _cmd.exe /c_ return code!
84-
set EXIT_CODE=%ERRORLEVEL%
85-
if %EXIT_CODE% equ 0 set EXIT_CODE=1
86-
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87-
exit /b %EXIT_CODE%
88-
89-
:mainEnd
90-
if "%OS%"=="Windows_NT" endlocal
91-
92-
:omega
1+
@rem
2+
@rem Copyright 2015 the original author or authors.
3+
@rem
4+
@rem Licensed under the Apache License, Version 2.0 (the "License");
5+
@rem you may not use this file except in compliance with the License.
6+
@rem You may obtain a copy of the License at
7+
@rem
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
9+
@rem
10+
@rem Unless required by applicable law or agreed to in writing, software
11+
@rem distributed under the License is distributed on an "AS IS" BASIS,
12+
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
@rem See the License for the specific language governing permissions and
14+
@rem limitations under the License.
15+
@rem
16+
17+
@if "%DEBUG%"=="" @echo off
18+
@rem ##########################################################################
19+
@rem
20+
@rem Gradle startup script for Windows
21+
@rem
22+
@rem ##########################################################################
23+
24+
@rem Set local scope for the variables with windows NT shell
25+
if "%OS%"=="Windows_NT" setlocal
26+
27+
set DIRNAME=%~dp0
28+
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
30+
set APP_BASE_NAME=%~n0
31+
set APP_HOME=%DIRNAME%
32+
33+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
34+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
35+
36+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
37+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
38+
39+
@rem Find java.exe
40+
if defined JAVA_HOME goto findJavaFromJavaHome
41+
42+
set JAVA_EXE=java.exe
43+
%JAVA_EXE% -version >NUL 2>&1
44+
if %ERRORLEVEL% equ 0 goto execute
45+
46+
echo.
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48+
echo.
49+
echo Please set the JAVA_HOME variable in your environment to match the
50+
echo location of your Java installation.
51+
52+
goto fail
53+
54+
:findJavaFromJavaHome
55+
set JAVA_HOME=%JAVA_HOME:"=%
56+
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
57+
58+
if exist "%JAVA_EXE%" goto execute
59+
60+
echo.
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62+
echo.
63+
echo Please set the JAVA_HOME variable in your environment to match the
64+
echo location of your Java installation.
65+
66+
goto fail
67+
68+
:execute
69+
@rem Setup the command line
70+
71+
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
72+
73+
74+
@rem Execute Gradle
75+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
76+
77+
:end
78+
@rem End local scope for the variables with windows NT shell
79+
if %ERRORLEVEL% equ 0 goto mainEnd
80+
81+
:fail
82+
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83+
rem the _cmd.exe /c_ return code!
84+
set EXIT_CODE=%ERRORLEVEL%
85+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
86+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87+
echo  COMPILE ERROR, CLOSING! 
88+
TIMEOUT /t 30
89+
exit /b %EXIT_CODE%
90+
91+
:mainEnd
92+
if "%OS%"=="Windows_NT" endlocal
93+
94+
:omega
95+
96+
TIMEOUT /t 3

launchMultipleBotsExample.bat

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
@echo off
2+
3+
@title Launching Multiple Bots > NUL
4+
@echo #############################################################
5+
@echo # #
6+
@echo # Script to Launch Multiple Bots #
7+
@echo # Open (edit) this .bat file for setup directions #
8+
@echo # #
9+
@echo ############################################################# 
10+
@echo 
11+
12+
@rem DIRECTIONS:
13+
@rem You can launch .vbs or .bat files with this
14+
@rem .vbs simply redirect to the .bat file, and run without a cmd window popup
15+
@rem Ensure linked files dont use space, ONLY underscores i.e. _
16+
@rem for Example "run_exampleAccount_1.bat" will work correctly.
17+
@rem Do NOT use "run exampleAccount 1.bat" with spaces, it will not work.
18+
@rem This counts for the actual file name as well as in this batch file
19+
20+
@rem Replace (edit) each "run_exampleAccount_1.bat" within this bat file
21+
@rem With the name of your individual account launch files
22+
@rem CLI (Command Line Interface) parameters go on each account's .bat file
23+
@rem for example --scriptname K_Paladins --scriptarguments autostart
24+
25+
@rem leave TIMEOUT /t 2 > NUL to ensure OS has time to process each run command (~2s)
26+
@rem TIMEOUT could probably be reduced to 1s, but could cause some issue
27+
@rem Below is main script of this batch file, CHANGE CONTENTS BELOW:
28+
29+
TIMEOUT /t 1 > NUL
30+
run_exampleAccount_01.vbs
31+
TIMEOUT /t 2 > NUL
32+
run_exampleAccount_02.vbs
33+
TIMEOUT /t 2 > NUL
34+
run_exampleAccount_03.vbs
35+
TIMEOUT /t 2 > NUL
36+
run_exampleAccount_04.vbs
37+
TIMEOUT /t 2 > NUL
38+
run_exampleAccount_05.vbs
39+
TIMEOUT /t 2 > NUL
40+
run_exampleAccount_06.bat
41+
TIMEOUT /t 2 > NUL
42+
run_exampleAccount_07.bat
43+
TIMEOUT /t 2 > NUL
44+
run_exampleAccount_08.bat
45+
TIMEOUT /t 2 > NUL
46+
run_exampleAccount_09.bat
47+
TIMEOUT /t 2 > NUL
48+
run_exampleAccount_10.bat
49+
TIMEOUT /t 5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Set WshShell = CreateObject("WScript.Shell")
2+
WshShell.Run chr(34) & "run_exampleAccount_01.vbs" & Chr(34), 0
3+
Set WshShell = Nothing

run_windows.bat

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
1-
@echo offMan"
1+
@echo off
2+
echo ###############################################
3+
echo # #
4+
echo # Launching IdleRSC Botting Client #
5+
echo # #
6+
echo ############################################### 
7+
28
java -jar IdleRSC.jar --username "username" --password "password"
9+
10+
echo  CLIENT ERROR, CLOSING! 
11+
TIMEOUT /t 3

0 commit comments

Comments
 (0)