Aug 25, 2006 21:03 Linbolo Spawner
I wrote this little php commandline script to keep a linbolods server running. I have it working on the 208.110.65.82 server, so if anyone has a use for it. Also I will be leaving my spawner up on the 100mbit server spawning stricts so if anyone has any maps suggestions/removal requests. I am looking at adding a web request/map adding page to this spawner also.
[code:1:011d27b4e6]#!/usr/local/bin/php -q
<?php
//change to your php path

echo "Spawning Linbolo Server\n";
//path to your linbolo
$path = "/home/suicidjky/linbolo115-server/";
//some game settings
$port = 27500;
$mines = "no";
$ai = "yes";
$gametype = "strict";
//stuff you probably shouldn't change
$tracker = "tracker.winbolo.com:50000";

while(true) { //start the spawning
$exec = $path . "linbolods -map \"" . $path . "maps/" . get_rand_map() . "\" -port $port -gametype $gametype -mines $mines -ai $ai -tracker $tracker -quitonwin";
exec($exec);
//echo $exec;
}

function get_rand_map() { //random map from maps folder
$dir = $path . "maps"; //can be changed if your maps are elsewhere
$i = 0;
$dirHandle = opendir($dir);
while(($im = readdir($dirHandle))) {
if($im != ".." && $im != ".") {
if(strpos($im,".map") !== false) {
$maps[$i] = $im;
}
$i++;
}
}

closedir($dirHandle);
$n = rand(0,(count($maps)-1));
return $maps[$n];
}
?>[/code:1:011d27b4e6]