DKRUBEN 19 Posted June 27, 2022 how to find value 0 in tank stats. python code. def __getAccountDossier(self): dossier = self.itemsCache.items.getAccountDossier().getRandomStats() return dossier def _setValue(itemCD): stats = self.__getAccountDossier().getVehicles().get(intCD) result = float(100.0 * stats.wins / stats.battlesCount if stats.battlesCount else 0) # value sup 0 don't return battlesCount = 0 if stats.battlesCount != 0: return value = '%.2f' % result if result < 100 else '100' value = '%s' % value.rjust(5) self.macro['win'] = '%s%%' % str(value) # internal self.macro['c:win'] = self.getColor('winRate', result) # internal Quote Share this post Link to post Short link Share on other sites
Kurzdor 460 #520647 Posted June 29, 2022 @DKRUBEN Can you explain the problem more widely? Quote Share this post Link to post Short link Share on other sites
DKRUBEN 19 #520661 Posted June 30, 2022 when I try of tanks do not have battles, I get the message in the log saying stats.battleCount does not exist. Quote Share this post Link to post Short link Share on other sites