Author Topic: (Mac+Windows) Blockland CrashHelper  (Read 1166 times)

Blockland CrashHelper, works on a Mac and Windows, relaunches a dedicated server.


Mac Source Code(copy and paste this into AppleScript editor):
Code: (AppleScript) [Select]
(*
 PLEASE make sure your blockland folder is renamed to "Blockland" and it isn't named "Blockland v19"

Tested on Snow Leopard only.
*)
repeat
set kakez to ({"Blockland crash on ", (current date)} as string)
tell application "System Events" to (name of processes) contains "Blockland"
if the result is false then
do shell script "open /Applications/Blockland/dedicated.command"
beep 1 --Get attention
say kakez
end if
delay 1
end repeat
Windows Source Code(thanks ZSNO, copy and paste into Notepad and save as .bat):
Code: (Batch) [Select]
@echo off
cls
title Blockland Dedicated Server Restarter
echo Protecting Dedicated Servers from Crashes...
:blockland
echo (%time%) Blockland has started
start /wait /normal blockland.exe -dedicated -map bedroom
echo (%time%) Warning: Server has crashed, or been stopped. Restarting.
goto blockland
PasteBin stuff:
http://frogger3140.pastebin.com/jaagXuf7 (Mac)
http://frogger3140.pastebin.com/vpEdj7b8 (Windows)
« Last Edit: January 15, 2011, 08:49:57 AM by frogger3140 »

Someone should port or something this to windows and linux.

Wow, that script is simple looking, it looks like plain text, cool thing though.

Someone should port or something this to windows and linux.

2 second google search brings up this.
Code: [Select]
tasklist /FI "IMAGENAME eq notepad.exe" /FO CSV > search.log

FOR /F %%A IN (search.log) DO IF %%~zA EQU 0 GOTO end

start notepad.exe

:end
could very easily be edited to use blockland dedicated.bat

Wow, that script is simple looking, it looks like plain text, cool thing though.
It's AppleScript, it sorta looks like psuedocode, though.

It's simple since it's doing a simple task of alerting a blockland server crash and re-opening it for you.


Go ahead and make something for the minority of OSes used on Blockland.

Go ahead and make something for the minority of OSes used on Blockland.
I have this strange feeling in the bottom of my stomach.
Maybe it's telling me that most people would make something made for their OS.

Nah, that makes absolutely no sense.

Code: [Select]
@echo off
cls
title Blockland Dedicated Server Restarter
echo Protecting Dedicated Servers from Crashes...
:blockland
echo (%time%) Blockland has started
start /wait /normal blockland.exe -dedicated -map bedroom
echo (%time%) Warning: Server has crashed, or been stopped. Restarting.
goto blockland
Gotten of GG forums. Modified for BL use.
« Last Edit: January 14, 2011, 10:15:38 PM by ZSNO »

Code: [Select]
@echo off
cls
title Blockland Dedicated Server Restarter
echo Protecting Dedicated Servers from Crashes...
:blockland
echo (%time%) Blockland has started
start /wait /normal blockland.exe -dedicated -map bedroom
echo (%time%) Warning: Server has crashed, or been stopped. Restarting.
goto blockland
Gotten of GG forums. Modified for BL use.
Thanks for making a Windows version.