Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 717

Warning: Invalid argument supplied for foreach() in /var/www/ct/forums/wiki/includes/MagicWord.php on line 718

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 722

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739

Warning: preg_match(): Compilation failed: group name must start with a non-digit at offset 8 in /var/www/ct/forums/wiki/includes/MagicWord.php on line 739
Crazy Tronners Wiki - Running a Server

Running a Server

From Tronwiki
Jump to: navigation, search
Line 32: Line 32:
  
 
  tail -n0 -f -s 0.01 $cmds | $tron --userconfigdir $userconfigdir --vardir $var | tee -a $log
 
  tail -n0 -f -s 0.01 $cmds | $tron --userconfigdir $userconfigdir --vardir $var | tee -a $log
 +
 +
===The Scripts===
 +
==Random Flying Deathzones==
 +
<nowiki>
 +
#!/usr/bin/php
 +
<?php
 +
while (1)  {
 +
    $line = rtrim(fgets(STDIN, 1024));
 +
// watch the game time to update settings based on time
 +
if (preg_match("/^GAME_TIME/", $line)){
 +
    $keywords = preg_split("/ /", $line);
 +
    $game_time=$keywords[1];
 +
    if ( $game_time % 10 == 0 ){
 +
          $mincoord=225;
 +
    $maxcoord=275;
 +
    $minsize=2;
 +
    $maxsize=8;
 +
    $minspeed=1;
 +
    $maxspeed=30;
 +
    $xcoord=rand($mincoord, $maxcoord);
 +
    $ycoord=rand($mincoord, $maxcoord);
 +
    $size=rand($minsize, $maxsize);
 +
    $xspeed=rand($minspeed, $maxspeed);
 +
    $yspeed=rand($minspeed, $maxspeed);
 +
    $ycoord2=($ycoord>250)?(250-($ycoord-250)):(250+(250-$ycoord));
 +
    $xcoord2=($xcoord>250)?(250-($xcoord-250)):(250+(250-$xcoord));
 +
    if ( $game_time%20==0 ) {
 +
      print("spawn_zone death $xcoord $ycoord $size 0 $xspeed $yspeed true\n");
 +
    print("spawn_zone death $xcoord2 $ycoord2 $size 0 -$xspeed -$yspeed true\n");
 +
    } else {
 +
          print("spawn_zone death $xcoord $ycoord $size 0 -$xspeed $yspeed true\n");
 +
        print("spawn_zone death $xcoord2 $ycoord2 $size 0 $xspeed -$yspeed true\n");
 +
        }
 +
      }
 +
    }
 +
}
 +
?>
 +
</nowiki>

Revision as of 11:51, 3 October 2007

Personal tools