async function aHuntBot() { if (global.captchaDetected) return; global.channel.sendTyping(); await sleep(randomInt(180, 1300)); if (global.captchaDetected) return; if (Date.now() - hbTimeout > randomInt(1800, 1860) * 1000) { hbTimeout = Date.now(); global.channel.send(osac); log(osac); global.totalcmd++; global.channel.sendTyping(); await sleep(randomInt(2000, 4800)); global.channel.send(ohb); log(ohb); global.totalcmd++; const filter1 = msg => msg.author.id === global.owoID && msg.embeds.length && msg.embeds[0]?.author?.name?.includes("'s HuntBot") && msg.embeds[0]?.author?.name?.includes(msg.guild.members.me.displayName) const collector1 = global.channel.createMessageCollector({filter1, time: 15_000}); collector1.on("collect", async (message) => { if (message.author.id === global.owoID && message.embeds.length && message.embeds[0]?.author?.name?.includes("'s HuntBot")) { if (!message.embeds[0].fields[0].value.includes("MAX")) { trait = "efficiency"; } else if (!message.embeds[0].fields[1].value.includes("MAX")) { trait = "duration"; } else if (!message.embeds[0].fields[2].value.includes("MAX")) { trait = "cost"; } else if (!message.embeds[0].fields[3].value.includes("MAX")) { trait = "gain"; } else if (!message.embeds[0].fields[4].value.includes("MAX")) { trait = "experience"; } if (trait) { global.channel.sendTyping(); await sleep(randomInt(2000, 4800)); global.channel.send(`${oupg} ${trait} all`); log(`${oupg} ${trait} all`) global.totalcmd++; } }); const filter2 = msg => msg.author.id === global.owoID && msg.embeds.length && msg.embeds[0]?.author?.name?.includes("'s HuntBot") && msg.embeds[0]?.author?.name?.includes(msg.guild.members.me.displayName) const collector2 = global.channel.createMessageCollector({filter2, time: 15_000}); collector1.on("collect", async (message) => { if (message.author.id === global.owoID && message.embeds.length && message.embeds[0]?.author?.name?.includes("'s HuntBot") && message.embeds[0].fields[7]) { const regex = /(\d+) cowoncy/; const value = message.embeds[0]?.fields[7]?.value; const match = value.match(regex); global.cowoncy = match ? parseInt(match[1], 10) : null; global.channel.sendTyping(); await sleep(randomInt(2000, 4800)); global.channel.send(`${oah} ${global.cowoncy}`); log(`${oah} ${global.cowoncy}`); global.totalcmd++; } else { log("Yeterli cowoncy'e sahip olmadığınızdan autohunt çalıştırılamadı.") } }); const filter3 = msg => msg.author.id === global.owoID && msg.content.includes(msg.guild.members.me.displayName) && msg.content.match("Here is your password!"); const collector3 = global.channel.createMessageCollector({filter, time: 15_000}); collector3.on("collect", async (message) => { try { var attempt = await solveCaptcha(message.attachments.first().url); if(!attempt || attempt.match(/\d/)) { log("Captcha çözme sistemi geri dönüyor: " + attempt, "i"); throw new Error(); } await sleep(randomInt(4000, 12000)); await global.channel.send(`${oah} ${global.cowoncy} ${attempt}`); const filter = msg => msg.author.id === global.owoID && msg.content.includes(msg.guild.members.me.displayName) && msg.content.match(/I WILL BE BACK/); const collector = global.channel.createMessageCollector({filter, max: 1, time: 15_000}); collector.on("collect", async msg => { log(`${oah} ${global.cowoncy} ${attempt}`); global.totalcmd++; }) } catch (error) { log("Captcha çözme denemesi başarısız oldu.", "e"); log(error); return await notify(message); } }); } }