Author Topic: Build Point Calculator  (Read 6533 times)

err

  • Posts: 26
  • Turrets: +0/-0
Build Point Calculator
« on: September 05, 2006, 03:29:56 am »
Don't ask me why, but I thought a build point calcultor might be useful to server admins and base builders... IE (b7 at least) freaks out about some of the javascript but you can allow it or just use moz.

http://ufo.freepgs.com/trem/TremBuildCalc.htm
img]http://wilhelmrahn.googlepages.com/trapper-not-floor.png[/img]

Confess

  • Posts: 237
  • Turrets: +25/-15
    • http://sstcentral.com
Build Point Calculator
« Reply #1 on: September 05, 2006, 04:59:51 am »
Sweet. I notice that its on a freewebhosting thing, and that they are closing the host in december. If you need hosting, lemme know and ill put you on ssthosting.net.
know that I myself cannot do anything, that I will fall, and that I am a sinful man, but I know that I can do ANYTHING through God Almighty, whom strengthens me.

Undeference

  • Tremulous Developers
  • *
  • Posts: 1254
  • Turrets: +122/-45
Re: Build Point Calculator
« Reply #2 on: September 05, 2006, 05:20:20 am »
Quote from: "err"
Don't ask me why, but I thought a build point calcultor might be useful to server admins and base builders... IE (b7 at least) freaks out about some of the javascript but you can allow it or just use moz.

http://ufo.freepgs.com/trem/TremBuildCalc.htm

To make it a little snazzier, you could add a place to specify the number of build points you are allowed (and indicate how many points are left or if you've gone over your allocation).
Need help? Ask intelligently. Please share solutions you find.

Thats what we need, helpful players, not more powerful admins.

Survivor

  • Posts: 1660
  • Turrets: +164/-159
Build Point Calculator
« Reply #3 on: September 05, 2006, 06:35:41 pm »
In 100 years an 8 year old can code a game but substracting from a number in your head is impossible for them by then.
I’m busy. I’ll ignore you later.

err

  • Posts: 26
  • Turrets: +0/-0
Build Point Calculator
« Reply #4 on: September 06, 2006, 01:07:59 am »
Quote from: "Survivor"
In 100 years an 8 year old can code a game but substracting from a number in your head is impossible for them by then.


Exactly... this tool will relieve hundred-year-old eight year old game programmers from the burden of sub(s)tracting from a number in my head. I think.
img]http://wilhelmrahn.googlepages.com/trapper-not-floor.png[/img]

err

  • Posts: 26
  • Turrets: +0/-0
Build Point Calculator
« Reply #5 on: September 06, 2006, 01:10:54 am »
Quote from: "confess"
Sweet. I notice that its on a freewebhosting thing, and that they are closing the host in december. If you need hosting, lemme know and ill put you on ssthosting.net.


Paid em $3, hopefully they wont remove me. Thanks for the offer though.

:edit: If you want to host a copy anyway go for it, maybe just write "by err" on it or something.
img]http://wilhelmrahn.googlepages.com/trapper-not-floor.png[/img]

[db@]Megabite

  • Posts: 613
  • Turrets: +3/-0
    • http://www.tremulous.info
Build Point Calculator
« Reply #6 on: September 06, 2006, 08:56:44 am »
Quote from: "err"
If you want to host a copy anyway go for it, maybe just write "by err" on it or something.


Aye captain, I would love to include it on tremulous.info ;)

Danny
url=http://www.tremulous.info][/url]


gareth

  • Posts: 710
  • Turrets: +38/-89
Build Point Calculator
« Reply #7 on: September 06, 2006, 09:55:44 am »
As it is it is rather  pointless, it would be better if it calculated various options that make optimal usage of buildpoitnts so that you end up with none left from a starting number.

MtS

  • Posts: 40
  • Turrets: +0/-0
Build Point Calculator
« Reply #8 on: September 06, 2006, 02:34:09 pm »
If the calculator would have a list with all popular servers and use the numbers of buildpoints on the specified server as the limit that would be cool. If the number of buildpoints isn't tied to actual servers I can't see the need of letting the user specify the number of buildpoints as undeference suggested, either.

DASPRiD

  • Administrator
  • Posts: 549
  • Turrets: +21/-2
    • http://www.dasprids.de
Build Point Calculator
« Reply #9 on: September 06, 2006, 03:19:13 pm »
If you need a PHP-Script to get the BuildPoints of a specifig server, ask me :)
url=https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mail%40dasprids%2ede&item_name=DASPRiD%27s&no_shipping=0&no_note=1&tax=0&currency_code=EUR&lc=DE&bn=PP%2dDonationsBF&charset=UTF%2d8][/url]

Aninhumer

  • Posts: 116
  • Turrets: +0/-0
Build Point Calculator
« Reply #10 on: September 06, 2006, 04:19:19 pm »
Don't most servers just use the default anyway, apart from SST.
It would be easier to hardcode the numbers into a combo box, if there are only a few different ones.

DASPRiD

  • Administrator
  • Posts: 549
  • Turrets: +21/-2
    • http://www.dasprids.de
Build Point Calculator
« Reply #11 on: September 06, 2006, 09:14:21 pm »
Na, I've created a ready-to-use class for this purpose :)
url=https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mail%40dasprids%2ede&item_name=DASPRiD%27s&no_shipping=0&no_note=1&tax=0&currency_code=EUR&lc=DE&bn=PP%2dDonationsBF&charset=UTF%2d8][/url]

err

  • Posts: 26
  • Turrets: +0/-0
Build Point Calculator
« Reply #12 on: September 06, 2006, 10:28:06 pm »
Quote from: "DASPRiD"
If you need a PHP-Script to get the BuildPoints of a specifig server, ask me :)


hook it up =) any other php classes you want to share too, i'll come up with some cool ajax shit for it.
img]http://wilhelmrahn.googlepages.com/trapper-not-floor.png[/img]

err

  • Posts: 26
  • Turrets: +0/-0
Build Point Calculator
« Reply #13 on: September 06, 2006, 10:35:18 pm »
Quote from: "[db@
Megabite"]
Quote from: "err"
If you want to host a copy anyway go for it, maybe just write "by err" on it or something.


Aye captain, I would love to include it on tremulous.info ;)

Danny


No problem =)
img]http://wilhelmrahn.googlepages.com/trapper-not-floor.png[/img]

DASPRiD

  • Administrator
  • Posts: 549
  • Turrets: +21/-2
    • http://www.dasprids.de
Build Point Calculator
« Reply #14 on: September 07, 2006, 01:40:07 pm »
You have to modify this class, but the basic things are the same ;)

Code: [Select]

/**
* Tremulous Reporter
*
* This Class will conect to a Tremulous Server and fetch the main information.
* After this, it will join the Game as Spectator and reports everythin to a
* local string.
*/
class TremulousReporter {  
  function __construct ($address) {
    list($ip, $port) = explode(':', $address);
   
    $this->ip          = $ip;
    $this->port        = $port;
    $this->checkstring = md5('iD-Software-'.$server.'-'.$port);
  }
   
  public function connect () {
    $this->fp = fsockopen('udp://'.$this->ip, $this->port, &$errno, &$errstr, 5);
   
    if (!$this->fp)
      return false;
    else {
      socket_set_timeout($this->fp, 2);

      $this->getStatus();
      $this->getChallenge();
      $this->doConnect();
     
      return true;
    }
  }
 
  public function disconnect () {
    fclose($this->fp);
    unset($this);
  }
 
  private function sendQuery ($command) {
    fwrite($this->fp, "\xff\xff\xff\xff".$command);
  }
 
  private function getStatus () {
    $this->sendQuery('getstatus');
     
    $header = trim(fgets($this->fp, 60));
    $data   = trim(fgets($this->fp, 1500));

    $this->server_vars = array();

    $split = explode('\\', $data);
    for ($i=1; $i<count>server_vars[$split[$i]] = $split[$i+1];
    }
   
    $player = '-';
    while (!empty($player)) {
      $player = fgets($this->fp, 100);
      //print $player.'<br>';
    }
  }
 
  private function getChallenge () {
    $this->sendQuery('getchallenge');
   
    $header = trim(fgets($this->fp, 23));
    $data   = trim(fgets($this->fp, 100));

    $this->challenge_number = $data;
  }
 
  private function doConnect () {
    $this->sendQuery('connect "\\protocol\\69\\challenge\\'.$this->challenge_number.'\\port\\30200"');
   
    $header = trim(fgets($this->fp, 60));
    $data   = trim(fgets($this->fp, 1500));
    print $data;
  }
}


$reporter = new TremulousReporter('213.239.197.132:30721');
$reporter->connect();
$reporter->disconnect();
?>

url=https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mail%40dasprids%2ede&item_name=DASPRiD%27s&no_shipping=0&no_note=1&tax=0&currency_code=EUR&lc=DE&bn=PP%2dDonationsBF&charset=UTF%2d8][/url]

stahlsau

  • Posts: 160
  • Turrets: +1/-1
Build Point Calculator
« Reply #15 on: September 07, 2006, 05:00:28 pm »
hi,
i admire the effort you made, but i don't understand the sense of this stuff. When i'm building, i don't want to minimize the game, goto your website, calculate stuff, go back, and notice that i got killed in the meantime. Besides, i don't know why one should need to calculate something while building. You build, and when the points are empty you stop. That easy. And i never forgot to build the om or eggs and stuff, just fyi.
So please enlighten me for what purpose you use this website/script/whatever ;)

Undeference

  • Tremulous Developers
  • *
  • Posts: 1254
  • Turrets: +122/-45
Build Point Calculator
« Reply #16 on: September 07, 2006, 06:25:07 pm »
Quote
for ($i=1; $i<count>server_vars[$split[$i]] = $split[$i+1];

There's an issue with SGML-like tags on the forum, meaning that you have to link to it, I think.
Need help? Ask intelligently. Please share solutions you find.

Thats what we need, helpful players, not more powerful admins.

err

  • Posts: 26
  • Turrets: +0/-0
Build Point Calculator
« Reply #17 on: September 13, 2006, 02:23:09 am »
@stahlsau - honestly since you asked, i created it bc i thought it would be a useful way to convince admins of servers with very high bp to bring them down a bit. It's more for server operators than builders.
img]http://wilhelmrahn.googlepages.com/trapper-not-floor.png[/img]