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

grad-scoreboard

v0.1.1

Published

a dynamic scoreboard that displays what you feed it

Downloads

15

Readme

GRAD Scoreboard

A dynamic scoreboard that displays what you feed it.
Works well together with GRAD Winrate Tracker.

Features

  • take a specifically formatted array of statistics
  • optionally sort it
  • display it in a dialog
  • adjust the dialog dimensions depending on array contents
  • try to find the player's profile name and highlight their statistics

Dependencies

The CBA_A3 mod is required.

Installation

Manually

  1. Create a folder in your mission root folder and name it modules. Then create one inside there and call it grad-scoreboard.
  2. Download the contents of this repository ( there's a download link at the side ) and put it into the directory you just created.
  3. see step 3 below in the npm part

Via npm

for details about what npm is and how to use it, look it up on npmjs.com

  1. Install package grad-scoreboard : npm install --save grad-scoreboard
  2. Prepend your mission's description.ext with #define MODULES_DIRECTORY node_modules
  3. Append the following lines of code to the description.ext:
#include "node_modules\grad-scoreboard\grad_scoreboard.hpp"

class CfgFunctions {
    #include "node_modules\grad-scoreboard\cfgFunctions.hpp"
};

Usage

If no second statistics array is provided, the additional window will be hidden. The parameter array can be generated with GRAD Winrate Tracker (however, if you want any other stats than games, wins, losses, winrate, winrateTracker will not work for you). To open the scoreboard, use
[duration,main stats,main headline,rank numbers,sort,2nd stats,2nd headline,2nd rank numbers,2nd sort,disable simulation] call grad_scoreboard_fnc_loadScoreboard:

| Parameter | Explanation | |-----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------| | duration | Number - Duration for which the dialog is displayed. -1 to disable. | | main stats | Array - Contains all statistics to be displayed in main window (see below for correct syntax). | | main headline | String - Title of the main window. | | rank numbers (optional) | Bool - Display rank numbers as first column in main window? | | sort (optional) | Bool/Array - If array: [sort statistics? (bool), index to sort by (number), sort ascending (bool)]. If bool, true: Sort by first index, descending. | | 2nd stats (optional) | Array - Contains all statistics to be displayed in additional window (see below for correct syntax) | | 2nd headline (optional) | String - Title of additional window. | | 2nd rank numbers (optional) | Bool - Display rank numbers as first column in additional window? | | 2nd sort (optional) | Bool/Array - If array: [sort additional statistics? (bool), index to sort by (number), sort ascending (bool)]. If bool, true: Sort by first index, descending. | | disable simulation | Bool - Disable player simulation for the duration. |

Example: [20,_allStats,"statistics of my mission",true] call grad_scoreboard_fnc_loadScoreboard

Statistics Arrays Syntax

The statistics arrays passed to the scoreboard have to be formatted in a certain way:

_allStats = [array,array,array,...]

  • the first nested array is interpreted as the headline
  • all nested arrays have to be the same length
  • all elements of the same index have to be of the same type
  • the main and additional stats arrays can be completely different

Example:

_allStats = [
    ["Player name", "Points", "Kills"],
    ["Hans", 12, 6],
    ["Franz", 15, 5],
    ["Alf", 9, 2]
];

Sorting

If the statistics are to be sorted before displaying, the sort parameter is used.

[true,1,false] would sort the stats array from the previous example descending by points:

_allStats = [
    ["Player name", "Points", "Kills"],
    ["Franz", 15, 5],
    ["Hans", 12, 6],
    ["Alf", 9, 2]
];

[true,2,true] would sort the stats array from the previous example ascending by kills:

_allStats = [
    ["Player name", "Points", "Kills"],
    ["Alf", 9, 2]
    ["Franz", 15, 5],
    ["Hans", 12, 6],
];