[Windows][StartUp] RitzyLaunch - An Easy .bat Startup

Discussion in 'Bukkit Tools' started by RitzyCosmos, May 29, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    RitzyCosmos

    "RitzyLaunch" is a .bat file for use by all server owners (who still use the .bat file to start their server).

    <Edit by Moderator: Redacted mediafire url>
    Just extract and place into server folder.

    It let's it's user choose:
    - The "Server Name" displayed in the window bar.
    - Amount of RAM (in GB)
    - The name of the .jar file.
    - Let the user restart the server without re-opening the file.
    - Allowing for the ability of a complete restart in the same window, not a reload.

    It was made to:
    - Let it's user select the amount of RAM used each session, without the manual modification of the code.
    - Give the window bar a nicer look, showing Server Name, RAM for the session, and .jar name.
    - Make the overall server start look and feel better.
    - Provide "troubleshooting" options.



    <font color="#339966">Green</font> - When the user is setting the server up, or when the server is running.
    <font color="#993300">Red</font> - When the server is stopped, or other.


    [​IMG]



    [​IMG]

    Download or Copy & Paste over current:

    Show Spoiler
    @ echo off
    title RitzyCosmos's .bat
    rem RitzyCosmos's .bat. Made by him or herself.
    rem Edit at your own will.

    :title
    cls
    color 0A
    echo.
    echo This "Launcher" was made by RitzyCosmos.
    echo He or She would like you to link to the original post if you share this.
    echo (It would be nice, but I can't enforce anything. :) )
    echo.
    echo -- After doing this a few times you should get the hang of it.
    echo -- It isn't as tedious as it seems.
    echo -- If you mess up at any point and want to go back, simply type in 'back' (all undercase) into the field it is prompting.
    echo.
    echo.
    echo Please choose a Server Name.
    echo - This name is for all intensive purposes "fun," and will not be displayed anywhere but the console window.
    echo.
    set /p title=Server Name:
    if "%title%"=="" goto title
    goto ram

    :ram
    cls
    title Server: %title%
    echo.
    echo.
    echo Enter the amount of RAM your system has.
    echo Or, enter the amount of RAM you want to use this session.
    echo.
    echo - The amount of RAM must be a numerical value with no decimals, or else errors will be thrown.
    echo - Must be in GB, it is automatically calculated.
    echo - If the amount of RAM throws an error, proceed to troubleshooting.
    echo.
    set /p ram1=RAM Amount (in GB):
    if "%ram1%"=="" goto ram
    if "%ram1%"=="back" goto title
    goto jar

    :jar
    set /a ram2=%ram1% * 1024
    cls
    title Server: %title% RAM: %ram2%MB [%ram1%GB]
    echo.
    echo.
    echo Enter the name of the Craftbukkit .jar (exclude .jar).
    echo - The craftbukkit file must be in the same directory as this.
    echo - 'craftbukkit' should be entered if the file is craftbukkit.jar
    echo - After you hit ENTER, the server will initialize. However, there may be errors.
    echo.
    set /p jar=.jar Name:
    if "%jar%"=="" goto title
    if "%jar%"=="back" goto ram
    goto launch

    :launch
    cls
    title Server: %title% RAM: %ram2%MB [%ram1%GB] Jar: %jar%.jar
    color 0A
    echo.
    java -Xmx%ram2%M -jar %jar%.jar -o true
    color 0C
    echo.
    echo [%time% INFO]: Server Closed
    echo.
    echo.
    echo Your server has been turned off.
    echo Hit ENTER to close this window.
    echo.
    echo.
    echo.
    echo.
    echo.
    echo.
    echo.
    echo ________________________
    echo.
    echo Further Options
    echo ________________________
    echo.
    echo 1. Type in 'restart' to restart your server.
    echo 2. Type in 'T' or 't' for server startup troubleshooting.
    echo.
    set /p trouble= Please select an option:
    if "%trouble%"=="t" goto trouble
    if "%trouble%"=="T" goto trouble
    if "%trouble%"=="restart" goto launch
    exit

    :trouble
    cls
    echo.
    echo TROUBLESHOOTING YOUR SERVER BOOT
    echo ________________________________
    echo.
    echo.
    echo So... you didn't issue /stop.
    echo.
    echo Depending on the information given to you, this means...
    echo.
    echo.
    echo 1. You do not have Java, or it is not configured correctly. (Search Your Error)
    echo 2. You have selected an amount of RAM your computer does not have available.
    echo 3. The name of the .jar is incorrect, or the .jar is not in the same directory.
    echo.
    set /p restart= Hit ENTER to close, or type in 'R' or 'r' then hit ENTER to restart:
    if "%restart%"=="r" goto title
    if "%restart%"=="R" goto title
    exit


    PAUSE >nul



    If you choose to try it, you have to read everything carefully the first time. After that it's simple and fast.

    The functions of RitzyLaunch came out of my own brain, I'm sorry if others have similar start files like mine. The most recent one I have found was by cato11112 and I have not taken anything from their work. See their variation here; Custom Launch.bat File
     
    Last edited by a moderator: Nov 2, 2016
  2. Offline

    ZanderMan9

  3. Offline

    RitzyCosmos

Thread Status:
Not open for further replies.

Share This Page