Code
(async () => {
const bots = [];
const botCount = ; // Kaç bot bağlanacağı
const serverUrl = "wss://sin-a.wormate.io:31764/wormy"; // 🌍 SABİT SUNUCU URL
const botName = "TestBot"; // Botların ismi
// ✅ Token ve bağlantı verisi al (Ama sabit sunucuya bağlan)
const fetchGameToken = async () => {
const response = await fetch(
"https://gateway.wormate.io/pub/wuid/guest/start?gameMode=ARENA&gh=0&nickname=TEST&skinId=33",
{
method: "GET",
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
"Origin": "https://wormate.io",
},
}
);
if (!response.ok) {
throw new Error("Token alınamadı.");
}
const data = await response.json();
return data.token; // 🎯 Sadece token al
};
// 🚀 Botları Bağlama
const connectBotsToServer = async () => {
for (let i = 0; i < botCount; i++) {
try {
const token = await fetchGameToken(); // ✅ HER BOT İÇİN TOKEN AL
const ws = new WebSocket(serverUrl);
ws.onopen = () => {
console.log(`✅ Bot ${botName}_${i + 1} bağlandı -> ${serverUrl}`);
ws.send(
JSON.stringify({
action: "join",
nickname: `${botName}_${i + 1}`,
token: token, // ✅ Dinamik token kullan
skinId: 12583,
eyesId: 20419,
mouthId: 5,
glassesId: 0,
hatId: 20705,
})
);
// 🔥 "startgame" gönder (Eğer gerekiyorsa)
setTimeout(() => {
ws.send(
JSON.stringify({
action: "startgame",
})
);
}, 1000);
};
ws.onmessage = (event) => {
console.log(`📩 Bot ${botName}_${i + 1}: Sunucudan mesaj ->`, event.data);
// Eğer sunucu "startgame" bekliyorsa buradan gönder
if (event.data.includes("waiting")) {
ws.send(
JSON.stringify({
action: "startgame",
})
);
}
};
ws.onerror = (err) =>
console.error(`❌ Bot ${botName}_${i + 1}: WebSocket hatası ->`, err.message);
ws.onclose = () =>
console.log(`❌ Bot ${botName}_${i + 1} bağlantısı kapatıldı.`);
bots.push(ws);
} catch (error) {
console.error(`❌ Bot ${botName}_${i + 1} bağlantı hatası:`, error);
}
// 🕒 Botlar arasında gecikme (DDoS gibi görünmemesi için)
await new Promise((resolve) => setTimeout(resolve, 100));
}
};
// 🚀 Botları başlat
console.log("⚡ Bot bağlantıları başlatılıyor...");
await connectBotsToServer();
})();
Public Last updated: 2025-05-13 04:56:06 AM