Advertisement
Guest User

Untitled

a guest
Feb 27th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.54 KB | None | 0 0
  1. let bot = mineflayer.createBot({
  2. host: `${serverip}`,
  3. port: "25565",
  4. username: " ",
  5. password: " ",
  6. version:"1.8.8",
  7. });
  8.  
  9. var chat = "";
  10.  
  11. let ftop1 = "-";
  12. let ftop2 = "-";
  13. let ftop3 = "-";
  14. let ftop4 = "-";
  15. let ftop5 = "-";
  16. let ftop6 = "-";
  17. let ftop7 = "-";
  18. let ftop8 = "-";
  19. let ftop9 = "-";
  20. let ftop0 = "-";
  21.  
  22. let fw1 = "-";
  23. let fw2 = "-";
  24. let fw3 = "-";
  25. let fw4 = "-";
  26. let fw5 = "-";
  27. let fw6 = "-";
  28. let fw7 = "-";
  29. let fw8 = "-";
  30. let fw9 = "-";
  31.  
  32. let online = [""];
  33. let x = (online) => online.filter((v,i) => online.indexOf(v) === i)
  34.  
  35. function empty() {
  36. online = [""];
  37. }
  38.  
  39. bot.on('message', (message)=>{
  40. chat = `${message}`
  41.  
  42. let rdy = "no";
  43. if(chat.startsWith("[")) {
  44. rdy = "yes"
  45. }
  46. else {rdy = "no"}
  47.  
  48. if(chat.includes("@")) return
  49. if(chat.includes("`")) return
  50. if(chat.includes(`{`)) return
  51.  
  52. if(chat.startsWith("1.")) {ftop1 = chat}
  53. if(chat.startsWith("2.")) {ftop2 = chat}
  54. if(chat.startsWith("3.")) {ftop3 = chat}
  55. if(chat.startsWith("4.")) {ftop4 = chat}
  56. if(chat.startsWith("5.")) {ftop5 = chat}
  57. if(chat.startsWith("6.")) {ftop6 = chat}
  58. if(chat.startsWith("7.")) {ftop7 = chat}
  59. if(chat.startsWith("8.")) {ftop8 = chat}
  60. if(chat.startsWith("9.")) {ftop9 = chat}
  61. if(chat.startsWith("10.")) {ftop0 = chat}
  62.  
  63. if(chat.startsWith("_________________")) {fw1 = chat}
  64. if(chat.startsWith("Description:")) {fw2 = chat}
  65. if(chat.startsWith("Age:")) {fw3 = chat}
  66. if(chat.startsWith("Warnings:")) {fw4 = chat}
  67. if(chat.startsWith("Bans / Mutes:")) {fw5 = chat}
  68. if(chat.startsWith("Land / Power / Maxpower:")) {fw6 = chat}
  69. if(chat.startsWith("Total Worth:")) {fw7 = chat}
  70. if(chat.startsWith("Bank:")) {fw8 = chat}
  71. if(chat.startsWith("Followers Online")) {fw9 = chat}
  72.  
  73. if(chat.includes(" | ")) {
  74. online.push(chat)
  75. }
  76.  
  77. if(serverchat1 == `true` && rdy == "yes") {
  78. client.channels.get("542966141572743170").send("`" + chat + "`");
  79. rdy = "no"
  80. }
  81. });
  82.  
  83.  
  84. client.on("message", async (message) => {
  85.  
  86. if(message.content.startsWith(prefix + "testa")) {
  87. console.log(x(online))
  88. }
  89.  
  90. if(message.content.toLowerCase().startsWith(prefix + "fwho")) {
  91. let messageArray = message.content.split(" ");
  92. let cmd = messageArray[0];
  93. let args = messageArray.slice(1);
  94.  
  95. let nofac = new Discord.RichEmbed()
  96. .setColor(errc)
  97. .setTitle(`:warning: **MISSING ARGS**`)
  98. .setDescription("You are missing some arguments." + "\n" + " " + "\n" + "**Correct Syntax:** " + "`" + `${prefix}fwho <faction>` + "`")
  99. .setFooter(message.author.tag, message.author.avatarURL);
  100.  
  101. let getting = new Discord.RichEmbed()
  102. .setColor(red)
  103. .setDescription(`Please wait one second as I request that from the server.`)
  104.  
  105. let nofaction = new Discord.RichEmbed()
  106. .setColor(errc)
  107. .setDescription(`The requested faction "${args[0]}" could't be found. The fac`)
  108.  
  109. if(!args[0]) return message.channel.send(nofac)
  110.  
  111. let cmda = `/f who ${args[0]}`
  112. bot.chat(cmda)
  113.  
  114. const fetch = message.channel.send(getting).then(msg => msg.delete(200))
  115. await fetch
  116.  
  117. let f1 = fw1.split(" ");
  118. let ww1 = f1.slice(1);
  119.  
  120. let ww2 = fw2.slice(12);
  121.  
  122. let ww3 = fw3.slice(5);
  123.  
  124. let f4 = fw4.split(" ");
  125. let ww4 = f4.slice(1);
  126.  
  127. let f5 = fw5.split(" ");
  128. let ww5 = f5.slice(1);
  129.  
  130. let f6 = fw6.split(" ");
  131. let ww6 = f6.slice(1);
  132.  
  133. let f7 = fw7.split(" ");
  134. let ww7 = f7.slice(1);
  135.  
  136. let f8 = fw8.split(" ");
  137. let ww8 = f8.slice(1);
  138.  
  139. let f9 = fw9.split(" ");
  140. let ww9 = f9.slice(1);
  141.  
  142. let www9 = ww9[1].replace("(", "")
  143. let www10 = www9.replace(")", "")
  144. let www11 = www10.replace(":", "")
  145.  
  146. let onlinea = "";
  147.  
  148. if(www11 == "8") {onlinea = `${online[1]}\n${online[2]}\n${online[3]}`}
  149. if(www11 == "9") {onlinea = `${online[1]}\n${online[2]}\n${online[3]}`}
  150. if(www11 == "10") {onlinea = `${online[1]}\n${online[2]}\n${online[3]}`}
  151. if(www11 == "11") {onlinea = `${online[1]}\n${online[2]}\n${online[3]}`}
  152.  
  153. let fwho = new Discord.RichEmbed()
  154. .setColor(red)
  155. .setTitle(`F Who - ${ww1[0]}`)
  156. .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 `)
  157. .addField(`** **`, `**${www11} member(s) online** ยป ` + "```" + `${onlinea}` + "```")
  158. .setFooter(`Factions Bot | Made By BestBearr`);
  159.  
  160. return message.channel.send(fwho)
  161.  
  162. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement