Blockland Forums > General Discussion
(Mac+Windows) Blockland CrashHelper
(1/2) > >>
frogger3140:
Blockland CrashHelper, works on a Mac and Windows, relaunches a dedicated server.


Mac Source Code(copy and paste this into AppleScript editor):

--- Code: (AppleScript) ---(*
 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

--- End code ---
Windows Source Code(thanks ZSNO, copy and paste into Notepad and save as .bat):

--- Code: (Batch) ---@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

--- End code ---
PasteBin stuff:
http://frogger3140.pastebin.com/jaagXuf7 (Mac)
http://frogger3140.pastebin.com/vpEdj7b8 (Windows)
Coolio:
Someone should port or something this to windows and linux.
Mr.jacksaunt:
Wow, that script is simple looking, it looks like plain text, cool thing though.
tails:

--- Quote from: Coolio on January 12, 2011, 09:58:12 PM ---Someone should port or something this to windows and linux.

--- End quote ---

2 second google search brings up this.

--- Code: ---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

--- End code ---
could very easily be edited to use blockland dedicated.bat
frogger3140:

--- Quote from: Mr.jacksaunt on January 12, 2011, 11:29:56 PM ---Wow, that script is simple looking, it looks like plain text, cool thing though.

--- End quote ---
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.
Navigation
Message Index
Next page

Go to full version