旧式的Runescape图书馆

OSRS-Hiscores的Python项目详细描述


OSRS Hiscores API库

目的

这个库的目的是与老式runescape(osrs)的hiscores页面交互,并允许开发人员以更直观的方式(通过字典)访问stat级别、等级和体验级别。此库通过http.client请求访问此信息,并相应地解析该信息。

安装

python -m pip install OSRS-Hiscores

示例用法

fromOSRS_HiscoresimportHiscores# User to lookupusername='Zezima'# Initialize user object, if no account type is specified, we assume 'N'user=Hiscores(username,'N')# Get the entire stat dictionaryuser.stats# Get total Levelsuser.skill('total')# Get a specific skill's ranking, level, and experienceuser.stats['runecrafting']# Get skill's level, ranking, and experience separatelyuser.stats['runecrafting']['level']user.stats['runecrafting']['rank']user.stats['runecrafting']['experience']# NEWuser.stats['runecrafting']['next_level_experience']# Total Exp needed for next leveluser.stats['runecrafting']['exp_to_next_level']# Exp remaining til next level# A simpler way to just get a skill's attributesprint("Current level:",user.skill('attack','level'))print("Current rank:",user.skill('attack','rank'))print("Current exp:",user.skill('attack','experience'))print("Exp remaining:",user.skill('attack','exp_to_next_level'))

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用字符而不是字符串的意义   部分匹配长度字符串相似性的java正则表达式   java获取构造函数错误(错误:“(”或“[”)   java@Value注释无法正常工作SpringBoot   java hasKey在响应中没有看到字段   java JavaFX,没有JFXButtons和所有   在Log4j2中,是否可以根据键从记录器中筛选出某些键值对?   如何使用Java中Kafka的消息,从特定偏移量开始   java在单击后存储动态按钮的值   java Android编码:ViewRootImpl$CalledFromErrorThreadException。[Noob]   通过FileChooser保存pdf格式会提示在java中出现第二个对话框   用于空文件的java Spring集成文件标记   java我们应该如何编写get方法,以便私有字段不会超出其预期范围?   java Eclipse产品问题,Juno RequireHandle:org。日食e4。果心服务