Spaces:
Paused
Paused
Update index.js
Browse files4 unmodified lines5678910112 unmodified lines1415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384854 unmodified linesconst hf = new HfInference(process.env.HF_TOKEN);const app = express();app.get('/', (req, res) => res.send('The Couple is exploring Zetrex.net! 🏛️🚶♂️'));app.listen(7860);const memories = { sweetily: [], aprenda: [] };2 unmodified linestry {const out = await hf.chatCompletion({model: "meta-llama/Llama-3.2-1B-Instruct",messages: [{ role: "user", content: `Character: ${name}. Partner: ${partner}. Persona: ${persona}. Context: Exploring Zetrex server. Msg: ${msg}. 1 short Taglish sentence.` }],max_tokens: 30});return out.choices[0].message.content.trim();} catch (e) { return "Ang ganda naman dito sa Zetrex! ✨"; }}function createBot(name, partnerName, isLeader, delay = 0) {setTimeout(() => {const bot = mineflayer.createBot({host: 'zetrex.net',username: name,auth: 'offline',version: false,checkTimeoutInterval: 120000});bot.loadPlugin(pathfinder);bot.on('spawn', () => {console.log(`${name} spawned in Zetrex!`);const mcData = require('minecraft-data')(bot.version);bot.pathfinder.setMovements(new Movements(bot, mcData));// Standard AuthsetTimeout(() => {bot.chat(`/register CouplePass123 CouplePass123`);bot.chat(`/login CouplePass123`);}, 3000);// --- ROAMING LOGIC ---setInterval(() => {const partner = bot.players[partnerName]?.entity;if (isLeader) {// BOYFRIEND: Wanders slowly to exploreif (!bot.pathfinder.isMoving()) {const rx = bot.entity.position.x + (Math.random() * 12 - 6);const rz = bot.entity.position.z + (Math.random() * 12 - 6);bot.pathfinder.setGoal(new goals.GoalNear(rx, bot.entity.position.y, rz, 1));}} else if (partner) {// GIRLFRIEND: Stays very close (0.5 to 1.5 blocks)bot.pathfinder.setGoal(new goals.GoalFollow(partner, 1), true);}}, 3000);});bot.on('chat', async (username, message) => {if (username === partnerName) {const p = isLeader ? "Chilled Leader BF" : "Shy Follower GF";const reply = await chatAI(name, partnerName, p, message);setTimeout(() => bot.chat(reply), 4000);}});bot.on('end', (reason) => {console.log(`${name} left: ${reason}. Reconnecting...`);setTimeout(() => createBot(name, partnerName, isLeader, 0), 20000);});bot.on('error', (err) => console.log(`${name} Error:`, err));}, delay);}// Start the DuocreateBot('sweetily', 'aprenda', false, 0);createBot('aprenda', 'sweetily', true, 25000); // Wait 25s for BF to join4 unmodified lines5678910112 unmodified lines141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485864 unmodified linesconst hf = new HfInference(process.env.HF_TOKEN);const app = express();app.get('/', (req, res) => res.send('Duo is waiting for the Wall to clear... 🧱💤'));app.listen(7860);const memories = { sweetily: [], aprenda: [] };2 unmodified linestry {const out = await hf.chatCompletion({model: "meta-llama/Llama-3.2-1B-Instruct",messages: [{ role: "user", content: `Char: ${name}. Partner: ${partner}. Context: Zetrex. Msg: ${msg}. 1 short Taglish sentence.` }],max_tokens: 30});return out.choices[0].message.content.trim();} catch (e) { return "Bakit ang hirap pumasok? 😅"; }}function createBot(name, partnerName, isLeader, delay = 0) {setTimeout(() => {console.log(`[STAYING STEALTH] Attempting to bypass wall for ${name}...`);const bot = mineflayer.createBot({host: 'zetrex.net',username: name,auth: 'offline',version: false,// Mimic a slow residential connectioncheckTimeoutInterval: 150000,connectTimeout: 60000});bot.loadPlugin(pathfinder);bot.on('spawn', () => {console.log(`${name} bypassed the check! ✨`);// Random jitter to look humanconst jitter = Math.floor(Math.random() * 5000) + 2000;setTimeout(() => {bot.chat(`/register CouplePass123 CouplePass123`);bot.chat(`/login CouplePass123`);// Move slightly so the server sees activitybot.setControlState('forward', true);setTimeout(() => bot.setControlState('forward', false), 500);}, jitter);const mcData = require('minecraft-data')(bot.version);bot.pathfinder.setMovements(new Movements(bot, mcData));// RoamingsetInterval(() => {const partner = bot.players[partnerName]?.entity;if (isLeader) {if (!bot.pathfinder.isMoving()) {const rx = bot.entity.position.x + (Math.random() * 6 - 3);const rz = bot.entity.position.z + (Math.random() * 6 - 3);bot.pathfinder.setGoal(new goals.GoalNear(rx, bot.entity.position.y, rz, 1));}} else if (partner) {bot.pathfinder.setGoal(new goals.GoalFollow(partner, 1), true);}}, 5000);});bot.on('end', (reason) => {console.log(`${name} rejected by wall: ${reason}. Waiting 1 minute...`);// If we hit a wall, wait a full minute to let the IP "cool down"setTimeout(() => createBot(name, partnerName, isLeader, 0), 60000);});bot.on('error', (err) => console.log(`Stealth Error: ${err.message}`));}, delay);}// Massive delay between joins to avoid triggering the "Bot-Net" firewallcreateBot('sweetily', 'aprenda', false, 0);createBot('aprenda', 'sweetily', true, 60000); // Wait 1 FULL MINUTE before BF joins
index.js+30-29