-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
79 lines (64 loc) · 2.35 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//---------------------------------------------------------------------
// Glitch 24/7 /// by xJinMori
// https://www.youtube.com/c/xJinMori
//---------------------------------------------------------------------
const express = require("express");
const http = require("http");
const app = express();
app.use(express.json());
app.get("/", (_, res) => res.sendFile(__dirname + "/index.html"));
app.listen(process.env.PORT);
setInterval(() => {
http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 224000);
// End of Glitch 24/7
const mineflayer = require("mineflayer");
//the config
const bot = mineflayer.createBot({
host: "DelawareYT.aternos.me", //Coloca entre las comillas, tu ip
port: 25565, //puerto del servidor
username: "UnMAMAGUEVO", //nombre del bot (CAMBIAR)
version: false //version of the server (false = auto detect)
});
bot.on("move", function() {
//triggers when the bot moves
bot.setControlState("jump", true); //continuously jumps
setTimeout(() => {
//sets a delay
bot.setControlState("jump", false); //stops jumping
}, 1000); //delay time
setTimeout(() => {
//sets a delay
bot.setControlState("forward", true); //continuously walks forward
setTimeout(() => {
//sets a delay
bot.setControlState("forward", false); //stops walking forward
}, 500); //delay time
}, 1000); //delay time
setTimeout(() => {
//sets a delay
bot.setControlState("back", true); //continuously walks backwards
setTimeout(() => {
//sets a delay
bot.setControlState("back", false); //stops walking backwards
}, 500); //delay time
}, 2000); //delay time
setTimeout(() => {
//sets a delay
bot.setControlState("right", true); //continuously walks right
setTimeout(() => {
//sets a delay
bot.setControlState("right", false); //stops walking right
}, 2000); //delay time
}, 500); //delay time
setTimeout(() => {
//sets a delay
bot.setControlState("left", true); //continuously walks lefz
setTimeout(() => {
//sets a delay
bot.setControlState("left", false); //stops walking left
}, 2000); //delay time
}, 500); //delay time
});
bot.on("end", () => bot()); //riggers when the bot leaves/gets kicked and create a new bot from the config
bot.on("error", err => console.log(err)); //triggers when there's an error and logs it into console