From 9b13e58a3b95dbfe3294110f98d3c6db50d79552 Mon Sep 17 00:00:00 2001 From: Jack Brown Date: Sat, 11 Nov 2023 23:16:42 +0000 Subject: [PATCH 1/2] Change the way we handle total level, rank and XP --- OSRSBytes/Hiscores.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/OSRSBytes/Hiscores.py b/OSRSBytes/Hiscores.py index 2483f32..2f0b2f4 100644 --- a/OSRSBytes/Hiscores.py +++ b/OSRSBytes/Hiscores.py @@ -168,20 +168,9 @@ def __parseSkills(self): subset = {} # Totals info = {} - - # Split data into lists - for value in self.data.split(" "): - total_info = value.split(",") - - # assign into dictionary - info['rank'] = total_info[0] - info['level'] = total_info[1] - info['experience'] = total_info[2] - break - - subset['total'] = info - + self.__skills = [ + 'total', 'attack', 'defense', 'strength', From 9ded3a6b6a43f938ef67cae72f68fb6262968c8d Mon Sep 17 00:00:00 2001 From: Jack Brown Date: Sat, 11 Nov 2023 23:20:26 +0000 Subject: [PATCH 2/2] We no longer need to remove total section from hiscore data as we are processing it as a skill --- OSRSBytes/Hiscores.py | 1 - 1 file changed, 1 deletion(-) diff --git a/OSRSBytes/Hiscores.py b/OSRSBytes/Hiscores.py index 2f0b2f4..a33f26d 100644 --- a/OSRSBytes/Hiscores.py +++ b/OSRSBytes/Hiscores.py @@ -342,7 +342,6 @@ def __parseData(self): # Prep data for parsing self.__parsed_data = self.data.split("\n") - self.__parsed_data.pop(0) # remove totals section self.__parseSkills()