Page 4 of 8

Re: ConquerStats - Ingame analysis

PostPosted: Fri Jan 02, 2009 11:38 am
by pamoa
cspare wrote:New features are:
- There now is a setting to define where ConquerStats should appear on the screen: Above to gamelog or Below the gamechat

cool, great, perfect, nice, thanks, happy new year :P

Re: ConquerStats - Ingame analysis

PostPosted: Sun Jan 04, 2009 3:15 pm
by cspare
I've just uploaded version 1.5.0 of the script.
Download it here.

New features are:
- The reinforcements table now shows the same stat types as the chart: Reinforcements, Bonus, Territory Bonus and Spoils (which was in previous version: Regular Reinforcements, Cashed Cards Armies, Cards Bonusses);
- Fixed strike through style for eliminated players;
- The version update check now only checks once per browser session, instead of every page view;
- Some minor lingo changes (e.g. change Attack to Assault).

Re: ConquerStats - Ingame analysis

PostPosted: Sun Jan 25, 2009 1:31 am
by AceArtemis
This is not a major problem, but the word "successful" is spelled wrong.

This table shows the total number of successfull assaults between players.

Re: ConquerStats - Ingame analysis

PostPosted: Sun Jan 25, 2009 5:12 am
by cspare
AceArtemis wrote:This is not a major problem, but the word "successful" is spelled wrong.

This table shows the total number of successfull assaults between players.

Hehe I never noticed:)
I updated the script, but there is no update notification because its such tiny change:) If you like you can click the 'Latest Version Installed' button to to install it.

Re: ConquerStats - Ingame analysis

PostPosted: Fri Feb 27, 2009 9:16 pm
by Andir
How do I remove the chart?

Microsoft is retarded and couldn't program around Linux if they tried and Moonlight crashes Iceweasel. I've had to disable it for now.

Your post says there are two scripts, but I only see one. Have you changed this?

Edit: I'd be willing to attempt to code up a Flash graph if you could give me details on the interface. I've never done Silverlight and don't plan to anytime soon. Maybe there could be two versions (Flash and Silverlight) of the script...?

Re: ConquerStats - Ingame analysis

PostPosted: Thu May 28, 2009 2:33 pm
by xjia
Hey, thanks for the nice script.

But ive encounter some problem when conquer stats is on.
1.The numbers of troops in 2 region stack.....makes it difficult for me the see how many troops there are.
2.I cannot do futher assault or movement after i take 1 move, i MUST reload my page in order to continue my assault or next move.

Example:
-i attack from A(5 troops) to B(1troops)- i won.
-I move 1 troop to B.
-A region should have 3 troops and B region 2 troops
-BUT A region showed 3 and 5 stack together, and B region 1 and 2 together.
( something like u write a number on top of another)

Sorry for all the problem, hopefully u guys can help me out.

Thank you
Jason.

Re: ConquerStats - Ingame analysis

PostPosted: Sat Jun 06, 2009 11:38 am
by xjia
Ive already find out the problem. :)

Re: ConquerStats - Ingame analysis

PostPosted: Mon Jun 08, 2009 9:06 am
by pamoa
I'm having big problem with your wonderful script
it seems he's gone mad since a week or two
as he's displaying data randomly
it seems urgent to have an update

Re: ConquerStats - Ingame analysis

PostPosted: Mon Jun 08, 2009 4:24 pm
by cspare
pamoa wrote:I'm having big problem with your wonderful script
it seems he's gone mad since a week or two
as he's displaying data randomly
it seems urgent to have an update

hmm I havent been playing cc lately so I hadn't noticed. I see that there is a new API available since 14-5, do you think that is about the date that conquerstats stopped working properly for you?

Edit: Hmm I've been trying to fix it but I can't find any documentation on what CC changed. One of the things I noticed is that they renamed 'receives' to 'received', which will ofcourse break the script. But even when I fix that it still does not work, so it seems like a guessing game again *sigh*. I don't have time for that.

Re: ConquerStats - Ingame analysis

PostPosted: Tue Jun 09, 2009 6:10 am
by cspare
I got a list with all changes from Chipv and used it to fix the problems in a new version of ConquerStats (1.5.1). If you download it things should work again. If not, let me know:)
Download it here.

Re: ConquerStats - Ingame analysis

PostPosted: Tue Jun 09, 2009 7:45 am
by pamoa
8-) perfect thanks for the quickness =D>

Re: ConquerStats - Ingame analysis

PostPosted: Tue Jun 23, 2009 1:49 pm
by Kiwi123
I really like your script but on the latest version I have, the chart showing the number of forts per player has dropped out and the update available keeps flashing even after I have clicked on it, installed it and closed and opened firefox again...is it me? Thanks.

Re: ConquerStats - Ingame analysis

PostPosted: Fri Jul 24, 2009 7:24 am
by aselwyn1
hi

i seem to not be able to download ingame ANALYSIS I GET THIS

Code: Select all
// ==UserScript==
// @name           ConquerStats
// @namespace      cspare.ConquerStats
// @description    Shows several statistics for Conquerclub games.
// @include        http://*conquerclub.com*
// ==/UserScript==

var scriptVersion = "1.5.1";

var displayPositionNames = new Array( 'Above log', 'Below chat');
var displayPosition = GM_getValue('csDisplayPosition');
if (displayPosition == null || !(displayPosition > 0 && displayPosition < displayPositionNames.length))
{
   displayPosition = 0;
   GM_setValue('csDisplayPosition', displayPosition);
}

if (location.pathname.indexOf("game.php")==-1)
{
   CheckForUpdates();
   return; // Do not process any further.
}

// CC Elements
var divGameHistory = document.getElementById('log'); // HTML div element containing the game history.
var divDashboard = document.getElementById('dashboard');
var divPlayers = document.getElementById('players');
var divArmies = document.getElementById('armies');

// Custom Elements
var divAggression;
var divContent;
var divAttackTable;
var divReinforcements;
var divSilverApp;

// Vars
var logContent = "";
var playerCount = 0;
var attackTable = new Array();
var attackTableNeutral = new Array();
var playerNames = new Array();
var playerIsEliminatedStartStr = new Array();
var playerIsEliminatedEndStr = new Array();
var playerReinforcementsRegular = new Array();
var playerReinforcementsBonus = new Array();
var playerReinforcementsSpoils = new Array();
var playerReinforcementsTerritoryBonus = new Array();
var playerArmies = new Array();
var teamCount = 0;
var playersPerTeam = 0;
var mapTerritoryCount = 0;
var startingArmies = 0;
var neutralArmiesStart = 0;
var gameHasBonusCards = 0;
var fullLogStr;
var lastLogDate;
var originalRefreshGMScript;


setLogContent(divGameHistory.innerHTML);

function CheckForUpdates()
{

   if (unsafeWindow.sessionStorage != null && unsafeWindow.sessionStorage.csLatestVersion != null)
   {
      showMenu(unsafeWindow.sessionStorage.csLatestVersion == scriptVersion);
   }
   else
   {
     GM_xmlhttpRequest({
       method: "GET",
        url: 'http://www.cspare.nl/ConquerStats/latestVersion.txt?nocache=' + Math.random(),
        onload: function(response)
       {
         unsafeWindow.sessionStorage.csLatestVersion = response.responseText;
         showMenu(response.responseText == scriptVersion);
       }
     });
  }
}


function SwitchDisplayPosition()
{
   displayPosition++;
   if (displayPosition >= displayPositionNames.length)
   {
      displayPosition = 0;
   }
   GM_setValue('csDisplayPosition',displayPosition);
   
   document.getElementById('displayPositionMenuLink').innerHTML = 'Position: <b>' + displayPositionNames[displayPosition] + '</b>';

   // Move HTML elements to new position:
   var divAggression = document.getElementById('Aggression');
   InsertMainDiv(divAggression);
   
}

function showMenu(isLatestVersion)
{
   var divLeftColumn = document.getElementById('leftColumn');
   var ul = divLeftColumn.getElementsByTagName("ul");
   var nav = ul[0].parentNode;

   var header = document.createElement('h3');
   header.innerHTML = 'ConquerStats <span style=\'font-size:7pt;\' ><a href="http://www.conquerclub.com/forum/viewtopic.php?t=63517"> ' + scriptVersion + '</a></span>';
   var menu = document.createElement('ul');

   menu.innerHTML = '<li><a href="javascript:void(0);" id="displayPositionMenuLink">Position: <b>' + displayPositionNames[displayPosition] + '</b></a></li>';

   if (!isLatestVersion)
   {
      menu.innerHTML += '<li><a href="http://userscripts.org/scripts/source/34187.user.js"><span class="countdown-alert">Update Available</span></a></li>';
   } else
   {
      menu.innerHTML += '<li><a href="http://userscripts.org/scripts/source/34187.user.js">Latest Version Installed</a></li>';
   }
   
   
   nav.appendChild(header);
   nav.appendChild(menu);
   
   document.getElementById('displayPositionMenuLink').addEventListener("click", SwitchDisplayPosition, false);   
}



function getFullLog()
{
   var thisLog = divGameHistory.innerHTML.split('<br>');
   
   //if(thisLog[0].indexOf("Game has been initialized") < 0)
   {
      try
      {
         var lastSend = new Date();
         var url = "http://www.conquerclub.com/game.php?";
         url+= "game=" + unsafeWindow.game.value + "&ajax=1&map_key=" + unsafeWindow.mapKey + "&log_number=" + unsafeWindow.logNumber + "&chat_number=" + unsafeWindow.chatNumber+"&lastSend="+lastSend.getTime()+"&full_log=Y";
         var req = new XMLHttpRequest();
         //Setting the URL with a synchronous GET
         req.open('GET',url,false);
         req.send(null);
      }
      catch (e)
      {
         alert(e);
      }
      if (req.status != 200)
      {
         alert('Error requesting full log.');
      }

      var response = req.responseText.split("&");
      setLogContent(unescape(response[15]));
      
      return getLogContent(req.responseText);
   }

}

function setLogContent(logTxt)
{
   logContent = getLogContent(logTxt);
}
function getLogContent(logTxt)
{
   logTxt = logTxt.replace(/lost/g, 'loses');
   logTxt = logTxt.replace(/gained/g, 'gains');
   logTxt = logTxt.replace(/got/g, 'gets');
   logTxt = logTxt.replace(/received/g, 'receives');

   
   return logTxt;
}

function refreshGMScript()
{
   var response = unsafeWindow.request.responseText.split("&");
   var logContent = getLogContent(response[15]);
   var isFullLog = (response[16] == 'Y');
   
   if (isFullLog == true && lastLogDate != null)
   {
      var lastItemIndex = logContent.indexOf(lastLogDate);
      var nextItemIndex = logContent.indexOf('<br />', lastItemIndex);
      
      logContent = logContent.substr(nextItemIndex);

   }
   
   ParseLog(logContent);
   ParseArmies();
   DrawAggresionTable();
   DrawReinforcementsTable();
   UpdateChart(logContent);
   
   originalRefreshGMScript();
}

function InsertMainDiv(divAggression)
{
   switch(displayPosition)
   {
      case 0:
         divDashboard.parentNode.insertBefore(divAggression, divGameHistory.previousSibling.previousSibling);
         break;
         
      case 1:
         divDashboard.parentNode.appendChild(divAggression);
         break;

   }
   
}

function CreateHtml()
{
   divAggression = document.createElement('div');
   divAggression.id = "Aggression";
   divAggression.innerHTML = ""

   divContent = document.createElement('div');
   divContent.id = 'AggressionContent';
   divContent.innerHTML = '';

   divAttackTable = document.createElement('div');
   divAttackTable.id = 'AttackTable';
   divAttackTable.innerHTML = '';   

   divReinforcements = document.createElement('div');
   divReinforcements.id = 'Reinforcements';
   divReinforcements.innerHTML = '';   

   divSilverApp = document.createElement('div');
   divSilverApp.id = 'SilverApp';
   divSilverApp.innerHTML = '';

   divAggression.appendChild(divContent);
   divAggression.appendChild(divAttackTable);
   divAggression.appendChild(divReinforcements);
   divAggression.appendChild(divSilverApp);
   
   InsertMainDiv(divAggression);
   
}


function ParsePlayerInfo()
{
   var qryPlayers = /<span class="player(\d)">([^<]*)<\/span>/gi;
   var playerItems;
   while ((playerItems = qryPlayers.exec(divPlayers.innerHTML)) != null)
   {
      if (playerItems[1] > playerCount) playerCount = playerItems[1];
      playerNames[playerItems[1] - 1] = playerItems[2];
   }


   var qryTeamPlayers = /<li><b>Team (\d):<\/b><\/li>/gi;
   var TeamPlayers;
   while ((TeamPlayers = qryTeamPlayers.exec(divPlayers.innerHTML)) != null)
   {
      if (TeamPlayers[1] > teamCount) teamCount = TeamPlayers[1];

   }

   var qryPlayerIsEliminated = /<span class="eliminated">.*<span class="player(\d)">/gi;
   var PlayerIsEliminated;
   while ((PlayerIsEliminated = qryPlayerIsEliminated.exec(divPlayers.innerHTML)) != null)
   {
      playerIsEliminatedStartStr[PlayerIsEliminated[1] - 1] = '<span class="eliminated">';
      playerIsEliminatedEndStr[PlayerIsEliminated[1] - 1] = '</span>';
      
   }
   
   
   playersPerTeam = playerCount / teamCount;
}

function InitializeVars()
{
   attackTable = new Array(playerCount);
   attackTableNeutral = new Array(playerCount);
   playerReinforcementsRegular = new Array(playerCount);
   playerReinforcementsBonus = new Array(playerCount);
   playerReinforcementsSpoils = new Array(playerCount);
   playerReinforcementsTerritoryBonus = new Array(playerCount);
   playerArmies = new Array(playerCount);

   for (var i = 0; i < playerCount; i++)
   {
      attackTable[i] = new Array(playerCount);
      attackTableNeutral[i] = 0;
      playerReinforcementsRegular[i] = 0;
      playerReinforcementsBonus[i] = 0;
      playerReinforcementsSpoils[i] = 0;
      playerReinforcementsTerritoryBonus[i] = 0;
      playerArmies[i] = 0;
      if (playerIsEliminatedStartStr[i] == null) playerIsEliminatedStartStr[i] = '';
      if (playerIsEliminatedEndStr[i] == null) playerIsEliminatedEndStr[i] = '';
      
      for (var j = 0; j < playerCount; j++)
      {
         attackTable[i][j] = 0;
      }
   }
}

function ParseLog(testStr)
{
   var regExQry = /<span class="player(\d)">[^<]*<\/span> assaulted [ \x21-\x3D\x3F-\x7E?]* from [ \x21-\x3D\x3F-\x7E?]* and conquered it from <span class="player([\d^0])"/gi;
   var myArray;
   while ((myArray = regExQry.exec(testStr)) != null)
   {
      attackTable[myArray[1] - 1][myArray[2] - 1] += 1;
   }
   
   var regExQry = /<span class="player(\d)">[^<]*<\/span> assaulted [ \x21-\x3D\x3F-\x7E?]* from [ \x21-\x3D\x3F-\x7E?]* and conquered it from <span class="player0"/gi;
   var myArray;
   while ((myArray = regExQry.exec(testStr)) != null)
   {
      attackTableNeutral[myArray[1] - 1] += 1;
   }



   var qryRegularReinforcements = /<span class="player(\d)">[^<]*<\/span> receives (\d+) troops for \d+ regions/gi;
   var reinforcements;
   while ((reinforcements = qryRegularReinforcements.exec(testStr)) != null)
   {
      playerReinforcementsRegular[reinforcements[1] - 1] += parseInt(reinforcements[2]);
   }
   
   var qryBonusReinforcements = /<span class="player(\d)">[^<]*<\/span> receives (\d+) troops for holding /gi;
   var bonusReinforcements;
   while ((bonusReinforcements = qryBonusReinforcements.exec(testStr)) != null)
   {
      playerReinforcementsBonus[bonusReinforcements[1] - 1] += parseInt(bonusReinforcements[2]);
   }

   var qryCardSetReinforcements = /<span class="player(\d)">[^<]*<\/span> cashed in a group of <span class="card.">[ \x21-\x3D\x3F-\x7E?]*<\/span>, <span class="card.">[ \x21-\x3D\x3F-\x7E?]*<\/span>, and <span class="card.">[ \x21-\x3D\x3F-\x7E?]*<\/span> worth (\d+) troops/gi;
   var cardSetReinforcements;
   while ((cardSetReinforcements = qryCardSetReinforcements.exec(testStr)) != null)
   {
      playerReinforcementsSpoils[cardSetReinforcements[1] - 1] += parseInt(cardSetReinforcements[2]);
   }

   var qryCardBonusReinforcements = /<span class="player(\d)">[^<]*<\/span> gets bonus of (\d+) troops added to/gi;
   var cardBonusReinforcements;
   while ((cardBonusReinforcements = qryCardBonusReinforcements.exec(testStr)) != null)
   {
      playerReinforcementsTerritoryBonus[cardBonusReinforcements[1] - 1] += parseInt(cardBonusReinforcements[2]);
   }
   
   
   var qryLastDate = /<br \/>(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}) /gi;
   var lastDateItem;
   while ((lastDateItem = qryLastDate.exec(testStr)) != null)
   {
      lastLogDate = lastDateItem[1];
   }
}

function ParseGameInfo()
{
   var qryBonusCards = /Spoils: <b>([\s\w]*)<\/b>/gi;
   var bonusCardsType = qryBonusCards.exec(divDashboard.innerHTML);
   if (bonusCardsType[1] != "No Spoils")
   {
      gameHasBonusCards = 1;
   } else
   {
      gameHasBonusCards = 0;
   }

   
   var armyList = divArmies.innerHTML.split(',');

   mapTerritoryCount = armyList.length;
   startingArmies = Math.floor(mapTerritoryCount / playerCount) * 3;
   neutralArmiesStart = (mapTerritoryCount % playerCount) * 3;
}

function ParseArmies()
{
   for (var i = 0; i < playerCount; i++)
   {
      playerArmies[i] = 0;
   }
   var armyList = divArmies.innerHTML.split(',');
   for (var i = 0; i < armyList.length; i++)
   {
      var armyItem = armyList[i];
      var armyItemElements = armyItem.split('-');

      playerArmies[armyItemElements[0] - 1] += parseInt(armyItemElements[1]);
   }


}



// Draw aggresion table
function DrawAggresionTable()
{
   var divAttackTableStr;

   divAttackTableStr = "<h3>ConquerStats</h3><h4>Aggression</h4>This table shows the total number of successful assaults between players.<br/><table style=\"border: 1px solid rgb(255, 255, 255); background: rgb(238, 238, 238); width: 100%\" rules=\"rows\">";
   divAttackTableStr += "<tr>";
   divAttackTableStr += "<td></td>";


   for (var i = 0; i < playerCount; i++)
   {
      var playerNumber = i + 1;
      divAttackTableStr += "<td>" + playerIsEliminatedStartStr[i] + "<span class=\"player" + playerNumber + "\">" + playerNames[i] + "</span>" + playerIsEliminatedEndStr[i] + "</td>";
   }
   if (neutralArmiesStart > 0)
   {
      divAttackTableStr += "<td><span class=\"player0\">Neutral player</span></td>";
   }
   divAttackTableStr += "<td>Total assaults</td>";
   divAttackTableStr += "</tr>";


   for (var i = 0; i < playerCount; i++)
   {
      var playerNumber = i + 1;
      var sumAttacks = 0;
      divAttackTableStr += "<tr>";
      divAttackTableStr += "<td>" + playerIsEliminatedStartStr[i] + "<span class=\"player" + playerNumber + "\">" + playerNames[i] + "</span>" + playerIsEliminatedEndStr[i] + "</td>";
      
      for (var j = 0; j < playerCount; j++)
      {
         var textVal = "0";
         if (j == i)
         {
            textVal = "-";
         } else
         {
            textVal = "<b>" + attackTable[i][j] + "</b>";
            sumAttacks += attackTable[i][j];
         }
         
         divAttackTableStr += "<td>" + playerIsEliminatedStartStr[i] + "<span class=\"player" + playerNumber + "\">" + textVal + "</span>" + playerIsEliminatedEndStr[i] + "</td>";
         
      }

      if (neutralArmiesStart > 0)
      {
         divAttackTableStr += "<td>" + playerIsEliminatedStartStr[i] + "<span class=\"player" + playerNumber + "\">" + attackTableNeutral[i] + "</span>" + playerIsEliminatedEndStr[i] + "</td>";
      }

      divAttackTableStr += "<td>" + playerIsEliminatedStartStr[i] + "<span class=\"player" + playerNumber + "\">" + sumAttacks + "</span>" + playerIsEliminatedEndStr[i] + "</td>";
      
      divAttackTableStr += "</tr>";
   }

   divAttackTableStr += "</table>";
   divAttackTable.innerHTML = divAttackTableStr;
}

// Draw Reinforcements table
function DrawReinforcementsTable()
{
   var divReinforcementsStr;

   divReinforcementsStr = "<h4>Reinforcements</h4><table style=\"border: 1px solid rgb(255, 255, 255); background: rgb(238, 238, 238); width: 100%\" rules=\"rows\">";


   divReinforcementsStr += "<thead><tr><td>Player Name</td><td title=\"The troops you get from number of territories held.\">Reinforcements</td><td title=\"The troops you get from Continents held.\">Bonus</td><td title=\"Auto deployed bonuses for holding specific territories.\">Territory Bonus</td>";
   if (gameHasBonusCards == 1)
   {
      divReinforcementsStr += "<td title=\"The troops you get for cashing in a group of cards.\">Spoils</td>";
   }
   divReinforcementsStr += "<td>Total Reinforcements</td><td>Troops Still Alive</td><td>Win-Loss Efficiency</td></tr></thead>";


   var teamReinforcementsRegular = 0, teamReinforcementsBonus = 0, teamReinforcementsSpoils = 0, teamReinforcementsTerritoryBonus = 0, teamTotalReinforcements = 0, teamArmies = 0;
   for (var i = 0; i < playerCount; i++)
   {
      var playerNumber = i + 1;
      var totalReinforcements = parseInt(playerReinforcementsRegular[i]) + parseInt(playerReinforcementsBonus[i]) + parseInt(playerReinforcementsSpoils[i]) + parseInt(playerReinforcementsTerritoryBonus[i]);
      var winLossRatio = Math.round((parseInt(playerArmies[i]) * 1000) / (totalReinforcements + startingArmies)) / 10;
      divReinforcementsStr += "<tr><td>" + playerIsEliminatedStartStr[i] + "<span class=\"player" + playerNumber + "\">" + playerNames[i] + "</span>" + playerIsEliminatedEndStr[i] + "</td>";
      divReinforcementsStr += "<td>" + playerIsEliminatedStartStr[i] + "<span class=\"player" + playerNumber + "\">" + playerReinforcementsRegular[i] + "</span>" + playerIsEliminatedEndStr[i] + "</td>";
      divReinforcementsStr += "<td>" + playerIsEliminatedStartStr[i] + "<span class=\"player" + playerNumber + "\">" + playerReinforcementsBonus[i] + "</span>" + playerIsEliminatedEndStr[i] + "</td>";
      divReinforcementsStr += "<td>" + playerIsEliminatedStartStr[i] + "<span class=\"player" + playerNumber + "\">" + playerReinforcementsTerritoryBonus[i] + "</span>" + playerIsEliminatedEndStr[i] + "</td>";
      
      if (gameHasBonusCards == 1)
      {
         divReinforcementsStr += "<td>" + playerIsEliminatedStartStr[i] + "<span class=\"player" + playerNumber + "\">" + playerReinforcementsSpoils[i] + "</span>" + playerIsEliminatedEndStr[i] + "</td>";
         
      }

      divReinforcementsStr += "<td>" + playerIsEliminatedStartStr[i] + "<span class=\"player" + playerNumber + "\">" + totalReinforcements + "</span>" + playerIsEliminatedEndStr[i] + "</td>";
      divReinforcementsStr += "<td>" + playerIsEliminatedStartStr[i] + "<span class=\"player" + playerNumber + "\">" + playerArmies[i] + "</span>" + playerIsEliminatedEndStr[i] + "</td>";
      divReinforcementsStr += "<td>" + playerIsEliminatedStartStr[i] + "<span class=\"player" + playerNumber + "\">" + winLossRatio + "%</span>" + playerIsEliminatedEndStr[i] + "</td>";
      
      divReinforcementsStr += "</tr>";

      if (teamCount > 0)
      {
         teamReinforcementsRegular += playerReinforcementsRegular[i];
         teamReinforcementsBonus += playerReinforcementsBonus[i];
         teamReinforcementsSpoils += playerReinforcementsSpoils[i];
         teamReinforcementsTerritoryBonus += playerReinforcementsTerritoryBonus[i];
         teamTotalReinforcements += totalReinforcements;
         teamArmies += playerArmies[i];


         if ((i + 1) % playersPerTeam == 0)
         {
            var teamNumber = (i + 1) / playersPerTeam;
            var TeamWinLossRatio = Math.round((parseInt(teamArmies) * 1000) / (teamTotalReinforcements + startingArmies * playersPerTeam)) / 10;
            divReinforcementsStr += "<tr>";
            divReinforcementsStr += "<td><b>Team " + teamNumber + "</b></td>";
            divReinforcementsStr += "<td>" + teamReinforcementsRegular + "</td>";
            divReinforcementsStr += "<td>" + teamReinforcementsBonus + "</td>";
            divReinforcementsStr += "<td>" + teamReinforcementsTerritoryBonus + "</td>";

            if (gameHasBonusCards == 1)
            {
               divReinforcementsStr += "<td>" + teamReinforcementsSpoils + "</td>";               
            }
            
            divReinforcementsStr += "<td>" + teamTotalReinforcements + "</td>";
            divReinforcementsStr += "<td>" + teamArmies + "</td>";
            divReinforcementsStr += "<td>" + TeamWinLossRatio + "%</td>";
            divReinforcementsStr += "</tr>";

            teamReinforcementsRegular = 0;
            teamReinforcementsBonus = 0;
            teamReinforcementsSpoils = 0;
            teamReinforcementsTerritoryBonus = 0;
            teamTotalReinforcements = 0;
            teamArmies = 0;
         }
      }

      
   }

   divReinforcementsStr += "</table>";
   divReinforcements.innerHTML = divReinforcementsStr;
}

function DrawChart()
{
   var initParams = ''
   +'page=default'
   +',clientVersion='+scriptVersion;


   var divConquerData = document.createElement('div');
   divConquerData.setAttribute('id', 'ConquerStatsData');
   divConquerData.setAttribute('style', 'display: none;');
   divConquerData.innerHTML = fullLogStr;
   document.body.appendChild(divConquerData);


   divSilverApp.innerHTML = ''
   +'   <div id=\'errorLocation\' style="font-size: small;color: Gray;"></div>\r\n'
   +'    <div id="silverlightControlHost">\r\n'
   +'      <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="silverChart" width="1024" height="350">\r\n'
   +'         <param name="source" value="http://www.cspare.nl/ConquerStats/App/1.3.0/ConquerStats.xap"/>\r\n'
   +'         <param name="minRuntimeVersion" value="2.0.31005.0" />\r\n'
   +'         <param name="autoUpgrade" value="true" />\r\n'
   +'         <param name="enableHtmlAccess" value="true" />\r\n'
   +'         <param name="initParams" value="'+initParams+'" />\r\n'
   +'         <param name="background" value="white" />\r\n'
   +'         \r\n'
   +'         <a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">\r\n'
   +'              <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>\r\n'
   +'         </a>\r\n'
   +'      </object>\r\n'
   +'      <iframe style=\'visibility:hidden;height:0;width:0;border:0px\'></iframe>\r\n'
   +'    </div>\r\n';
}

function UpdateChart(addedLog)
{
   var chart = document.getElementById('silverChart');
   
   chart.wrappedJSObject.Content.ChartInfo.UpdateChart(addedLog);
}

function Init()
{
   originalRefreshGMScript = unsafeWindow.refreshGMScript;
   unsafeWindow.refreshGMScript = refreshGMScript;

   fullLogStr = getFullLog();

   CreateHtml();
   ParsePlayerInfo();
   InitializeVars();
   ParseLog(logContent);
   ParseGameInfo();
   ParseArmies();

   DrawAggresionTable();
   DrawReinforcementsTable();
   DrawChart();
   
   CheckForUpdates();
}

Init();


function embedFunction(s) {
var headTag = document.getElementsByTagName('head')[0];
headTag.appendChild(document.createElement('script')).innerHTML=s.toString().replace(/([\s\S]*?return;){2}([\s\S]*)}/,'$2');
}


on my whole page what do i do now

Re: ConquerStats - Ingame analysis

PostPosted: Fri Jul 24, 2009 7:49 am
by cspare
aselwyn1 wrote:hi

i seem to not be able to download ingame ANALYSIS I GET THIS

Code: Select all
(...)


on my whole page what do i do now


Hey,

I think you don't have Greasemonkey installed in your browser. Follow this guide to install it. Instead of step 4 you can then try to install ConquerStats again.

Re: ConquerStats - Ingame analysis

PostPosted: Thu Oct 29, 2009 1:13 am
by e_i_pi
I'm guessing you're aware that this is currently broken with the latest upgrades to the site

Re: ConquerStats - Ingame analysis

PostPosted: Tue Nov 24, 2009 12:08 pm
by MarathonMax
I have a problem with user's historical points chart.

Probably I am not the only one but I could find the post related to it here.

Basically, when I click on a user's profile, I get the "Error Requesting Game History" message.

Any ideas why? Does this still have to do with the site's many updates?

Tks

Max

Re: ConquerStats - Ingame analysis

PostPosted: Sun Dec 13, 2009 5:30 am
by vodean
maximegousse wrote:I have a problem with user's historical points chart.

Probably I am not the only one but I could find the post related to it here.

Basically, when I click on a user's profile, I get the "Error Requesting Game History" message.

Any ideas why? Does this still have to do with the site's many updates?

Tks

Max

its the same for me. for every user

Re: ConquerStats - Ingame analysis

PostPosted: Thu Dec 17, 2009 5:36 am
by cspare
e_i_pi wrote:I'm guessing you're aware that this is currently broken with the latest upgrades to the site

Is it? The ingame analysis script seems to work fine here.
Are are you referring to the script that displays a chart with a user's score in their profile? That script has a separate forum thread here. That script could be broken, but I think you could use chipv's script instead.

Re: ConquerStats - Ingame analysis

PostPosted: Thu Dec 17, 2009 8:38 am
by MarathonMax
Tks that is the script that I was referring to.

Max

Re: ConquerStats - Ingame analysis

PostPosted: Mon Dec 28, 2009 5:20 pm
by cspare
I hadn't posted it here yet, but version 1.5.2 has been released. This version addresses the changes made by Conquer club's site "Nuclear Spoils (and more!)" changes as described here.
So make sure you upgrade to the latest version and everything should keep working.

Re: ConquerStats - Ingame analysis

PostPosted: Mon Jan 04, 2010 7:17 am
by Shrinky
Conquerstats no longer works for me. been so since the nuclear update. i updated conquerstats to version 1.5.2 and conquerstats stopped showing data. i even tried to reinstall it and STILL nothing happened. i've checked for both positions of conquerstats- it neither shows below chat nor above game log.

any idea what could be the issue here?

Re: ConquerStats - Ingame analysis

PostPosted: Wed Jan 20, 2010 9:48 am
by pamoa
can we hope any update ? :(

Re: ConquerStats - Ingame analysis

PostPosted: Wed Feb 03, 2010 4:44 am
by Shrinky
can one of the tech geniuses please take a look at this?
pretty please. [-o<

Re: ConquerStats - Ingame analysis

PostPosted: Wed Feb 03, 2010 5:59 am
by cspare
I'm not sure what could be wrong. It is working perfectly here and also on anther computer I tested it on. Any one else having problems?

Re: ConquerStats - Ingame analysis

PostPosted: Wed Feb 03, 2010 1:15 pm
by Shrinky
i wish i could post a screenshot of what im facing but im having issues atm. not able to get the correct image size upon using image hosting site.
was using imageshack.com but it's a no go.. so are there any other good sites out there which i can use for doing this without my having to first go and register myself?