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

ta-client-api

v0.4.0

Published

Control TA programmatically with JavaScript.

Downloads

15

Readme

TA Client API

npm version

Control TA programmatically with JavaScript.

npm install ta-client-api

Usage

import { GameClient } from 'ta-client-api';

// The path to your TA executable (can be relative or absolute).
const path = 'C:/path/to/TribesAscend.exe';

// Create a new game client instance.
const client = new GameClient(path);

Configuration

The easiest way to configure the client is through the chainable settings methods. Each method is optional and can be used in any order. For example, to launch the game in a 700px ⨯ 450px window:

client
    .windowed(true)           // Enable windowed mode.
    .resolution(700, 450)     // Set the resolution.
    .start();                 // Launch the game.

Or to connect directly to a game server:

import { Team } from 'ta-client-api';

client
    .connect('example.wilderzone.live', 7777)  // Specify the server address and port to connect to.
    .team(Team.DiamondSword)                   // Join the Diamond Sword team.
    .start();                                  // Launch the game.

All available settings: | Setting | Options | Default | Works with (🕹️ game mode | 🗄️ server mode) | Description | | :----------- | :------------------- | :----------------- | :---------- | :---------------------------------------------------- | | custom | argument | None | 🕹️🗄️ | Pass a custom argument to the game client. | | connect | address, port-number | None, 7777 | 🕹️ | Connect to a game server. | | debug | true \| false | false | 🕹️🗄️ | Enable debugging output. | | fullscreen | true \| false | true | 🕹️ | Enable fullscreen mode. | | host | address | None | 🕹️🗄️ | Use a specific host login server. | | log | path | {cwd}/logs | 🕹️🗄️ | Output log files. | | map | map-name | None | 🕹️🗄️ | Launch directly into a particular map. | | position | number, number | 0, 0 | 🕹️ | The position of the game window on the screen. This only takes effect in windowed mode. | | resolution | number, number | None | 🕹️ | The resolution of the game window. | | server | port-number | 7777 | 🗄️ | Start the game as a server. | | splash | true \| false | true | 🕹️ | Show the splash screen. | | team | 0 \| 1 \| 2 \| 255 | 255 | 🕹️ | The team to join. | | windowed | true \| false | false | 🕹️ | Enable windowed mode. |

Events

You can register callback functions to listen for certain events emitted by the game client.
For example, to log a message when the client starts:

client.on('start', () => {
    console.log('Woohoo!');
});

| Event | Description | | :------ | :------------------------------------------------------------------------------ | | start | Emitted when the game client has started up and is ready to be interacted with. | | stop | Emitted when the game client has stopped running (intentionally) and is no longer accessible. | | crash | Emitted when the game client has stopped running (from a crash) and is no longer accessible. |

References