2017 © Pedro Peláez
 

library runescape-lookup-commons

A PHP library containing RuneScape lookup components.

image

villermen/runescape-lookup-commons

A PHP library containing RuneScape lookup components.

  • Monday, February 5, 2018
  • by Villermen
  • Repository
  • 1 Watchers
  • 0 Stars
  • 30 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 25 Versions
  • 3 % Grown

The README.md

RuneScape lookup commons

A PHP library containing RuneScape lookup components., (*1)

Features

  • Fetch and compare RS3 and OSRS high scores.
  • Alternatively for RS3, RuneMetrics can be used to obtain high scores and activity feed together. It may contain high score data even for non-member players, but lacks activity high scores.
  • Fetch player activity feed via RuneMetrics or Adventurer's log.
  • Calculate combat levels and virtual skill levels.

Installation

composer require villermen/runescape-lookup-commons, (*2)

Usage

Create or obtain an instance of Player and use it with the PlayerDataFetcher service to obtain high scores and other information., (*3)

use Villermen\RuneScape\HighScore\HighScoreSkill;
use Villermen\RuneScape\HighScore\OsrsSkill;
use Villermen\RuneScape\HighScore\Rs3HighScore;
use Villermen\RuneScape\HighScore\Rs3Skill;
use Villermen\RuneScape\Player;
use Villermen\RuneScape\Service\PlayerDataFetcher;

$fetcher = new PlayerDataFetcher(); // You can optionally provide your own HTTP client.
$player = new Player('playername');

$rs3HighScore = $fetcher->fetchIndexLite($player, oldSchool: false);
$mining = $rs3HighScore->getSkill(Rs3Skill::MINING);
$mining->level; // 110
$mining->getVirtualLevel(); // 123
$mining->getXpToNextLevel(); // 1231231
$rs3HighScore->getSkill(Rs3Skill::NECROMANCY)->xp // null
$rs3HighScore->getSkill(Rs3Skill::TOTAL)->rank; // 1200000
$rs3HighScore->getCombatLevel(includeSummoning: true); // 138

$osrsHighScore = $fetcher->fetchIndexLite($player, oldSchool: true);
$osrsHighScore->getSkill(OsrsSkill::HITPOINTS)->getLevelOrMinimum(); // 10

$highScore1 = new Rs3HighScore(skills: [new HighScoreSkill(
    skill: Rs3Skill::ATTACK,
    rank: null,
    level: 24,
    xp: 7420,
)], activities: []);
$highScore2 = new Rs3HighScore(skills: [new HighScoreSkill(
    skill: Rs3Skill::ATTACK,
    rank: 2000000,
    level: 25,
    xp: 7840,
)], activities: []);
$comparison = $highScore1->compareTo($highScore2);
$comparison->getLevelDifference(Rs3Skill::ATTACK); // -1
$comparison->getRankDifference(Rs3Skill::ATTACK); // null
$comparison->getXpDifference(Rs3Skill::ATTACK); // 420

$runeMetrics = $fetcher->fetchRuneMetrics($player);
$runeMetrics->displayName; // "PlayerName"
$runeMetrics->highScore; // Rs3HighScore
$runeMetrics->activityFeed->items[0]->title; // "Quest complete: Evil Dave's big day out"

$adventurersLog = $fetcher->fetchAdventurersLog($player);
$adventurersLog->displayName; // "PlayerName"
$adventurersLog->activityFeed->items[0]->description; // "I somehow switched bodies with Evil Dave and survived enough chores and shouting from Doris to find a way to swap back!"

The Versions

05/02 2018

dev-master

9999999-dev

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

05/02 2018

v4.2.3

4.2.3.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

05/02 2018

v4.2.2

4.2.2.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

05/02 2018

v4.2.1

4.2.1.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

05/02 2018

v4.2.0

4.2.0.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

04/02 2018

v4.1.5

4.1.5.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

04/02 2018

v4.1.4

4.1.4.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

04/02 2018

v4.1.3

4.1.3.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

04/02 2018

v4.1.2

4.1.2.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

03/02 2018

v4.1.1

4.1.1.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

03/02 2018

v4.1.0

4.1.0.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

02/02 2018

v4.0.0

4.0.0.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

01/02 2018

v3.0.0

3.0.0.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

31/01 2018

v2.0.2

2.0.2.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

31/01 2018

v2.0.1

2.0.1.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

30/01 2018

v2.0.0

2.0.0.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

29/01 2018

v1.3.1

1.3.1.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

12/09 2017

v1.3.0

1.3.0.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

11/09 2017

v1.2.2

1.2.2.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

11/09 2017

v1.2.1

1.2.1.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

08/09 2017

v1.2.0

1.2.0.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

08/09 2017

v1.1.1

1.1.1.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

08/09 2017

v1.1.0

1.1.0.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

08/09 2017

v1.0.1

1.0.1.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires

05/09 2017

v1.0.0

1.0.0.0

A PHP library containing RuneScape lookup components.

  Sources   Download

MIT

The Requires

  • php >=7

 

The Development Requires