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

vas-chat-reactor

v1.1.3

Published

A mineflayer plugin that reacts to word descramble chat messages.

Downloads

5

Readme

vas-chat-reactor

A plugin for mineflayer which allows the bot to respond to Chat Reaction messages

Prerequisites

Installation

Clone this repository in node_modules folder and run:

npm install

Or just simply:

npm install vas-chat-reactor

Configuration

  • Move or copy the file chat_config.ini in the bot directory. Make sure to have it in the same directory where nodejs starts.
  • Fill in the chat_config.ini file with the necessary things to identify Chat Reaction messages and extract the word from it. You will find all the documentation inside it. The dictionaryFile and unknownWordsFile paths are relative to where nodejs starts.
  • Fill the time to wait until the bot writes the word (will be evaluated with eval(timeout)). I found that 1850 + ~~((0.5 + Math.random()/2) * 150 * word.length) works best looking at how quick other players write.
  • Fill in the chance to write the word. 0 or less means 0% or never write the word and 1 or bigger is 100% chance of writing.
  • Write all the known possible words to descramble in dictionaryFile, one on every line. If you don't know the words, let the bot run for some time until it will collect most of them.

Anytime the bot will find an unknown word it will write it into the unknownWordsFile, as specificated in configuration file.
Don't use my config and dictionary file, they are just a reference guide!
Why don't I use regex instead of string.startsWith, string.endsWith and substring? Because it's faster this way and you can't have weird patterns in the message. Maybe I'm wrong...

Usage

Simply require it and add it to bot's plugins.

const mineflayer = require("mineflayer");
const chatReactor  = require("vas-chat-reactor");
const bot = mineflayer.createBot({
	"host": "HOST",
	"port": 25565,
	"username": "USERNAME",
	"password": "PASSWORD",
	"plugins": [chatReactor],

});

Or, if you prefer:

// Bot is already created here
require("vas-chat-reactor")(bot);

And then:

bot.enableChatReaction();

And if you want to disable it on the fly:

bot.disableChatReaction();

Additionally, if you want to see debug information, you can set the _DEBUG variable on row 16 of index.js to true.

Test coverage

To test it simply run npm test.

> npm test

> [email protected] test /home/ubuntu/workspace/git/vas-chat-reactor
> mocha



  vas-chat-reactor
    Load plugin
      ✓ should load events
      ✓ should add functions to the bot
      ✓ should not crash on message event


  3 passing (23ms)

License

This plugin is distributed under Apache 2.0. See LICENSE.

Additional details

Contact

If you have any problems, contact me and I will try to help you. You can find me here.