Skip to content

BasketBandit/RuneAPI.java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RuneAPI.java

Simple open source Java wrapper for the OSRS portion of the RuneScape API.

Class Data

Methods

 .getStats(String username);

Usage

Get

#1 - Loop through all skills and print the data.

Map<String, Skill> skills = RuneAPI.getStats(username);

for(Skill skill: skills.values()) {
    System.out.printf("%s: #%,d - %,d - %,dxp \n", skill.getName(), skill.getRank(), skill.getLevel(), skill.getExperience());
}

#2 - Find specific skill and print the data.

Map<String, Skill> skills = RuneAPI.getStats(username);
Skill overall = skills.get(Skills.OVERALL);

System.out.printf("%s: #%,d - %,d - %,dxp \n", overall.getName(), overall.getRank(), overall.getLevel(), overall.getExperience());

Interface

Provided is an interface class which contains both a List<String> of all skill names accessed via Skills.asList, and each individual skill String accessed via the skills name, e.g Skills.COOKING. This allows you to access a skill map without fear of mistyping the name of a skill. An example using this interface is given above.

Download

Replace VERSION with the JitPack version number you can see above.

Gradle

repositories {
    maven { url 'https://jitpack.io' }
}
dependencies {
    implementation 'com.github.BasketBandit:RuneAPI.java:VERSION'
}

Maven

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
<dependency>
    <groupId>com.github.BasketBandit</groupId>
    <artifactId>RuneAPI.java</artifactId>
    <version>VERSION</version>
</dependency>