Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let bot = mineflayer.createBot({
- host: `${serverip}`,
- port: "25565",
- username: " ",
- password: " ",
- version:"1.8.8",
- });
- var chat = "";
- let ftop1 = "-";
- let ftop2 = "-";
- let ftop3 = "-";
- let ftop4 = "-";
- let ftop5 = "-";
- let ftop6 = "-";
- let ftop7 = "-";
- let ftop8 = "-";
- let ftop9 = "-";
- let ftop0 = "-";
- let fw1 = "-";
- let fw2 = "-";
- let fw3 = "-";
- let fw4 = "-";
- let fw5 = "-";
- let fw6 = "-";
- let fw7 = "-";
- let fw8 = "-";
- let fw9 = "-";
- let online = [""];
- let x = (online) => online.filter((v,i) => online.indexOf(v) === i)
- function empty() {
- online = [""];
- }
- bot.on('message', (message)=>{
- chat = `${message}`
- let rdy = "no";
- if(chat.startsWith("[")) {
- rdy = "yes"
- }
- else {rdy = "no"}
- if(chat.includes("@")) return
- if(chat.includes("`")) return
- if(chat.includes(`{`)) return
- if(chat.startsWith("1.")) {ftop1 = chat}
- if(chat.startsWith("2.")) {ftop2 = chat}
- if(chat.startsWith("3.")) {ftop3 = chat}
- if(chat.startsWith("4.")) {ftop4 = chat}
- if(chat.startsWith("5.")) {ftop5 = chat}
- if(chat.startsWith("6.")) {ftop6 = chat}
- if(chat.startsWith("7.")) {ftop7 = chat}
- if(chat.startsWith("8.")) {ftop8 = chat}
- if(chat.startsWith("9.")) {ftop9 = chat}
- if(chat.startsWith("10.")) {ftop0 = chat}
- if(chat.startsWith("_________________")) {fw1 = chat}
- if(chat.startsWith("Description:")) {fw2 = chat}
- if(chat.startsWith("Age:")) {fw3 = chat}
- if(chat.startsWith("Warnings:")) {fw4 = chat}
- if(chat.startsWith("Bans / Mutes:")) {fw5 = chat}
- if(chat.startsWith("Land / Power / Maxpower:")) {fw6 = chat}
- if(chat.startsWith("Total Worth:")) {fw7 = chat}
- if(chat.startsWith("Bank:")) {fw8 = chat}
- if(chat.startsWith("Followers Online")) {fw9 = chat}
- if(chat.includes(" | ")) {
- online.push(chat)
- }
- if(serverchat1 == `true` && rdy == "yes") {
- client.channels.get("542966141572743170").send("`" + chat + "`");
- rdy = "no"
- }
- });
- client.on("message", async (message) => {
- if(message.content.startsWith(prefix + "testa")) {
- console.log(x(online))
- }
- if(message.content.toLowerCase().startsWith(prefix + "fwho")) {
- let messageArray = message.content.split(" ");
- let cmd = messageArray[0];
- let args = messageArray.slice(1);
- let nofac = new Discord.RichEmbed()
- .setColor(errc)
- .setTitle(`:warning: **MISSING ARGS**`)
- .setDescription("You are missing some arguments." + "\n" + " " + "\n" + "**Correct Syntax:** " + "`" + `${prefix}fwho <faction>` + "`")
- .setFooter(message.author.tag, message.author.avatarURL);
- let getting = new Discord.RichEmbed()
- .setColor(red)
- .setDescription(`Please wait one second as I request that from the server.`)
- let nofaction = new Discord.RichEmbed()
- .setColor(errc)
- .setDescription(`The requested faction "${args[0]}" could't be found. The fac`)
- if(!args[0]) return message.channel.send(nofac)
- let cmda = `/f who ${args[0]}`
- bot.chat(cmda)
- const fetch = message.channel.send(getting).then(msg => msg.delete(200))
- await fetch
- let f1 = fw1.split(" ");
- let ww1 = f1.slice(1);
- let ww2 = fw2.slice(12);
- let ww3 = fw3.slice(5);
- let f4 = fw4.split(" ");
- let ww4 = f4.slice(1);
- let f5 = fw5.split(" ");
- let ww5 = f5.slice(1);
- let f6 = fw6.split(" ");
- let ww6 = f6.slice(1);
- let f7 = fw7.split(" ");
- let ww7 = f7.slice(1);
- let f8 = fw8.split(" ");
- let ww8 = f8.slice(1);
- let f9 = fw9.split(" ");
- let ww9 = f9.slice(1);
- let www9 = ww9[1].replace("(", "")
- let www10 = www9.replace(")", "")
- let www11 = www10.replace(":", "")
- let onlinea = "";
- if(www11 == "8") {onlinea = `${online[1]}\n${online[2]}\n${online[3]}`}
- if(www11 == "9") {onlinea = `${online[1]}\n${online[2]}\n${online[3]}`}
- if(www11 == "10") {onlinea = `${online[1]}\n${online[2]}\n${online[3]}`}
- if(www11 == "11") {onlinea = `${online[1]}\n${online[2]}\n${online[3]}`}
- let fwho = new Discord.RichEmbed()
- .setColor(red)
- .setTitle(`F Who - ${ww1[0]}`)
- .setDescription(`**Description:** ${ww2}\n \n**Age:** ${ww3}\n \n**Bans/Mutes:** ${ww5[2]}/${ww5[4]}\n \n**Warnings:** ${ww4[0]}\n \n**Value:** ${ww1[1]} ${ww7[1]}\n \n**Bank:** ${ww8[0]}\n \n**Land/Power/Maxpower:** ${ww6[4]}/${ww6[6]}/${ww6[8]}\n \n `)
- .addField(`** **`, `**${www11} member(s) online** ยป ` + "```" + `${onlinea}` + "```")
- .setFooter(`Factions Bot | Made By BestBearr`);
- return message.channel.send(fwho)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement