Menu

Psychostats 1.8 - no data

Help
Mike F
2002-05-30
2002-06-20
  • Mike F

    Mike F - 2002-05-30

    Now that I can get the players.xml file to update, I'm not seeing any data for the players.  All stats are zeros. 

    - <player nick="-=(i.e.)=-ZaijiaN" rank="civilian">
      <score db="0" kt="0" sv="0" kv="0" kh="0" sh="0" pb="0" tk="0" gh="0" bt="0" kc="0" da="0" />
      <event date="02-05-30" rank="civilian" />
      <update nick="-=(i.e.)=-ZaijiaN" date="02-05-30" />
      </player>
    - <player nick="JckssI8" rank="civilian">
      <score db="0" kt="0" sv="0" kv="0" kh="0" sh="0" pb="0" tk="0" gh="0" bt="0" kc="0" da="0" />
      <event date="02-05-30" rank="civilian" />
      <update nick="JckssI8" date="02-05-30" />
      </player>
    - <player nick="ae|The Orb" rank="civilian">
      <score db="0" kt="0" sv="0" kv="0" kh="0" sh="0" pb="0" tk="0" gh="0" bt="0" kc="0" da="0" />
     

     
    • Mike F

      Mike F - 2002-05-30

      After further looking into this, it seems that the Costa is not looking for the right data.

      Here's the HTML from a 1.8 page.

      <tr class="plrgenrow2">
        <td>Killed CTs</td>       
        <td align="right">127</td>
      </tr>
      <tr class="plrgenrow1">
        <td>Killed VIP</td>
        <td align="right">0</td>
      </tr>
      <tr class="plrgenrow2">
        <td>Planted Bomb</td>  
        <td align="right">4</td>
      </tr>
      <tr class="plrgenrow1">
        <td>Bombed Targets</td>
        <td align="right">(100.00%) 4</td>
      </tr>
      <tr class="plrgenrow2">
        <td>Killed Hostages</td>         
        <td align="right">2</td>  

      And here's the code to retreive the data.

      if (/Killed CTs\&lt;\/TD\&gt;/) {
                          chomp (my $line=<INP>);
                          if (!($line =~ /\&lt;\/TD\&gt;/)) {
                              chomp (my $line2=<INP>);
                              $line .= $line2;
                          }
                          if ($line =~ /\&gt;(\&lt;FONT[^\&gt;]+\&gt;)?(\d+)(\&lt;\/FONT\&gt;)*\&lt;\/TD\&gt;/) {
                              $kc=$2;
                              print "Killed $kc CTs.\n";
                          }
                      }
                      if (/Killed VIP\&lt;\/TD\&gt;/) {
                          chomp (my $line=<INP>);
                          if (!($line =~ /\&lt;\/TD\&gt;/)) {
                              chomp (my $line2=<INP>);
                              $line .= $line2;
                          }
                          if ($line =~ /\&gt;(\&lt;FONT[^\&gt;]+\&gt;)?(\d+)(\&lt;\/FONT\&gt;)*\&lt;\/TD\&gt;/) {
                              $kv=$2;
                              print "Killed $kv VIPs.\n";
                          }
                      }
                      if (/Planted Bomb\&lt;\/TD\&gt;/) {
                          chomp (my $line=<INP>);
                          if (!($line =~ /\&lt;\/TD\&gt;/)) {
                              chomp (my $line2=<INP>);
                              $line .= $line2;
                          }
                          if ($line =~ /\&gt;(\&lt;FONT[^\&gt;]+\&gt;)?(\d+)(\&lt;\/FONT\&gt;)*\&lt;\/TD\&gt;/) {
                              $pb=$2;
                              print "Planted $pb bombs.\n";
                          }
                      }
                      if (/Bombed Targets\&lt;\/TD\&gt;/) {
                          chomp (my $line=<INP>);
                          if (!($line =~ /\&lt;\/TD\&gt;/)) {
                              chomp (my $line2=<INP>);
                              $line .= $line2;
                          }
                          if ($line =~ /[\&gt;|\)]\s*(\&lt;FONT[^\&gt;]+\&gt;)?(\d+)(\&lt;\/FONT\&gt;)*\&lt;\/TD\&gt;/) {
                              $bt=$2;
                              print "Bombed $bt targets.\n";
                          }
                      }
                      if (/Killed Hostages\&lt;\/TD\&gt;/) {
                          chomp (my $line=<INP>);
                          if (!($line =~ /\&lt;\/TD\&gt;/)) {
                              chomp (my $line2=<INP>);
                              $line .= $line2;
                          }
                          if ($line =~ /\&gt;(\&lt;FONT[^\&gt;]+\&gt;)?(\d+)(\&lt;\/FONT\&gt;)*\&lt;\/TD\&gt;/) {
                              $kh=$2;
                              print "Killed $kh hostages.\n";
                          }

      There's no FONT tags in the 1.8 html.  It's done with CSS.  I don't think searching for these tags is working.

       
      • Kamil Sacek

        Kamil Sacek - 2002-05-31

        Look at your page - tags are in lowercase - look into code - tags in reg. expressions are in uppercase - change them to lowercase (in code) or to uppercase (in template).

         
    • Kamil Sacek

      Kamil Sacek - 2002-05-31

      "FONT" to "font" and "TD" to "td" in code... you must do it in updateranks.pl and in genplayers.pl and genindex.pl too (in section for PS 1.8)

       
      • Kamil Sacek

        Kamil Sacek - 2002-05-31

        Because Turoq is offline, i made some changes on my own (i am using PS 1.8 with PHP) and you can download my version here: http://darkzone.cz/~cs/

        This version work with PHP template too but genindex not work with index.php!!! This version is only modifying player pages with PHP template!!! Genindex with HTML template can work.

        It is not official version and is without any support!!! Don't send any messages and questions to Turoq about this version!!!

        I'am sorry, Turoq, that I make public my changes without your permission, i believe, that it help many people in this two weeks, when you are offline.

         
    • Mike F

      Mike F - 2002-05-31

      Thx kine2,

      I used your code and got a little bit further.  The player.xml file is now being generated with data.

      However,  when I run genindex.pl it does not work.  It will make the rank column header, but the players lines are not being shifted over to the right.  So they do not line up with the column headers and the rank pics do not display.  Any ideas?

       
    • Guido Loag

      Guido Loag - 2002-05-31

      same situation here  :-(

       
    • Guido Loag

      Guido Loag - 2002-05-31

      ah, i forgot to say :

      if SOMEONE is able to bring this costa-stuff up correctly, pleeeaaaase contact me

      guido.loag@gmx.net
      ICQ 84738937

      Munich, Germany

       
    • Mike F

      Mike F - 2002-05-31

      I finally got it working after hours of tweaking the code.  I've only tested this with the 1.8 html theme.  I don't know if it works with the php themes.

      http://www.prolanservices.com/junk/mycosta.zip

       
    • Mike F

      Mike F - 2002-05-31

      It still doesn't copy a lot of the 1.8 html pages from the source folder.  You'll need to write a batch file to do that.  I'm working on that now.

       
    • zod doddsen

      zod doddsen - 2002-06-01

      Have the same problem as many others, with only the rank header beeing generated. No I'm wating for whizzers batch-file with high hopes!!

       
    • Mike F

      Mike F - 2002-06-01

      perl -w genranks.pl
      perl -w updateranks.pl
      perl -w genindex.pl
      perl -w genplayers.pl

      copy c:\stats-5day\award_*.html c:\stats-5dayout
      copy c:\stats-5day\map_*.html c:\stats-5dayout
      copy c:\stats-5day\weapon_*.html c:\stats-5dayout
      copy c:\stats-5day\clanpage_*.html c:\stats-5dayout
      copy c:\stats-5day\srvstats.html c:\stats-5dayout

       
    • Brent wong

      Brent wong - 2002-06-03

      Awesome job whizzer that works wonderfully. I changed your lines a little though taking out the underscore from each line and changed clanpage_ to clan* that way all the neccessary pages are transfered. Now all that we need is something to update the clan pages :)

       
    • Tobias Rötschke

      Nice!

      I should move home more often. Then all my problems seem to solve automatically :-)

      Just send me examples of erraneous stats and any modifications to COSTA scripts you made to make them work for your example. it should be not too difficult to find the right patterns to safely detect the required data.

      Kind regards,

      Turoq

       
      • Kamil Sacek

        Kamil Sacek - 2002-06-13

        Turoq, can you in Perl make inputs (reading from file) to be in Uppercase (or lowercase) or change reg. expressions to be case insensitive? I don't understand Perl but it must be easy in language for text processing. It will solve problems with that upper/lower case tags in templates.

        And welcome home :-)

        Kine2

         
        • Tobias Rötschke

          Hi,

          this is exactly what I am going to do. To replace text patterns in an input stream globally, one can simply use:

          while (<INP>) {
            s/<old pattern>/<new pattern>/g;
          }

          I will replace all <td>, </td>, <tr>, </tr>, <br>, <font>, </font> tags by there uppercase counterparts. This would look like this:
            s/\&lt;td/\&lt;TD/g;
            s/\&lt;\/td/\&lt;\/TD/g;

          etc.

          Trying to detect the Psycho Stats version seems not very safe and is actually not necessary. So I will remove this part again and just try to detect all patterns that might contain COSTA relevant data.

          Kind regards,

          Turoq

           
    • Mike F

      Mike F - 2002-06-20

      Hey!! Turoq is back.  Welcome back.  After I got Costa to work for me, I stopped checking these forums.

      Anywhooo, I basically stripped out the PsychoStats checking and hard coded it for 1.8 html.  You can get my code here.  http://www.prolanservices.com/junk/mycosta.zip

      You may want to just release seperate Costa version for each PsychoStats verion.  Just a thought.  You can see my stats here.

      http://www.prolanservices.com/stats/

       

Log in to post a comment.