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

PocketMine auto restart script?

Discussion in 'General discussion' started by Levi, Jun 6, 2018.

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

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    Does pocketmine have a script that auto start up the server after the command /stop?
     
  2. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    just run start.sh with the -l argument (or start.ps1 on Windows if you have PowerShell). There's no capability to do this in CMD/MinTTY right now, but you can find community-created solutions on github for that.
     
    Muqsit likes this.
  3. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    where?
    edit oh argument
     
    Last edited: Jun 7, 2018
  4. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    No need to edit the script. Just run ./start.sh -l
     
  5. Atomization

    Atomization Baby Zombie

    Messages:
    120
    GitHub:
    iAtomPlaza
    right click start.cmd on windows and open it in any editor and past this:
    PHP:
    @echo off
    REM Set TIMEOUT to how many seconds you want in between when the server stops to when the next restart takes place
    set TIMEOUT
    =3
    cd 
    /%~dp0
    netstat 
    ---findstr 0.0.0.0:19132 NUL
    if %ERRORLEVELequ 0 (
    goto :
    loop
    ) else (
    echo 
    "Script has been initialized."
    goto :start
    )
    :
    loop
    ping 127.0.0.1 
    -%TIMEOUT% > NUL
    netstat 
    ---findstr 0.0:19132 NUL
    if %ERRORLEVELequ 0 (
    goto :
    loop
    ) else (
    ping 127.0.0.1 -%TIMEOUT% > NUL
    echo "Server stopped. It'll be restarted in %TIMEOUT% second(s). You can press Ctrl+C to stop the restart process if you don't want to restart."
    goto :start
    )
    :
    start
    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 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=-o FontQuality=-o Font="DejaVu Sans Mono" -o FontHeight=10 -o CursorType=-o CursorBlinks=-h error -"PocketMine-MP" -i bin/pocketmine.ico -w max %PHP_BINARY% %POCKETMINE_FILE% --enable-ansi %*
    ) else (
    %
    PHP_BINARY% -c bin\php %POCKETMINE_FILE% %*
    )
    )
    goto :
    loop
     
  6. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    no need, just add -l
     
  7. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    That's a start.cmd
     
Thread Status:
Not open for further replies.
  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.