Chatlog Damage Parser

Bitte benutzt das englische Supportforum!
User avatar
Rector
Alerion Knight
 
Posts: 2744
Joined: Mar 02, 2006 01:00

Postby Rector » Dec 21, 2011 10:31

Hi Uzzls,
ich hab wieder was kleines feines gebastelt: http://blutrausch-uthgard.de/tnt/dmgcalc/index.php
Gebt bescheid wenn ihr Fehler findet.
Viel Spaß damit ;)

User avatar
pweet
Lion Knight
 
Posts: 4243
Joined: Dec 22, 2010 14:07

Postby pweet » Dec 21, 2011 10:54

really nice tool. could you add a counter for done hits/casts?

User avatar
Rector
Alerion Knight
 
Posts: 2744
Joined: Mar 02, 2006 01:00

Postby Rector » Dec 21, 2011 10:57

I already thought about that, but it wouldn't be that easy, because the tool doesnt differ between the different kinds of damage (Hit, LeftHandHit, Crit, Proc, DoT, Cast, Ichor, etc.....)
So this is not included.

User avatar
Rector
Alerion Knight
 
Posts: 2744
Joined: Mar 02, 2006 01:00

Postby Rector » Jan 03, 2012 20:05

If anyone wants to modify it, here is the code:
Please be so kind to share your stuff with us afterwards.
Code: Select all
<?php
echo '<div align="center"> <form action="'.$_SERVER["PHP_SELF"].'" method="post">';
echo '<textarea name="TA" cols="" rows="15" style="width: 780px;">';
if (isset($_REQUEST["TA"])) {
    echo $_REQUEST["TA"];
}
echo '</textarea><br />';
echo '<input type="submit" value="Auswerten!">';
echo '</form><br /></div>';

//Parameter setzen
$begin=1;
$time=$dps=0;
echo "<table border=\"0\" width=\"100%\">";
echo "<tr bgcolor=\"#993300\"><th style=\"width:70%\">Chatlog-Zeile</th><th style=\"width:10%\">Dauer [s]</th><th style=\"width:10%\">Gesamtschaden</th><th style=\"width:10%\">DPS</th></tr>";

if (isset($_REQUEST["TA"])) {
    $lines = preg_split("/\r\n/", $_REQUEST["TA"]);
    foreach ($lines as $key => $value){
                                                   
//Nun werden Zeilen, die nichts mit Schaden zu tun haben, aussortiert.
      if ((strpos($value, "] ") ==! false)&&
          (strpos($value, "[") === 0)&&
          (strpos($value, ":") ==! false)&&
          (strpos($value, "@@") === false)&&
          (strpos($value, "was just killed by") === false)&&
          (strpos($value, "the game!") === false)&&
          (strpos($value, "auto-stick") === false)&&
          (strpos($value, "/chatlog") === false)&&
          (strpos($value, "too fatigued") === false)&&
          (strpos($value, "are already casting") === false)&&
          (strpos($value, "have enough power") === false)&&
          (strpos($value, "You begin casting") === false)&&
          (strpos($value, "You examine") === false)&&
          (strpos($value, "prepare to perform") === false)&&
          (strpos($value, "begins moving more") === false)&&
          (strpos($value, "have exhausted all") === false)&&
          (strpos($value, "creased.") === false)&&
          (strpos($value, "are no longer sticking") === false)&&
          (strpos($value, "You enter combat mode") === false)){     
       
        //Nun wird die Zeit ausgewertet und vom String abgeschnitten
        $time=substr($value, strpos($value, "] ")-8, 8);
        $value=substr($value, strpos($value, "] ")+2);
        $seconds=explode(":", $time);
        $time=($seconds[0]*60+$seconds[1])*60+$seconds[2];
        if ($begin==1){
          $start=$time;
          $begin=0;
          }
        $time=$time-$start;
       
        //Nun wird der Schaden addiert und durch die Sekunden geteilt
        preg_match ('~ ([0-9]+)[pointsfexra -+)(\d]+damage~', $value, $result);
        $gesdmg+=$result[1];
        if($time>0){$dps=round($gesdmg/$time);}
        else {$dps="-";}
       
        //Nun wird der Schaden im Text markiert
        if (strpos($value, $result[0])==!false){
          $ersatz="<span style=\"color:#FF9900\">".$result[1]."</span>";
          $value=substr_replace($value, $ersatz, strrpos($value, $result[1]), strlen($result[1]));
          }
       

        // Ausgabe
        echo "<tr><td>$value</td><td align=\"center\">$time</td><td align=\"center\">$gesdmg</td><td align=\"center\">$dps</td></tr>";
        }
    }
}
echo "<table><br /><br />";
echo "<p align=\"center\"><span style=\"font-size:200%\">Endergebnis nach ".$time." Sekunden: <u>".$dps." DPS</u></span></p><br />";
?>

User avatar
Sonic1982
Myrmidon
 
Posts: 197
Joined: Jun 15, 2010 00:00
Location: Germany

Postby Sonic1982 » Jan 05, 2012 00:05

vote Rector for GM with code access !
"Lieber stehend sterben, als auf Knien leben". - Dolores Ibárruri Gómez


Return to Support (de)

Who is online

Users browsing this forum: No registered users and 4 guests

Sunday, 04. May 2025

Artwork and screen shots Copyright © 2001-2004 Mythic Entertainment, Inc. All rights reserved. Used with permission of Mythic Entertainment. Mythic Entertainment, the Mythic Entertainment logo, "Dark Age of Camelot," "Shrouded Isles," "Foundations," "New Frontiers," "Trials of Atlantis," "Catacombs," "Darkness Rising," the Dark Age of Camelot and subsequent logos, and the stylized Celtic knot are trademarks of Mythic Entertainment, Inc.

Valid XHTML & CSS | Original Design by: LernVid.com | Modified by Uthgard Staff