Maks-gaming / mineflayer-plasmovoice

A lightweight plugin for Mineflayer that allows use VoiceChat for PlasmoVoice plugin
MIT License
19 stars 2 forks source link

How do I get a bot to talk? #13

Closed xNeizy closed 1 year ago

xNeizy commented 1 year ago

I want to play soundtrack with bot help, is it possible to implement this somehow using plasmovoice? The track is in the same file with the script: "music.mp3"

xNeizy commented 1 year ago

I tried using this library, took the sample code and inserted it. But when logging on to the server, the bot had headphones with an exclamation mark over his head, which meant that he did not have plasmovoice. I installed the plasmovoice plugin on the local server, it does not work. I tried to install it as a mod, it didn't help either... Code:

const mineflayer = require("mineflayer")
const plasmo = require("mineflayer-plasmovoice")

const bot = mineflayer.createBot({
    "host": "New_2023x8y9.aternos.me",
    "username": "Bot"
})

bot.loadPlugin(plasmo.plugin)

bot.on("voicechat_connected", () => {
    bot.setControlState("sneak", true)

    // Path to file with any audio format
    bot.plasmovoice.SendAudio("music.mp3")
})

bot.on("voicechat_audio_end", () => {
    bot.setControlState("sneak", false)
})
Maks-gaming commented 1 year ago

1) try using bot.plasmovoice.sendAudio("music.mp3") instead bot.plasmovoice.SendAudio("music.mp3") since I'm currently transitioning to plasmovoice 2.0, some things have changed 2) this plugin does not support aternos.org p.s: dont remember to install ffmpeg

xNeizy commented 1 year ago

how to install ffmpeg ? I just threw the ffmpeg folder into the project folder. как установить ffmpeg ? Я просто закинул папку ffmpeg в папку с проектом.