npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ts-triton

v1.0.8

Published

A typescript client for the unpublished API for Neptune's Pride II: Triton (https://np.ironhelmet.com/)

Downloads

3

Readme

ts-triton

A typescript client for the unpublished API for Neptune's Pride II: Triton (https://np.ironhelmet.com/)

The base mechanics were adapted from phpTriton and then built on top of, like adding the capability of giving carriers orders.

Usage

You can initialize the client, authenticate, and get a game like the following:

import {TritonClient} from "ts-triton";

const client = new TritonClient('alias', 'password');
if (await client.authenticate()) {
    const game = client.getGame('game id');
}

From there you can use the functions inside the game object to interact with the game, such as getting data and sending orders.

Classes

TritonClient(alias: string, password: string, version: number = 7)

  • authenticate() - authenticates the player credentials, return true on success
  • getGame(gameId: string) - returns a TritonGame object to interact with the game that has that ID
  • getServer() - returns a TritonServer object to interact with the player details

TritonServer(client: TritonClient)

  • getPlayer() - returns the player information
  • getOpenGames() - returns the open game information

TritonGame(client: TritonClient, gameId: string)

  • getFullUniverse() - returns game universe information
  • getIntel() - returns intel statistics
  • getUnreadCount() - returns the amount of unread messages
  • getPlayerAchievements() - returns the player achievement information
  • getDiplomacyMessages(count: number, offset: number = 0) - returns the player's diplomacy messages
  • getEventMessages(count: number, offset: number = 0) - returns the player's event messages
  • readMessage(messageKey: string) - marks a message as read
  • buyEconomy(star: string, price: number) - upgrade the economy on a planet
  • buyIndustry(star: string, price: number) - upgrade the industry on a planet
  • buyScience(star: string, price: number) - upgrade the science on a planet
  • giveShipOrder(shipId: number, orders: ShipOrder[]) - give orders to ship carriers
  • getStarsInDistance(starId: number): Star[] - Get the stars in travel distance of another star for you
  • getDistanceBetweenStars(startStarId: number, endStarId: number) - Get the distance between two stars
  • findPathToStar(startStarId: number, endStarId: number, allowedToCrossOtherPlayers: boolean = false, otherPlayerWeightMultiplied: number = 2) - Find a path of stars from one star to another