Open tomouchuu opened 8 years ago
$loop = 1; while ($loop) { $process = Start-Process "myBot.exe" -Wait -NoNewWindow -PassThru switch ($process.ExitCode) { 0 {"Restarting..."; Start-Sleep -s 3} 1 {"Exiting."; $loop = 0;} default {"Unhandled Exit Code, Exiting."; $loop = 0} } } # In your bot, you can use Environment.Exit(0) to restart, or Environment.Exit(1) to kill.
Action the above into the script.
This may also help close #23
Auto restart
Action the above into the script.
This may also help close #23