Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull overall total? #31

Closed
PhyrWall opened this issue Dec 21, 2022 · 2 comments
Closed

Pull overall total? #31

PhyrWall opened this issue Dec 21, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@PhyrWall
Copy link

Is there an option to pull the overall total level as well?

@Coffee-fueled-deadlines
Copy link
Owner

It should be:

from OSRSBytes import Hiscores

user = Hiscores("Hess")
print(user.skill("total","level"))

However, this raises an issue of there being a parsing error in that section of the code that I'll need to address as it outputs incorrect information.

For now you can access the total/overall attributes with this loop:

from OSRSBytes import Hiscores

user = Hiscores("Hess")

for value in user.data.split(" "):
    total_info = value.split(",")
    total_rank = total_info[0]
    total_level = total_info[1]
    total_experience = total_info[2]
    
print("Users Total Rank is {}".format(total_rank))
print("Users Total Level is {}".format(total_level))
print("Users Total Experience is {}".format(total_experience))

I'll add this to the todo list for version 1.3.1 so that this work around isn't needed.

@Coffee-fueled-deadlines Coffee-fueled-deadlines added the bug Something isn't working label Dec 21, 2022
Coffee-fueled-deadlines added a commit that referenced this issue Dec 27, 2022
@Coffee-fueled-deadlines
Copy link
Owner

This has been fixed in This commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants