-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
59 lines (46 loc) · 1.32 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
const express = require("express")
const app = express()
app.get("/", (req, res) => {
res.send("Aternos 7/24 Uptime")
})
app.listen(3000, () => {
console.log("Project is ready!")
})
var mineflayer = require('mineflayer');
var pass = "12345"; //Authme plugini þifresi (Plugin yoksa silmeyin)
var ayar = {
host: "sunucuip", //Sunucunuzun ipsi
port: 25565, //Değiştirme
username: "bot1", //Sunucuya Gircek Olan Bot
version: false //Değiştirme
};
var bot = mineflayer.createBot(ayar);
bot.on('chat', function(username, message) {
if (username === bot.username) return;
function intervalFunc() {
bot.setControlState('forward', true)
}
setInterval(intervalFunc, 7000);
console.log('Sunucuya Giriş Yapıldı!');
bot.chat('/login ' + pass);
});
bindEvents(bot);
function bindEvents(bot) {
bot.on('error', function(err) {
console.log("Bir Hata Oluştu!");
});
bot.on('end', function() {
console.log("Bot sunucudan atıldı!");
setTimeout(relog, 5000);
});
function relog() {
console.log("Sunucuya tekrardan bağlanılıyor");
bot = mineflayer.createBot(ayar);
bot.on('chat', function(username, message) {
if (username === bot.username) return;
console.log("Bot tekrardan sunucuya Giriş yaptı!");
bot.chat('/login ' + pass);
});
bindEvents(bot);
}
}