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

ogamejs

v2.1.6

Published

## Introduction

Downloads

9

Readme

A library for Ogame

Introduction

I always wanted an Ogame calculator that suited me, all those I could see online are, either too old in graphic terms, or it didn't work, it was calculating badly the number of resources to send for each exchange...

So I decided to write a library in Javascript to create accessible methods to perform all calculations in a simple way for anyone who wants to create a graphical interface.

Api documentation

All available methods will be listed below

Building

  • getCrystalMine Return information about the crystal mine given a specific level
/**
 *
 * Return information about the crystal mine given a specific level
 * @param {object} mine The crystal mine base information
 * @param {number} targetLevel the crystal mine target level
 * @param {number} pos pos 1/2/3 have a 15/10/5%
 * @param {number} universeSpeed production factor is increased for some universe
 * @returns {Object} informations about the crystal mine at this specific level
 */
function getCrystalMine(mine, targetLevel, pos, universeSpeed = 1) {
    @return {
        crystal: Number,
        deut: Number,
        energy: Number,
        metal: Number,
        production: Number
    }
}
  • getDeutSynth Return information about the deuterium synth given a specific level
/**
 *
 * Return information about the deuterium synth given a specific level
 * @param {object} mine The deut synth base information
 * @param {number} targetLevel the deuterieum synth target level
 * @param {number} avg planet average temperature - The lower the higher the prod is
 * @param {number} universeSpeed production factor is increased for some universe
 * @returns {Object} informations about the deut synth at this specific level
 */
function getDeutSynth(mine, targetLevel, avg, universeSpeed = 1) {
    @return {
        crystal: Number,
        deut: Number,
        energy: Number,
        metal: Number,
        production: Number
    }
}
  • getMetalMine Return information about the metal mine given a specific level
/**
 *
 * Return information about the metal mine given a specific level
 * @param {object} mine The metal mine base information
 * @param {number} targetLevel
 * @param {number} universeSpeed production factor is increased for some universe
 * @returns {Object} informations about the metal mine at this specific level
 */
function getMetalMine(mine, targetLevel, universeSpeed = 1) {
    @return {
        crystal: Number,
        deut: Number,
        energy: Number,
        metal: Number,
        production: Number
    }
}
  • getSolarPlant Return information about the solar plant given a specific level
/**
 *
 * Return information about the solar plant given a specific level
 * @param {object} solarPlant The solarPlant base information
 * @param {number} targetLevel
 * @returns {Object} informations about the solar plant at this specific level
 */
function getSolarPlant(solarPlant, targetLevel) {
    @return {
        crystal: Number,
        deut: Number,
        energy: Number,
        metal: Number,
        production: Number
    }
}
  • getFusionReactor Return information about the fusion reactor given a specific level
/**
 *
 * Return information about the fusion reactor given a specific level
 * @param {object} reactor The fusion react base information
 * @param {number} targetLevel
 * @param {number} energyTech The technology energy level
 * @param {number} universeSpeed production factor is increased for some universe
 * @returns {Object} informations about the fusion reactor at this specific level
 */

function getFusionReactor(reactor, targetLevel, energyTech, universeSpeed = 1) {
    @return {
        crystal: Number,
        deut: Number,
        energy: Number,
        metal: Number,
        production: Number
    }
}
  • parseInfoCompteData Return the number of debris generated
/**
 *
 * Return information about the crystal mine given a specific level
 * @param {object} data The infocompte bb-code
 * @returns {Object} The parsed JSON object of infocompte
 */
function parseInfoCompteData(data) {
    @return {
        planet: String,
        metal: String,
        crystal: String,
        deut: String,
        temperature: Number,
    }
}

Fleet

  • getDebris Return the number of debris generated
/**
 *
 * Returns the number of debris generated
 * @param {number} shipId The ship identifier
 * @param {number} number The number of ship
 * @param {number} factor The universe debris factor
 * @return {Object} The debris generated
 */
getDebris(ship, number, facror) {
    @return {
        metal: Number,
        crystal: Number,
    }
}

Trader

  • sellDeut Exchange of deuterium against Metal and Crystal
// All params are optionnals
// values placed here will be used if not specified
sellDeut(deut = 0, percentM = 60, percentC = 40, rate = '2:1.5:1') {
    @return {
        metal: Number,
        crystal: Number
    }
}
  • sellMetal Exchange of deuterium against Metal and Crystal
// All params are optionnals
// values placed here will be used if not specified
sellMetal(metal = 0, percentD = 40, percentC = 60, rate = '2:1.5:1') {
    @return {
        deut: Number,
        metal: Number
    }
}
  • sellCrystal Exchange of deuterium against Metal and Crystal
// All params are optionnals
// values placed here will be used if not specified
sellCrystal(crystal = 0, percentD = 40, percentM = 60, rate = '2:1.5:1') {
    @return {
        deut: Number,
        metal: Number
    }
}
  • parseRate() Parse the exchange rate
// All params are optionnals
// values placed here will be used if not specified
parseRate(rate = '2:1.5:1') {
    @return {
        rateDeut: Number,
        rateMetal: Number,
        rateCrystal: Number
    };
}

Models

Listed below are categories of Buildings / Ships / Defenses

Buildings

Buildings Here you will find all listed Buildings in the game

Destroyable

Destroyable Here you will find all listed Ships / Defense in the game