旧式的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如何将JSP与Hibernate连接?   java无法退出do while循环,即使表达式为false   使用Restlet和GAE过滤根路径   java<rich:popupanel按钮在JSF项目中不起作用   java错误:在安卓包中找不到属性“showAsAction”的资源标识符   性能Java 2D:在屏幕上快速渲染大量瓷砖   java Android MediaPlayer seekTo(0)不寻求启动   java使用jsweet将小程序代码转换为js。类文件依赖关系   java Maven导入问题,在complie时间使用里程碑版本,但在运行时使用最新版本   java JPA:从另一个对象访问对象返回null   java我如何启动一个java应用程序。带有桌面快捷方式的jar文件(针对特定jre)   java将值从JTextField传递到方法的最佳方式?   在java中从字符串中分离子字符串   java如何初始化使用另一个映射作为值的EnumMap   单击<a>元素时java JSF调用bean方法   java Board的方块不会出现。   java如何在spring boot中部分回滚数据,错误将被分散   java从另一个类文件向类添加方法   如何修复错误“TimeBackUp.java使用未经检查或不安全的操作”?