Spaces:
Paused
Paused
Update index.js
Browse files5 unmodified lines678910111213141516173 unmodified lines212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021 unmodified line1041051061071081091101111121131145 unmodified linesconst hf = new HfInference(process.env.HF_TOKEN);const app = express();app.get('/', (req, res) => res.send('German Rage Bot: In Queue... 🇩🇪🔥'));app.listen(7860);const bot = mineflayer.createBot({host: 'nasi.lemak.xyz',username: 'German_Rage_Bot',auth: 'offline',version: '1.21'});3 unmodified lines// --- THE GERMAN RAGE AI ---async function getGermanTrashTalk(victim, type) {const prompt = `Context: Minecraft PVP. Situation: ${type} ${victim}.Task: Write a 1-sentence, EXTREMELY ANNOYING, toxic, and aggressive trash talk in FULL GERMAN.Use gamer slang like 'Lauch', 'Hund', 'Opfer', 'geh heulen'. Be the ultimate toxic German player. No hashtags.`;try {const out = await hf.chatCompletion({model: "meta-llama/Llama-3.2-1B-Instruct",messages: [{ role: "user", content: prompt }],max_tokens: 40});return out.choices[0].message.content.trim().replace(/"/g, '');} catch (e) {return "GEH HEULEN DU LAUCH! 😂🇩🇪";}}bot.on('spawn', () => {console.log("Joined Lobby. Starting Login & Compass Bypass...");// 1. AUTHENTICATIONsetTimeout(() => {bot.chat('/register GermanPass99 GermanPass99');bot.chat('/login GermanPass99');// 2. COMPASS SELECTOR LOGICsetTimeout(() => {const compass = bot.inventory.items().find(item => item.name.includes('compass'));if (compass) {bot.activateItem(); // Right-click the compassconsole.log("Compass activated. Searching for Survival...");}}, 3000);}, 2000);// 3. WINDOW/GUI INTERACTIONbot.on('windowOpen', async (window) => {console.log("Server Selector Opened.");// Find the item named "Survival"const survivalItem = window.slots.find(slot => slot && slot.nbt && JSON.stringify(slot.nbt).includes('Survival'));if (survivalItem) {console.log("Survival found! Clicking...");bot.clickWindow(survivalItem.slot, 0, 0);} else {// If it can't find by NBT, click slot 10 or 12 (common survival slots)bot.clickWindow(12, 0, 0);}});const mcData = require('minecraft-data')(bot.version);bot.pathfinder.setMovements(new Movements(bot, mcData));});// --- SURVIVAL BEHAVIOR (The Rage) ---setInterval(async () => {// Only act if we aren't in the lobby anymore (check distance from 0,0 or server name)const target = bot.nearestEntity(e =>e.type === 'player' && e.username !== bot.username &&bot.entity.position.distanceTo(e.position) < 15);if (target) {// Provoke in German before attackingif (Math.random() > 0.95) {const rage = await getGermanTrashTalk(target.username, "provoking");bot.chat(rage);}bot.pvp.attack(target);} else if (!bot.pathfinder.isMoving()) {const x = bot.entity.position.x + (Math.random() * 30 - 15);const z = bot.entity.position.z + (Math.random() * 30 - 15);bot.pathfinder.setGoal(new goals.GoalNear(x, bot.entity.position.y, z, 1));}}, 2000);// --- GERMAN KILL/DEATH EVENTS ---bot.on('entityDead', async (entity) => {if (bot.pvp.target === entity) {const rage = await getGermanTrashTalk(entity.username || "Opfer", "killed");1 unmodified line}});bot.on('death', async () => {const rage = await getGermanTrashTalk("hacker", "died and making an excuse");bot.chat(rage);bot.respawn();});bot.on('error', (err) => console.log("Bot Error:", err.message));bot.on('end', () => process.exit(1));5 unmodified lines678910111213141516173 unmodified lines212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071 unmodified line1091101111121131145 unmodified linesconst hf = new HfInference(process.env.HF_TOKEN);const app = express();app.get('/', (req, res) => res.send('German Rage Bot: Bereit zum Kampf! 🇩🇪🔥'));app.listen(7860);const bot = mineflayer.createBot({host: 'nasi.lemak.xyz',username: 'Deutsch_Zerstorer',auth: 'offline',version: '1.21'});3 unmodified lines// --- THE GERMAN RAGE AI ---async function getGermanTrashTalk(victim, type) {const prompt = `Context: Minecraft PVP. Situation: ${type} ${victim}. Task: Write 1 short, extremely toxic sentence in FULL GERMAN. Use insults like 'Lauch', 'Opfer', 'Hund'. Be very annoying. No hashtags.`;try {const out = await hf.chatCompletion({model: "meta-llama/Llama-3.2-1B-Instruct",messages: [{ role: "user", content: prompt }],max_tokens: 35});return out.choices[0].message.content.trim().replace(/"/g, '');} catch (e) { return "GEH HEULEN DU LAUCH! 😂"; }}bot.on('spawn', () => {console.log("Spawned! Handling Login & Compass...");// Fix: Using the correct physicsTick event to avoid deprecation warningbot.on('physicsTick', () => {// Internal logic for movement updates});// 1. AUTHENTICATIONsetTimeout(() => {bot.chat('/register GermanPass99 GermanPass99');bot.chat('/login GermanPass99');// 2. COMPASS SELECTORsetTimeout(() => {const compass = bot.inventory.items().find(item => item.name.includes('compass'));if (compass) {bot.activateItem();console.log("Compass used. Waiting for GUI...");} else {// Fallback if no compass in handbot.setQuickBarSlot(0);bot.activateItem();}}, 4000);}, 3000);});// 3. GUI HANDLING (SURVIVAL SELECTION)bot.on('windowOpen', async (window) => {console.log("Lobby Menu opened.");// Look for "Survival" in the windowconst survivalSlot = window.slots.find(slot => slot && slot.nbt && JSON.stringify(slot.nbt).toLowerCase().includes('survival'));if (survivalSlot) {console.log(`Found Survival at slot ${survivalSlot.slot}. Joining queue...`);bot.clickWindow(survivalSlot.slot, 0, 0);} else {console.log("Survival not found in NBT, clicking default slot 12...");bot.clickWindow(12, 0, 0);}});// --- COMBAT & ROAMING LOOP ---setInterval(async () => {// SAFETY CHECK: Ensure bot.entity exists to prevent the 'position' crashif (!bot.entity || !bot.entity.position) return;const target = bot.nearestEntity(e =>e.type === 'player' && e.username !== bot.username &&bot.entity.position.distanceTo(e.position) < 15);if (target) {if (Math.random() > 0.96) {const rage = await getGermanTrashTalk(target.username, "provocation");bot.chat(rage);}bot.pvp.attack(target);} else if (!bot.pathfinder.isMoving()) {// Roaming logicconst x = bot.entity.position.x + (Math.random() * 20 - 10);const z = bot.entity.position.z + (Math.random() * 20 - 10);const mcData = require('minecraft-data')(bot.version);bot.pathfinder.setMovements(new Movements(bot, mcData));bot.pathfinder.setGoal(new goals.GoalNear(x, bot.entity.position.y, z, 1));}}, 3000);// --- EVENTS ---bot.on('entityDead', async (entity) => {if (bot.pvp.target === entity) {const rage = await getGermanTrashTalk(entity.username || "Opfer", "killed");1 unmodified line}});bot.on('death', () => bot.respawn());bot.on('error', (err) => console.log("Bot Error:", err.message));bot.on('end', () => process.exit(1));
index.js+48-48