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

node-machina-ffxiv

v2.42.16

Published

A wrapper for revahn's Machina network capture library.

Downloads

8

Readme

Please use ffxiv-teamcraft/pcap-ffxiv for all new projects. This package is no longer actively maintained.

node-machina-ffxiv

A WIP Node.js wrapper for revahn's Machina network capture library.

Many features are unimplemented, and chat-related messages aren't completely working, but besides that what is implemented is probably usable.

If you so choose, you can use it exclusively as a wrapper for Machina with minimal data processing by assigning the raw data event as shown below.

Event type names and all packet structures are taken from the Sapphire server project.

NOTE: Most features besides the raw data event will break after every patch release until the IPC opcodes are updated in the Sapphire repo.

Installation

npm install node-machina-ffxiv

If you don't trust the copy of MachinaWrapperJSON that is built in the Github Action, feel free to also install Visual Studio 2017 Community Edition to build MachinaWrapperJSON and place the output in the MachinaWrapper folder.

Usage

Installing WinPCap is highly recommended, as it reduces the amount of additional setup that needs to be done. Set monitorType to "WinPCap" to enable WinPCap mode.

Otherwise, your application must be run in Administrator mode, and the .exe needs firewall in/out privileges, since it operates on Windows sockets.

Please refer to the wiki for usage.

Example

const MachinaFFXIV = require('node-machina-ffxiv');
const Machina = new MachinaFFXIV({}); // An object must be provided, even if it is empty.
Machina.start(() => {
    console.log("Machina started!");
});

// Assign event handlers
Machina.on('cFCommence', (content) => {
    console.log(`[${getTime()}]Duty commenced!`);
});

Machina.on('cFRegistered', (content) => {
    console.log(`[${getTime()}]Duty registration complete.`);
});

Machina.on('examineSearchInfo', (content) => {
    console.log(`Viewing search info.
        FC: ${content.fc}
        Search Comment: ${content.searchComment}
        World: ${content.world}
    `);
});

Machina.on('freeCompanyMemberLogin', (content) => {
    console.log(`[${getTime()}][FC]${content.character} has logged in.`);
});

Machina.on('freeCompanyMemberLogout', (content) => {
    console.log(`[${getTime()}][FC]${content.character} has logged out.`);
});

Machina.on('initZone', (content) => {
    console.log(`[${getTime()}]Zone loaded.`);
});

Machina.on('marketBoardItemListing', (content) => {
    var output = "HQ\tMateria\tPrice\tQuantity\tTotal\tCity\t\tRetainer\n";
    for (let i = 0; i < content.prices.length; i++) {
        output += `${content.qualities[i]}\t${content.materiaCounts[i]}\t${content.prices[i]}\t${content.quantities[i]}\t\t${content.totals[i]}\t${content.cities[i] !== "Ul'dah" && content.cities[i] !== "Kugane" && content.cities[i] !== "Ishgard" ? content.cities[i] :
                    (content.cities[i] === "Kugane" ? "Kugane\t" : (content.cities[i] === "Ishgard" ? "Ishgard\t" : "Ul'dah\t"))}\t${content.retainers[i]}\n`;
        if (content.materia[i].length > 0) output += `Materia: ${content.materia[i].toString()}\n`;
    }
    console.log(output);
});

Machina.on('message', (content) => { // Using a supertype event to streamline code
    console.log(`[${getTime()}][${content.type.slice(7)}]<${content.character}> ${content.message}`);
});