Admin Better Console (For Self Hosted Servers)

Discussion in 'Bukkit Tools' started by Airbornz, Aug 14, 2014.

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

    Airbornz

    Hello There!

    I have made a custom run.bat for self hosted servers. This code is open source, be free to change it as you like and even post your code in the comments. Please note that this only works on Windows since it is a batch file.

    Support:
    To Get Help or Report A Bug Send A Email Here:

    Features:

    Console Header and Footer. ------- Start Of Server Log -------
    Stop Message. Server Has Stopped Check Above For Details.
    Accidental Server Launch Stopper. This brings you to a menu where you must push a button to start the server.

    Many New Features Including color schemes a main menu, settings ram amounts and more

    Version 2.5
    --- Update Notes ----
    * Performance Update for Slower Computers
    * Added The Ability To Add Custom Java Arguments Beyond Just Ram Amounts!
    * Added Version Variable
    * Added Some Usage Notes On The Top
    * Fixed Some Code To Make A Bit More Compact
    * Added Alert Flags (Looks Like This: [!] So if you see one make sure to read it!)
    * Fixed A Error Not Loading When Not Finding Craftbukkit In The Correct Folder
    * Fixed Some Text Not Loading Right On Certain Pages

    How To Get It:

    1. Click Me To Download It!

    2. Done!

    Just put that file in your server folder and like magic it works!

    Your antivirus may flag that as a possible virus since its a batch file. This code is open source so... Here:

    Code:
    @echo off
    
    set version=2.5
    :: Made by Airbornz
    :: This is a open source program feel free to copy but you must leave proper credit!
    :: If you use this as a reference for your own version you do not have permission to sell it!
    :: I will keep this project free until further notice (Likely never to stop) If you have bought this you have been scammed!
    :: Add-ons and Alternates are encouraged! But They Are NOT Supported Unless Released By Airbornz!
    
    :boot
    set prefix=Better Console
    Title %prefix%
    if not exist craftbukkit.jar goto error1
    if exist color.txt set /p color=<bccolor.txt
    if not exist bcusr.txt goto settup
    set /p usr=<bcusr.txt
    goto core
    
    :settup
    Title %prefix% : Settup
    cls
    echo.
    echo Welcome To Better Console!
    echo.
    echo Let me get to know you better.
    echo.
    set /p usr=Your Name:
    echo %usr%>>bcusr.txt
    echo java -Xms1G -Xmx1G -jar craftbukkit.jar -o true>>bcram.txt
    echo.
    echo Your Done! That Simple!
    echo.
    echo Would you like to use custom coloring?
    set /p cmd=Y or N:
    if %cmd%==y goto color
    if %cmd%==Y goto color
    cls
    echo Ok Lets Start Launching Your Server.
    pause
    
    :core
    Title %prefix% : Main Menu
    color %color%
    cls
    echo.
    echo Welcome Back %usr%,
    echo.
    echo Options:
    echo.
    echo 1. Start The Server
    echo 2. Settings
    echo 3. Exit
    echo.
    echo Enter The Number Of Your Choice.
    echo.
    set /p cmd=Command ID:
    if %cmd%==1 goto start
    if %cmd%==2 goto set
    if %cmd%==3 exit
    cls
    echo.
    echo Invaild Option (%cmd%)
    pause
    goto core
    
    :start
    Title %prefix% : Minecraft Server
    cls
    echo.
    echo ----- Start Of Server Log -----
    echo %prefix%: Server Starting!
    echo %prefix%: Loading Java Arguments To Use!
    set /p arg=<bcram.txt
    echo %prefix%: Done Loading! Starting Server Now!
    %arg%
    :stop
    echo %prefix%: Server Stopped Check Above For Details!
    echo ----- End Of Server Log -----
    echo %prefix%: Restart Server?
    set /p cmd=Y or N:
    if %cmd%==y goto start
    if %cmd%==Y goto start
    cls
    echo.
    echo Ok, Press Any Key To Exit!
    pause > nul
    exit
    
    :set
    Title %prefix% : Settings
    color %color%
    cls
    echo.
    echo Welcome %usr% To The Settings Menu!
    echo.
    echo Settings:
    echo.
    echo 1. Coloring - Set The Color Scheme
    echo 2. Push To Start - Launch Server When Opened (Disables Tons of Features)
    echo 3. Ram Allocation - Set Ram Allocation (Advanced)
    echo 4. Custom Arguments - Set custom arguments besides the ram! (Advanced)
    echo 5. Back To Main Menu
    echo.
    set /p cmd=Command:
    if %cmd%==1 goto color
    if %cmd%==2 goto setpush
    if %cmd%==3 goto ram
    if %cmd%==4 goto args
    if %cmd%==5 goto core
    cls
    echo.
    echo Invaild Option (%cmd%)
    pause
    goto set
    
    :color
    cls
    echo.
    echo Change Color Scheme:
    echo.
    echo Current Schemes:
    echo 1. Default - Black Background, White Text
    echo 2. Inverted - White Background, Black Text
    echo 3. Dark Blue - Black Background, Blue Text
    echo 4. Stay Gold - Black Background, Yellow Text
    echo 5. Error Screen - Blue Background, White Text
    echo 6. Inverted Error Screen - White Background, Blue Text
    echo 7. Blood Red - Black Background, Red Text
    echo 8. Custom - Make Your Own Scheme (Advanced)
    echo.
    set /p cmd=Scheme ID:
    if %cmd% LEQ 8 del bccolor.txt
    if %cmd%==1 echo 0f>>bccolor.txt
    if %cmd%==2 echo f0>>bccolor.txt
    if %cmd%==3 echo 01>>bccolor.txt
    if %cmd%==4 echo 0e>>bccolor.txt
    if %cmd%==5 echo 1f>>bccolor.txt
    if %cmd%==6 echo f1>>bccolor.txt
    if %cmd%==7 echo 0c>>bccolor.txt
    if %cmd%==8 goto ccolor
    :concolor
    set /p color=<bccolor.txt
    cls
    echo.
    echo Color Scheme Set!
    pause
    goto core
    
    :ccolor
    cls
    echo.
    echo Enter The Color Code Of Your Choice.
    echo Please Note:
    echo If you some how screw up delete your bccolor.txt file located in the server folder.
    echo.
    set /p cmd=Color Code:
    echo %cmd%>>bccolor.txt
    goto concolor
    
    :setpush
    cls
    echo.
    echo [!] Are you sure this feature CANNOT be disabled without you manually deleting  a file.
    echo This feature makes this version of Better Console like the older version where  all you had to do was push a button.
    echo.
    set /p cmd=Y or N:
    if %cmd%==y goto enpush
    if %cmd%==Y goto enpush
    cls
    echo.
    echo Ok I Will NOT Enable That Feature!
    pause
    goto core
    
    :push
    cls
    echo.
    echo Push To Start Enabled!
    echo [!] To Disable This Feature You Must Delete The bcpush.txt File Located In    Your Server's Folder!
    pause
    goto start
    
    :enpush
    echo enable>>bcpush.txt
    cls
    echo.
    echo Push To Start Enabled!
    echo Press Any Key To Exit
    pause > nul
    exit
    
    :ram
    cls
    echo.
    echo Please Enter Your Minimum Amount Of Ram To Use Followed By 'M' For Megabytes Or  'G' For Gigabytes:
    set /p min=Minimum Amount:
    echo.
    echo Please Enter Your Maximum Amount Of Ram To Use Followed By 'M' For Megabytes Or  'G' For Gigabytes:
    set /p max=Maximum Amount:
    echo java -Xms%min% -Xmx%max% -jar craftbukkit.jar -o true>>bcram.txt
    cls
    echo.
    echo Ram Amounts Set!
    pause
    goto core
    
    :args
    cls
    echo.
    echo Hello %usr% this where you can change your java args without opening the file.
    echo.
    echo [!] This Is For Advanced Users Only! If You Do Not Know How To Use Arguments Do Not Use This!
    echo.
    set /p args=<bcram.txt
    echo These are your current args:
    echo %args%
    echo.
    echo Would you like to change it?
    set /p cmd=Y or N:
    if %cmd%==Y goto cargs
    if %cmd%==N goto core
    cls
    echo.
    echo Invaild Choice!
    pause
    goto args
    
    :cargs
    cls
    echo.
    echo Ok Please Enter Your New Arguments.
    echo For Reference Here Is Your Arguments:
    echo.
    echo %args%
    echo.
    echo [!] Make Sure To Launch Craftbukkit In Your Arguments!
    echo.
    set /p nargs=New Arguments:
    cls
    echo.
    echo Are you sure you want to save these as your new arguments?
    echo %args%
    echo.
    set /p cmd=Y or N:
    if %cmd%==Y then goto sargs
    if %cmd%==N then goto cargs
    cls
    echo.
    echo Invaild Choice!
    pause
    goto cargs
    
    :sargs
    cls
    echo.
    echo Saving Arguments…
    echo %nargs%>>bcram.txt
    echo Done!
    echo Changing Cached Arguments...
    %args% = %nargs%
    echo Done!
    echo Complete!
    echo.
    echo Your New Arguments Are Saved And Ready For Use!
    pause
    goto core
    
    :error1
    cls
    echo.
    echo Error!
    echo "craftbukkit.jar" Could not be found! Please move it to the folder this program is in!
    pause
    
    If you see "'Java' is not recognized as an internal or external command, operable program or batch file." Then you need to reinstall Java. If you are still getting that error follow this guide to adding Java to your system path.

    Make Sure That Your Craftbukkit.jar Is Named "craftbukkit.jar"
    I have not yet added the function to accept other names.

    I will update periodically. If somebody added something to this that everybody wants I will add it to the original (with permission).

    I will also try to add features that you guys want.

    Happy Playing!

    - Airbornz
     
    Last edited by a moderator: Jun 26, 2016
    EddieFriday likes this.
  2. Offline

    ZanderMan9

    Not bad, young apprentice. I see in you a batch prodigy like myself (shameless self-honoring)
    You are learning quickly. There is no need to have a goto statement if the tag is right after it.
    For example:

    Code:
    Command
    goto next
     
    :next
    command
    Is the same as

    Code:
    command
     
    :next
    command
    But you may want to keep them, as if you expand this, you may need those goto statements.
     
    Airbornz and Datdenkikniet like this.
  3. Offline

    _Filip

    ZanderMan9
    >implying knowing batch will get you anywhere in life
     
    JWhy likes this.
  4. Offline

    ZanderMan9

    TheSpherret I'm not sure how to respond to that lol.
    Are you saying I'm showing off? In that case, eh, maybe... I'm not a showoff usually xD But I actually do know batch...
    Are you saying that batch is some all-powerful thing, like saying "I'm a black belt in karate"? In which case, funny lol.
     
  5. Offline

    _Filip

    ZanderMan9 No I'm saying that I find it hilarious how you think that batch is important in your life.
     
  6. Offline

    xYourFreindx

    ZanderMan9 No..... He's saying batch is useless to know and a waste of time to learn.
    Ya derp. :p
     
  7. Offline

    _Filip

    xYourFreindx I am saying this from an experienced perspective, I also tried to master batch before I started java, it is utterly pointless.
     
  8. Offline

    ZanderMan9

    xYourFreindx TheSpherret Oh really? Can you shut down a server, restart the machine it is on, and restart the server automatically with Java?

    I'm afraid I'll have to bring in RitzyCosmos to back me up. Prepare to face the Batch Prodigies.

    (Oh dear, I'm pumping this up quite a bit xD)

    Batch is not useless, it is simply for a different purpose than Java. Comparing the two is like comparing fruits and vegetables. They are both languages, but with entirely different functions.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
    jthort likes this.
  9. Offline

    xYourFreindx

    ZanderMan9
    And how high of demand do you think people knowledgeable in batch really are?
     
  10. Offline

    ZanderMan9

    xYourFreindx Um... Well, it is a solid skill to have, even though not a main one. Batch is used to run Gulfstream Aerospace's builds; when they publish to the server, they use batch to execute the command... I'm sure there are several other uses for it too, but that is the only one I know of atm.

    Airbornz
    Back on topic...
    You should use http://dropbox.com/ so that you can let people download it directly, and not have to save it as a .bat

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
    jthort likes this.
  11. Offline

    RitzyCosmos

    xYourFreindx _Filip

    Do you know how high of demand people with .txt skills are?

    .bat is useful, we never said it was a profitable life-long career. Batch is useful. Immensely. If you can use it correctly.

    You can carry out almost any function in windows, weather it be legitimate or a makeshift way.

    Welcome messages upon startup.
    Calculating
    Starting programs
    Writing files
    Locking and hiding folders
    Server startup and manager scripts
    Timed computer shutdowns

    Blah blah blah.
    It's fun to play with, too.

    I made a script that immediately shuts down my computer as soon as I turn it on, unless I insert the correct second/third/fourth password. :p
     
    jthort likes this.
  12. Offline

    _Filip

    The problem with batch is its lack of doing anything other than calling already existing executables. It isn't hard running the executable "shutdown" with a few arguments and calling it a batch script, and creating a bunch of "goto" statements that do the same thing over again.

    Batch is useful for a couple of things, but it can almost completely be replaced with a real programming language, such as C, C#, Java, C++ and others. These other languages are A) Faster B) Have way more customization in how the program runs C) Don't require you to create spaghetti code. That is why I stopped using batch and moved onto something that actually takes skill, instead of making "batch scripts" and pretending that I am a pro-l33t computer user just because I can run already existing programs.
     
  13. Offline

    EnderTroll68

    _Filip
    Although that is true, batch is also one of the first languages and was very strong in its day. Your argument is the same one people can make about Simula and Fortran. They are shitty languages by today's standard, but if you go back in time, those were the state of the art languages that were super impressive. And if you go even further down the line, look at Assembly. Everything that is used in programming now boils down to it's core in Assembly. Just because a language is not commonly used anymore, does not make it a BAD language
     
  14. Offline

    ZanderMan9

    _Filip You are right, batch uses existing resources. Just like any C language uses existing resources. The different is, Batch operates on a much higher level. Rather than, like C# (which I an trying to learn), getting Console, using WriteLine, you simply use echo. Granted, this gives you far less options, but it is extremely short. Batch is effectively a language to utilize the resources made in other languages. It can't really stand alone as a language to program with, but it can do a lot with very few lines of code. Doing the same in any C language would be ridiculously long, because instead of using the resources you have, you are working from the very bottom.

    Comparing Batch to C or Java or anything like that is like comparing cells to organs.
     
  15. Offline

    Airbornz

    Wow... Didn't think this many people would view this post. Going to start an update now.

    Update Is Live!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  16. Offline

    Mister_Fix

    Wow, pure awesomeness, if i ever start my server up again rest assure ill use this script.
     
    Airbornz likes this.
  17. Offline

    Airbornz

    Thanks for the feedback!
     
    Mister_Fix likes this.
  18. Offline

    bwfcwalshy Retired Staff

  19. Offline

    Airbornz

    Will fix download soon as i am not home. For the meantime just copy the code to a bat file.
     
  20. Offline

    Airbornz

    Any features you guys want? I will try to add them!
     
  21. Offline

    Airbornz

    I have updated the program, it is not yet uploaded I have to run some bug tests. Here are the features so far, may add more!

    * Performance Increase (This really applies to slow computers, if you have a good computer your not really going to notice a difference. Please note this does not change how fast your server runs, this just changes how fast the program runs.)
    * Fixed and Shortened Some Code
    * Added The Ability To Change Your Java Arguments Within The Program
    * Added Notice Flags (Looks Like This [!] Make Sure To Read Them)

    Also in the future I may add beta builds but this is not recommended to be run on actual servers as it may crash, cause performance issues, or break the server completely. If I do this please note I'm not responsible for anything that may happen when using a beta build.


    And The Update is Live, Link Is Updated, As Well As The Code Section! Have Fun!

    [!] For those who may have ideas for future updates please make sure to comment them! Also those interested in beta testing builds PM me!

    [!] If you need support for this program, or have a bug to report email BCHelp@airbornz.com

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  22. Offline

    JOSHSLAYDE

    Tested this myself. This is an utterly awesome script and will be of great use to home hosted servers! :)
     
    Airbornz likes this.
  23. Offline

    Airbornz


    Thanks for the positive review. Hopefully more awesome updates to come with even more features!
     
  24. Offline

    Experminator

  25. Offline

    Airbornz

    Fixed the download link for Dropbox :)

    * New beta build in the works using a new layout, for menus and such (Not gonna effect server), maybe some new features like password protection, naming your server.

    *What would you guys think of a developer mode? This would output data when switching pages and such, and some other developer tools. Thoughts? Of course this would be able to be toggled. :)
     
Thread Status:
Not open for further replies.

Share This Page