Tencentbot 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Tencentbot/__init__.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import subprocess
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
bot = "normal"
|
|
6
|
+
version = "all"
|
|
7
|
+
botsayi = "1"
|
|
8
|
+
ip = "127.0.0.1"
|
|
9
|
+
botname = "Tencent"
|
|
10
|
+
|
|
11
|
+
def terminalpvp_end():
|
|
12
|
+
global bot
|
|
13
|
+
bot = "pvp"
|
|
14
|
+
|
|
15
|
+
def start(mode_type):
|
|
16
|
+
global version, botsayi, ip, botname
|
|
17
|
+
|
|
18
|
+
current_dir = os.path.dirname(__file__)
|
|
19
|
+
js_path = os.path.join(current_dir, "bot_core.js")
|
|
20
|
+
|
|
21
|
+
print(f"[Tencentbot] Motor başlatılıyor... Mod: {mode_type} | Sürüm: {version} | Bot Sayısı: {botsayi}")
|
|
22
|
+
print("[Tencentbot] Sunucuya bağlanılıyor, lütfen bekleyin...")
|
|
23
|
+
|
|
24
|
+
if not os.path.exists(os.path.join(current_dir, "node_modules")):
|
|
25
|
+
print("[!] İlk çalıştırma için Node.js bağımlılıkları yükleniyor...")
|
|
26
|
+
subprocess.run("npm install mineflayer mineflayer-pathfinder mineflayer-pvp", shell=True, cwd=current_dir)
|
|
27
|
+
|
|
28
|
+
try:
|
|
29
|
+
process = subprocess.Popen(
|
|
30
|
+
["node", js_path, mode_type, str(version), str(ip), str(botname), str(botsayi)],
|
|
31
|
+
stdin=sys.stdin,
|
|
32
|
+
stdout=sys.stdout,
|
|
33
|
+
stderr=sys.stderr
|
|
34
|
+
)
|
|
35
|
+
process.wait()
|
|
36
|
+
except KeyboardInterrupt:
|
|
37
|
+
print("\n[X] Botlar kapatıldı.")
|
Tencentbot/bot_core.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const mineflayer = require('mineflayer');
|
|
2
|
+
const { pathfinder, Movements, goals } = require('mineflayer-pathfinder');
|
|
3
|
+
const pvp = require('mineflayer-pvp').plugin;
|
|
4
|
+
const readline = require('readline');
|
|
5
|
+
|
|
6
|
+
const args = process.argv.slice(2);
|
|
7
|
+
const botMode = args[0];
|
|
8
|
+
const version = args[1];
|
|
9
|
+
const ipStr = args[2];
|
|
10
|
+
const botNameInput = args[3];
|
|
11
|
+
const botCount = parseInt(args[4]) || 1;
|
|
12
|
+
|
|
13
|
+
const [host, port] = ipStr.split(':');
|
|
14
|
+
|
|
15
|
+
for (let i = 0; i < botCount; i++) {
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
createBot(i);
|
|
18
|
+
}, i * 2000);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function createBot(index) {
|
|
22
|
+
const bot = mineflayer.createBot({
|
|
23
|
+
host: host,
|
|
24
|
+
port: port ? parseInt(port) : 25565,
|
|
25
|
+
username: `${botNameInput}_${index}`,
|
|
26
|
+
version: version === "all" ? false : version
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
bot.loadPlugin(pathfinder);
|
|
30
|
+
bot.loadPlugin(pvp);
|
|
31
|
+
|
|
32
|
+
bot.on('spawn', () => {
|
|
33
|
+
console.log(`[+] ${bot.username} sunucuya başarıyla katıldı!`);
|
|
34
|
+
if (botMode === "pvp") {
|
|
35
|
+
if (index === 0) startPvpTerminal(bot);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
bot.on('physicsTick', () => {
|
|
40
|
+
if (botMode === "pvp" && global.targetPlayer) {
|
|
41
|
+
const target = bot.nearestEntity(entity => entity.username === global.targetPlayer);
|
|
42
|
+
if (target) {
|
|
43
|
+
bot.lookAt(target.position.offset(0, target.height, 0));
|
|
44
|
+
if (bot.entity.onGround) {
|
|
45
|
+
bot.setControlState('jump', true);
|
|
46
|
+
} else {
|
|
47
|
+
bot.setControlState('jump', false);
|
|
48
|
+
bot.pvp.attack(target);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
bot.on('kicked', (reason) => console.log(`[-] Bot atıldı: ${reason}`));
|
|
55
|
+
bot.on('error', (err) => console.log(`[!] Hata oluştu: ${err.message}`));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function startPvpTerminal(bot) {
|
|
59
|
+
const rl = readline.createInterface({
|
|
60
|
+
input: process.stdin,
|
|
61
|
+
output: process.stdout
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
rl.question('\n[🎯] Saldırılacak oyuncunun adını yazın: ', (answer) => {
|
|
65
|
+
console.log(`[⚔️] Tüm botlar ${answer} isimli oyuncuya kilitlendi!`);
|
|
66
|
+
global.targetPlayer = answer;
|
|
67
|
+
rl.close();
|
|
68
|
+
});
|
|
69
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
Tencentbot/__init__.py,sha256=Spb4KcJ002UNyubb_4HXM8tP4VXzp9LdYHJ3lNvbYcY,1188
|
|
2
|
+
Tencentbot/bot_core.js,sha256=wSoAX-t6JXt6oLpfN1LD8IqSA3iKLc8uYNeiWrqmZRo,2230
|
|
3
|
+
tencentbot-1.0.0.dist-info/METADATA,sha256=ocRJcFcTKQyr4yfxwKMZNK5-SJMyO1OxuVNYugfZzBA,201
|
|
4
|
+
tencentbot-1.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
5
|
+
tencentbot-1.0.0.dist-info/top_level.txt,sha256=MTGaejCSlmC7UAA5PNX-2KLPUTjYs2v2WV7ymJ1r8Gs,11
|
|
6
|
+
tencentbot-1.0.0.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Tencentbot
|