1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Automatic Server Restarter

Discussion in 'Requests' started by CreeperMonster, May 13, 2017.

  1. CreeperMonster

    CreeperMonster Slime

    Messages:
    81
    GitHub:
    CreeperMonster
    Is there a plugin ServerRestarter ? I am using Windows
    Need Link btw
     
  2. AnkitM252

    AnkitM252 Spider Jockey

    Messages:
    29
    GitHub:
    AnkitM252
  3. CreeperMonster

    CreeperMonster Slime

    Messages:
    81
    GitHub:
    CreeperMonster
  4. CreeperMonster

    CreeperMonster Slime

    Messages:
    81
    GitHub:
    CreeperMonster
    Hey Dude Under the plugin.yml is README.md
    and here is what is said
    ![RestartMe](images/icon.png)
    #RestartMe
    Make sure your server stays up all the time!

    ###Commands:
    Main command: **restartme**, **rm**

    |Sub-command|Description|
    |-----------|-----------|
    |**add**, **a**|Adds n seconds to the timer|
    |**help**|Shows all RestartMe commands|
    |**memory**, **m**|Shows memory usage information|
    |**set**|Sets the timer to n seconds|
    |**start**|Starts the timer|
    |**stop**|Stops the timer|
    |**subtract**, **s**|Subtracts n seconds from the timer|
    |**time**, **t**|Gets the remaining time until the server restarts|

    ###Permissions:
    |Node|Default|
    |----|:-------:|
    |restartme.command.restartme|op|

    ###Releases:
    |Version|Release Date|Download|
    |:-------:|------------|:--------:|
    |1.0.0|September 10, 2015|[available](https://github.com/Gamecrafter/Pock...tMe/releases/RestartMe_v1.0.0.phar?raw=true)|
    |1.1.0|October 12, 2015|[available](http://forums.pocketmine.net/plugins/restartme.1509/download?version=2836)|
    |1.2.0|December 25, 2015|[available](http://forums.pocketmine.net/plugins/restartme.1509/download?version=2907)|
    |1.3.0|?|unavailable|

    what should I do next ?
     
  5. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    Why did you copy the README raw lol. Also it would be a better idea to put it in [CODE][/CODE] blocks to make it readable.
     
  6. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    in the start.ps1 file there is a line which allows you to auto-restart the server every time it stops
     
  7. AnkitM252

    AnkitM252 Spider Jockey

    Messages:
    29
    GitHub:
    AnkitM252
    He even needs a plugin to run the stop command!
     
  8. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    The TimeCommander plugin is good for that.
     
  9. AnkitM252

    AnkitM252 Spider Jockey

    Messages:
    29
    GitHub:
    AnkitM252
    Yes it is!
     
  10. NickTehUnicorn

    NickTehUnicorn Zombie

    Messages:
    200
    GitHub:
    unickorn
    You can get the plugin here
    It just stops the server but there are insturctions in the page to restart the server every time it stops.

    FOR WINDOWS OS:

    1. First, find start.cmd file inside your PocketMine directory and open it using some text editor like NotePad or such.
    2. Delete all code thats inside of it and replace it with this one:
    Code:
    @echo off
    TITLE Pocketmine-MP: Auto restart
    cd /d %~dp0
    netstat -o -n -a | findstr 0.0.0.0:19132>nul
    if %ERRORLEVEL% equ 0 (
       echo Your server is running.
        goto :loop
    ) ELSE (
        echo Starting your PocketMine-MP server.
        goto :StartPM
    )
    
    
    :loop
    echo Checking if server is online...
    PING 127.0.0.1 -n 10 >NUL
    
    
    netstat -o -n -a | findstr 0.0:19132>nul
    if %ERRORLEVEL% equ 0 (
        echo Server is running.
        goto :loop
    ) ELSE (
        echo Starting PocketMine-MP in 10 seconds...
        PING 127.0.0.1 -n 10 >NUL
        goto :StartPM
    )
    
    
    :StartPM
    if exist bin\php\php.exe (
        set PHP_BINARY=bin\php\php.exe
    ) else (
        set PHP_BINARY=php
    )
    
    if exist PocketMine-MP.phar (
        set POCKETMINE_FILE=PocketMine-MP.phar
    ) else (
        if exist src\pocketmine\PocketMine.php (
            set POCKETMINE_FILE=src\pocketmine\PocketMine.php
        ) else (
            echo "Couldn't find a valid PocketMine-MP installation"
            pause
            exit 1
        )
    )
    
    #if exist bin\php\php_wxwidgets.dll (
    #    %PHP_BINARY% %POCKETMINE_FILE% --enable-gui %*
    #) else (
        if exist bin\mintty.exe (
            start "" bin\mintty.exe -o Columns=88 -o Rows=32 -o AllowBlinking=0 -o FontQuality=3 -o Font="DejaVu Sans Mono" -o FontHeight=10 -o CursorType=0 -o CursorBlinks=1 -h error -t "PocketMine-MP" -i bin/pocketmine.ico -w max %PHP_BINARY% %POCKETMINE_FILE% --enable-ansi %*
        ) else (
            %PHP_BINARY% -c bin\php %POCKETMINE_FILE% %*
        )
    #)
    goto :loop
    
    3. The default port is set to 19132. Just find that one and replace it with your desired port. Now its ready!

    Credits to @SpiderPig for this loop script.
    P.S You can bump the API here (API updater tab just in case you don't know where it is)
     
    Last edited: Jul 27, 2017
  11. TheDiamondYT

    TheDiamondYT Zombie

    Messages:
    298
    GitHub:
    TheDiamondYT1
    That plugin is outdated
     
  12. NickTehUnicorn

    NickTehUnicorn Zombie

    Messages:
    200
    GitHub:
    unickorn
    Works perfectly fine after bumping API.
     
  13. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    NickTehUnicorn likes this.
  14. Az928

    Az928 Baby Zombie

    Messages:
    140
    GitHub:
    theaz928
    Try mine? HydraStart
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.