Code Monkey home page Code Monkey logo

among.js's Introduction

among.js

HitCount npm GitHub last commit GitHub contributors Lines of code supports Steam

About

among.js is a npm package to monitor memory for Among Us.

Installation

โš  This package will not install if the system does not have memoryjs and its dependencies.

npm install among.js

It'll work fine on Windows 64bit but on any other system it won't work.

Example

// Include this package
const AmongUs = require("among.js");
const client = new AmongUs.Client();

// when among.js has been ready
client.on("ready", () => {
	console.log("Ready!")
	client.on("update", () => {

		// Reset
		let players = {
			crewmate: new Array(),
			imposter: new Array(),
			ghost: new Array(),
			disconnected: new Array()
		};

		// Get all players information
		const _players = client.game.players.get();
		for (let player of _players) {
			if (!player.isDisconnected) {
				if (!player.isGhost) {
					if (!player.isImposter) {
						players.crewmate.push(player.color);
					} else {
						players.imposter.push(player.color);
					}
				} else {
					players.ghost.push(player.color);
				}
			} else {
				players.disconnected.push(player.color);
			}
		}

		// Result
    console.clear();
		console.log("");
		console.log(` Player: ${(_players.length - players.ghost.length - players.disconnected.length)} / ${_players.length}`);
		console.log("");
		console.log(` Crewmate: ${players.crewmate.join(", ")}`);
		console.log(` Imposter: ${players.imposter.join(", ")}`);
		console.log("");
		console.log(` Dead: ${players.ghost.join(", ")}`);
		console.log("");
		console.log(` Disconnected: ${players.disconnected.join(", ")}`);

	});
});

// when among.js has a problem
client.on("error", (error) => {
	throw new Error(error);
});

// start
client.start();

Links

among.js's People

Contributors

pimmediately avatar jerbear2008 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.