You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Endpoint do ruchu
app.post('/move', (req, res) => {
const { x, y, z } = req.body;
if (!bot) {
return res.status(400).send('Bot nie jest zalogowany.');
}
taskQueue.push(() => {
const goal = new goals.GoalBlock(x, y, z);
bot.pathfinder.setGoal(goal);
});
res.send(Ruch do (${x}, ${y}, ${z}) dodany do kolejki.);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey, I have this problem where when the bot clicks on an NPC, it doesn't transfer him to another world
scrypts:
server.js
const express = require('express');
const mineflayer = require('mineflayer');
const { pathfinder, Movements, goals } = require('mineflayer-pathfinder');
const bodyParser = require('body-parser');
const app = express();
let bot;
let taskQueue = []; // Kolejka zadań
let loginPassword = ''; // Hasło do logowania
app.use(bodyParser.json());
app.use(express.static('public'));
// Endpoint konfiguracji bota
app.post('/configure', (req, res) => {
const { host, port, username, password, version } = req.body;
});
// Endpoint do ruchu
app.post('/move', (req, res) => {
const { x, y, z } = req.body;
});
// Endpoint kliknięcia
app.post('/click', (req, res) => {
const { action, holdTime } = req.body;
});
// Rozpoczęcie zadań
app.post('/start', (req, res) => {
if (!bot) {
return res.status(400).send('Bot nie jest zalogowany.');
}
});
app.listen(3000, () => console.log('Serwer działa na porcie 3000'));
bot.js
const mineflayer = require('mineflayer');
const { pathfinder, Movements, goals } = require('mineflayer-pathfinder');
let bot;
function createBot(options) {
if (bot) {
bot.quit(); // Rozłącz poprzedniego bota
}
}
function moveToCoordinates(x, y, z) {
if (!bot) {
console.error('Bot nie jest połączony!');
return;
}
}
module.exports = { createBot, moveToCoordinates };
index.html
<title>Bot Minecrafta</title> <style> body { background-color: #121212; color: white; font-family: Arial, sans-serif; margin: 0; padding: 0; }Bot Minecrafta
Beta Was this translation helpful? Give feedback.
All reactions