From 489306d4a2b678d022c0187d0f9d129a5ba7c030 Mon Sep 17 00:00:00 2001 From: Tiiffi Date: Sat, 9 Nov 2024 13:48:23 +0200 Subject: [PATCH] Add windows batch scripts --- LICENSE | 2 +- create_shortcut.bat | 31 +++++++++++++++++++++++++++++++ launch.bat | 29 +++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 create_shortcut.bat create mode 100644 launch.bat diff --git a/LICENSE b/LICENSE index e382f8b..7469011 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2012-2021, Tiiffi +Copyright (c) 2012-2024, Tiiffi This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/create_shortcut.bat b/create_shortcut.bat new file mode 100644 index 0000000..32f2666 --- /dev/null +++ b/create_shortcut.bat @@ -0,0 +1,31 @@ +@echo off +@cls + +@set /p host="Enter host (default: "127.0.0.1"): " +@if "%host%"=="" set host=127.0.0.1 + +@set /p port="Enter port (default: 25575): " +@if "%port%"=="" set port=25575 + +@set /p passwd="Enter password: " +@if "%passwd%"=="" set passwd= + +set name=connect_%host%-%port% + +@set /p name="Enter shortcut name (default: "%name%.bat"): " +@if "%name%"=="" set name=connect_%host%-%port% + +set command=@mcrcon.exe -t -H %host% -P %port% -p %passwd% + +@echo %command% >> %name%.bat +@echo. +@echo Command: "%command%" +@echo. +@echo Shortcut "%name%.bat" created! +@echo. + +@set "host=" +@set "port=" +@set "passwd=" + +@pause diff --git a/launch.bat b/launch.bat new file mode 100644 index 0000000..b8d05d5 --- /dev/null +++ b/launch.bat @@ -0,0 +1,29 @@ +@echo off +@cls + +@if not exist mcrcon.exe ( + @echo ERROR: Cannot find "mcrcon.exe". Bailing out! + @echo. + @pause + @exit +) + +@set /p host="Enter host (default: 127.0.0.1): " +@if "%host%"=="" set host=127.0.0.1 + +@set /p port="Enter port (default: 25575): " +@if "%port%"=="" set port=25575 + +@set /p passwd="Enter password: " +@if "%passwd%"=="" set passwd= + +@echo. +mcrcon.exe -t -H %host% -P %port% -p %passwd% +@echo. + +@set "host=" +@set "port=" +@set "passwd=" + +@pause +