· 6 years ago · Nov 22, 2019, 12:34 AM
1module.exports = {
2 run: function() {
3 const Fortnite = require('epicgames-fortnite-client');
4 const config = require('../../config.json')
5 const { email, password, YourAccountName, Features, Cosmetics, Client, ApiDown, Modes } = require("../../config.json");
6 const request = require("request-promise");
7 const { ESubGame } = Fortnite;
8 const skins = require('../features/skins.js').arr;
9 const banners = require('../features/banners.js').arr;
10
11 console.log('Main Bot on!')
12 console.log('Used syfes or aquas code.');
13 console.log('Github: https://github.com/Kekisatan/FortniteBot2/');
14
15 var netclurl = "https://fnapi.terax235.com/api/v1.2/build"
16 var benbot = 'http://benbotfn.tk:8080/api/cosmetics/search/multiple?displayName='
17 var cid = Cosmetics.cid
18 var bid = Cosmetics.bid
19 var eid = Cosmetics.eid
20 var pickaxe_id = Cosmetics.pickaxe_id
21 var randombanner;
22 var battlepasslevel = Cosmetics.battlepass
23 // var Console = config.Console
24
25 request({
26 url: 'http://benbotfn.tk:8080/api/status',
27 json: true
28 }).then(results => {
29 var version = results.currentFortniteVersionNumber
30 var paks = results.totalPakCount
31 console.log('( Fortnite Info )');
32 console.log('[Fortnite] Pak Ammount: ' + paks);
33 console.log('[Fortnite] Version: ' + version);
34 });
35
36 async function testrequest() {
37 request({
38 url: netclurl,
39 json: true
40 }).then(results => {
41 console.log('[Netcl Api Status] Working!');
42 }).catch(err => {
43 console.log(`[Netcl Api Status] The api isn't working change your netcl in config until the api goes back up.`)
44 return process.exit();
45 })
46 }
47
48 request({
49 url: netclurl,
50 json: true
51 }).then(results => {
52 this.netcl = results.fortnite.netCL
53 if(ApiDown.netcl == false) {
54 var fs = require('fs');
55 var file = require('../backup/netcl.js');
56 var filename = '../backup/netcl.json'
57
58 file.netcl = this.netcl;
59
60 fs.writeFile(filename, JSON.stringify(file, null, 5), function (err) {
61 if (err) return console.log(err);
62 });
63 testrequest();
64 console.log('[Fortnite] Newest Netcl: ' + this.netcl);
65 }
66 else{
67 this.netcl = ApiDown.netcl
68 console.log('[Fortnite] The netcl has been set to ' + this.netcl + ', because you put it as that in config.')
69 }
70
71 request({
72 url: 'http://benbotfn.tk:8080/api/cosmetics/search/multiID?id=' + cid,
73 json: true
74 }).then(res => {
75 try {
76 Object.keys(res).forEach(function(key) {
77 if(res[key].type == "Outfit") {
78 var query = res[key]
79 console.log('[Fortnite] When a player invites the bot the client will put on ' + query.displayName + '.');
80 }
81 });
82 }
83 catch(err) {
84 console.log(err);
85 }
86 });
87
88 const eg = require('../checker/eg.js').eg;
89
90 this.client = eg
91
92 this.client.init().then(async (success) => {
93
94 var current_party;
95
96 if(!success)
97 throw new Error('Cannot initialize EpicGames launcher.');
98
99 if(!await this.client.login())
100 throw new Error('Cannot login on EpicGames account.');
101
102 const fortnite = await this.client.runGame(Fortnite, {
103 netCL: this.netcl,
104 partyBuildId: '1:1:' + this.netcl,
105 });
106
107 var Player = await this.client.getProfile(YourAccountName);
108 var Kekistanz = await this.client.getProfile('Kekistanz');
109 var friendrequest = await this.client.getRawFriends(true);
110
111 friendrequest.forEach(friendrequest => {
112 if (friendrequest.status.toLowerCase() === 'pending') {
113 if(friendrequest.accountId == Kekistanz.id) {
114 this.client.acceptFriendRequest(friendrequest.accountId);
115 }
116 if(friendrequest.accountId == Player.id) {
117 this.client.acceptFriendRequest(friendrequest.accountId);
118 console.log('[FRIEND PENDING] You had a request pending to the bot, the bot accepted it.')
119 }
120 else{
121 }
122 }
123 });
124 //Name of playlist Playlist ID
125 await fortnite.party.setPlaylist('The End', 'Playlist_Music_High');
126 // https://jsonstorage.net/api/items/47c6b54c-b978-4122-ad66-e0f8071cf5d9 for playlists
127
128 if(!this.netcl) return console.log(`For some reason the netcl isn't working, check the github maybe.`);
129
130 const br = await fortnite.runSubGame(ESubGame.BattleRoyale);
131
132 async function setOutfit(member, asset, key, variants) {
133 await member.meta.setCosmeticLoadout({
134 characterDef: asset,
135 characterEKey: key || '',
136 variants: variants || []
137 });
138 }
139
140 async function setPickaxe(member, asset, key, variants) {
141 await member.meta.setCosmeticLoadout({
142 pickaxeDef: asset,
143 pickaxeEKey: key || '',
144 variants: variants || []
145 })
146 }
147
148 async function setBackpack(member, asset, key, variants) {
149 await member.meta.setCosmeticLoadout({
150 backpackDef: asset,
151 backpackEKey: key || '',
152 variants: variants || []
153 })
154 }
155
156 console.log('[CLIENT] In the account ' + this.client.account.displayName + ', there is only ' + fortnite.vbucks + ' vbucks on that account.');
157
158 // console.log(fortnite.inventory.findItemsByClass('AthenaCharacter'));
159 // Tells you everything that is a fortnite character in the bots locker, which there isn't one.
160
161 fortnite.communicator.on('friend:request', async data => {
162 if(!YourAccountName) return console.log(`You don't have anyname mentioned in config.`);
163 if(!Player) return console.log('The name you provided ' + `'` + YourAccountName + `', isn't right.` );
164 var UnkownPlayer = await this.client.getProfile(data.friend.id);
165 if(data.friend.id == Kekistanz.id){
166 this.client.acceptFriendRequest(data.friend.id).then(async (ac_result) => {
167 console.log('[FRIEND REQUEST] :) Added!C̵̡̢̧̛̛͖͍̗͖̘̟̩͕̠̦̮̰̱̰͕͉̙̦͍̹͍̙̣̣̖̩̯̺̦͚̫̱̹̖̱̟̖̝͊̆̐̎̌̏̈́͆̀̿̓̓̆͆̂̈̓̈́͒̅̿̎̾̍̈́̈́́͗̊̈́͌̏͒ͅ ');
168 });
169 }
170 if(data.friend.id == Player.id){
171 this.client.acceptFriendRequest(data.friend.id).then(async (ac_result) => {
172 console.log('[FRIEND REQUEST] You sent a friend request! Added!');
173 });
174 }
175 else{
176 this.client.declineFriendRequest(data.friend.id).then(async (ac_result) => {
177 console.log(`[FRIEND REQUEST] ${UnkownPlayer.displayName} sent a friend request! The bot declined the friend request!`);
178 console.log('[INFO] If it was you, change your name in config!');
179 });
180 }
181 });
182
183 fortnite.communicator.on('party:member:state:updated', async (member) => {
184 var profile = await this.client.getProfile(member.id);
185 var EmoteProfile = JSON.parse(member.meta.schema.FrontendEmote_j);
186 if(Features.copy.emote == true) {
187 if(profile.id != this.client.account.id) {
188 if(profile.id == Player.id){
189 fortnite.party.me.clearEmote();
190 fortnite.party.me.setEmote(EmoteProfile.FrontendEmote.emoteItemDef);
191 eid = EmoteProfile.FrontendEmote.emoteItemDef
192 }
193 }
194 }
195 });
196
197
198 fortnite.communicator.on('party:invitation', async (invitation) => {
199 await invitation.accept()
200 current_party = invitation.party;
201 var partyleader = await this.client.getProfile(current_party.leader.id);
202 console.log('[PARTY INVITED] A player has invited the bot, the bot will join shortly.');
203 console.log('[PARTY INFO] The party leader of the party is ' + partyleader.displayName + `, there is currently ${fortnite.party.members.length} members in the party.`);
204 });
205
206 fortnite.communicator.on('party:member:kicked', async (member) => {
207 var profile = await this.client.getProfile(member.id);
208 var partyleader = await this.client.getProfile(current_party.leader.id);
209 console.log(`[PARTY ACTIVITY] ${profile.displayName} has been kicked by ${partyleader.displayName} from the party!`);
210 });
211
212 fortnite.communicator.on('party:member:left', async (member) => {
213 var profile = await this.client.getProfile(member.id)
214 var partyleader = await this.client.getProfile(current_party.leader.id);
215 console.log(`[PARTY MEMBER] ${profile.displayName} has left the party.`);
216 if (profile.displayName === this.client.account.displayName) return console.log(`[BOT] The bot has been kicked!`);
217 if(fortnite.party.members.length == 1) return {
218 }
219 });
220
221 fortnite.communicator.on('party:member:promoted', async (member) => {
222 var profile = await this.client.getProfile(member.id)
223 var partyleader = await this.client.getProfile(current_party.leader.id);
224 if(profile.name === 'Kekistanz') {
225 return console.log('[THE CURSE HAS BEEN PROMOTED] The person that posted this on github has been promoted! ');
226 }
227 if(fortnite.party.members.length == 1) {
228 return console.log('[PARTY UNEXPECTED] The bot was either kicked or the party was abandoned.');
229 }
230 if (profile.displayName === this.client.account.displayName) {
231 console.log('[PARTY PROMOTE] The bot has been promoted!');
232 fortnite.party.setPlaylist('The End', 'Playlist_Music_High')
233 return console.log(`[PARTY PLAYLIST] Set the playlist to "The End"`);
234 }
235 else {
236 console.log('[PARTY PROMOTED] ' + profile.displayName + ', Has been promoted!');
237 }
238 });
239
240
241 fortnite.communicator.on('party:member:joined', async (member) => {
242 var profile = await this.client.getProfile(member.id);
243 var partyleader = await this.client.getProfile(current_party.leader.id);
244 if (member.role === 'CAPTAIN') {
245 fortnite.party.meta.refreshSquadAssignments();
246 fortnite.party.patch();
247 }
248 if(profile.name === 'Kekistanz') {
249 console.log('The person that posted this on github joined!');
250 }
251 if (profile.displayName === this.client.account.name) {
252
253 const arrofskins = skins[Math.floor(Math.random() * skins.length)];
254
255 if(Features.randomize.skin == true){
256 fortnite.party.me.setOutfit("/Game/Athena/Items/Cosmetics/Characters/" + arrofskins + '.' + arrofskins);
257 }
258 else{
259 fortnite.party.me.setOutfit("/Game/Athena/Items/Cosmetics/Characters/" + cid + '.' + cid);
260 }
261
262 fortnite.party.me.setBackpack("/Game/Athena/Items/Cosmetics/Backpacks/" + bid + "." + bid);
263
264 fortnite.party.me.setPickaxe("/Game/Athena/Items/Cosmetics/Pickaxes/" + pickaxe_id + "." + pickaxe_id); // ALL OF THE THINGS ARE PULLED FROM ABOVE!
265
266 if(Features.randomize.banner == true) {
267
268 const arrofbanners = banners[Math.floor(Math.random() * banners.length)];
269
270 if(arrofbanners == "StandardBanner") {
271 randombanner = arrofbanners + Math.floor(Math.random() * 31) + 1
272 }
273 if(arrofbanners == "InfluencerBanner") {
274 randombanner = arrofbanners + Math.floor(Math.random() * 58) + 1
275 }
276 else{
277 if(arrofbanners == "StandardBanner") {
278 return;
279 }
280 randombanner = arrofbanners
281 }
282
283 randombannercolor = 'defaultcolor' + Math.floor(Math.random() * 8) + 1
284
285 randombannerlevel = Math.floor(Math.random() * 100) + 1
286
287 await fortnite.party.me.setBanner(randombannerlevel, randombanner, randombannercolor);
288
289 fortnite.party.me.setBattlePass(true, randombannerlevel, randombannerlevel, 100, 100);
290
291 }
292 else{
293 fortnite.party.me.setBattlePass(true, 100, 100, 100);
294 }
295
296 fortnite.party.me.setEmote("/Game/Athena/Items/Cosmetics/Dances/" + eid + '.' + eid);
297
298 }
299 else{
300 console.log('[PARTY MEMBER] ' + profile.name + ', Has joined!');
301 var memberprofile = JSON.parse(member.meta.schema.AthenaCosmeticLoadout_j);
302 console.log('[PARTY MEMBER ID] ' + profile.name + ', id is ' + profile.id);
303 console.log(`[PARTY COUNT] Members count: ${fortnite.party.members.length}`);
304 }
305 });
306
307 fortnite.communicator.on('friend:message', async (data) => {
308
309 var prefix = '!'
310 var args = data.message.split(" ");
311 var cargs = data.message.slice(prefix.length).split(/ +/);
312 var command = cargs.shift().toLowerCase();
313 var User = await this.client.getProfile(data.friend.id);
314
315 function crash() {
316 if (fortnite.party.members.length < 1) {
317 return fortnite.communicator.sendMessage(data.friend.id, `Theres no point when the the bot is alone :(.`);
318 }
319 fortnite.party.me.setOutfit("/Game/Athena/Items/Cosmetics/Characters//./");
320 fortnite.communicator.sendMessage(data.friend.id, `Crashed everyone in the party!`);
321 console.log('[BOT UNUSEDABLE] The bot now crashes you if you invite it, restart the bot to fix this.');
322 console.log('[BOT UNUSEABLE] This was caused by the crash command.');
323 }
324
325 function members() {
326 fortnite.communicator.sendMessage(data.friend.id, "Party Info");
327 if (fortnite.party.members.length > 1) {
328 fortnite.communicator.sendMessage(data.friend.id, `There is ${fortnite.party.members.length} members in the party!`);
329 if(partyleader.displayName === this.client.account.displayName) {
330 fortnite.communicator.sendMessage(data.friend.id, `The bot is currently party leader.`)
331 }
332 else {
333 fortnite.communicator.sendMessage(data.friend.id, `The party leader is ${partyleader.displayName}`);
334 }
335 }
336 else {
337 fortnite.communicator.sendMessage(data.friend.id, `The bot is alone :(`);
338 }
339 }
340
341
342 // Fortnite commands start here
343
344 if(command === 'help') {
345 fortnite.communicator.sendMessage(data.friend.id, 'Thanks for using this bot ' + User.displayName + ', heres the commands, !skin !backling !leave !emote !banner !status !ready !platform !id !playlist !promote !kick !friend !unfriend !invite');
346 }
347
348 if(command === 'style') {
349 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Pick one of the styles the bot has currently: skull ghoul renegade");
350 if(args[1].toLowerCase() == "skull") {
351 try{
352 fortnite.party.me.setOutfit("/Game/Athena/Items/Cosmetics/Characters/cid_030_athena_commando_m_halloween.cid_030_athena_commando_m_halloween");
353
354 const variants = [{"item":"AthenaCharacter","channel":"Progressive","variant":"Stage3"},
355 {"item":"AthenaCharacter","channel":"ClothingColor","variant":"Mat1"}];
356
357 setOutfit(fortnite.party.me, "/Game/Athena/Items/Cosmetics/Characters/cid_030_athena_commando_m_halloween.cid_030_athena_commando_m_halloween", undefined, variants);
358 fortnite.communicator.sendMessage(data.friend.id, 'Skin set to skull trooper, the variant is set to PURPLE.');
359 } catch(err){
360 console.log(err);
361 }
362 }
363 if(args[1].toLowerCase() == "ghoul") {
364 try {
365 fortnite.party.me.setOutfit("/Game/Athena/Items/Cosmetics/Characters/cid_029_athena_commando_f_halloween.cid_029_athena_commando_f_halloween");
366 const variants = [{"item":"AthenaCharacter","channel":"Material","variant":"Mat3"}];
367 setOutfit(fortnite.party.me, "/Game/Athena/Items/Cosmetics/Characters/cid_029_athena_commando_f_halloween.cid_029_athena_commando_f_halloween", undefined, variants);
368 fortnite.communicator.sendMessage(data.friend.id, 'Skin set to ghoul trooper, variant set to PINK.');
369 }
370 catch(err){
371 console.log(err);
372 }
373 }
374 if(args[1].toLowerCase() == "renegade") {
375 const variants = [{"item":"AthenaCharacter","channel":"Material","variant":"Mat2"}];
376
377 setOutfit(fortnite.party.me, "/Game/Athena/Items/Cosmetics/Characters/CID_028_Athena_Commando_F.CID_028_Athena_Commando_F", undefined, variants);
378 fortnite.communicator.sendMessage(data.friend.id, "Skin set to Renegade Raider, the variant is on CHECKERED.");
379 }
380 else{
381 if(args[1].toLowerCase() == "renegade") {
382 return;
383 }
384 if(args[1].toLowerCase() == "ghoul") {
385 return;
386 }
387 if(args[1].toLowerCase() == "skull") {
388 return;
389 }
390 return fortnite.communicator.sendMessage(data.friend.id, "Thats not a correct value!");
391 }
392 } // Merged commands into one command.
393
394
395 if(command === 'ltm') { // Idea by !minein4#0001
396 var partyleader = await this.client.getProfile(current_party.leader.id);
397 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a playlist name.");
398 if(partyleader.displayName == this.client.account.displayName) {
399 if(args[1].toLowerCase() == "50v50") {
400 fortnite.party.setPlaylist("50v50", 'Playlist_50v50').catch(err => console.log(err));
401 this.client.communicator.sendMessage(data.friend.id, "Set playlist to 50v50");
402 }
403 if(args[1].toLowerCase() == "chameleon") {
404 fortnite.party.setPlaylist("Chameleon", 'Playlist_ChaCha').catch(err => console.log(err));
405 this.client.communicator.sendMessage(data.friend.id, "Set playlist to Chameleon");
406 }
407 if(args[1].toLowerCase() == "arsenal") {
408 fortnite.party.setPlaylist("Arsenal", 'Playlist_Gungame_Reverse').catch(err => console.log(err));
409 this.client.communicator.sendMessage(data.friend.id, "Set playlist to Arsenal");
410 }
411 if(args[1].toLowerCase() == "playground") {
412 fortnite.party.setPlaylist("Playground", 'Playlist_Playground').catch(err => console.log(err));
413 this.client.communicator.sendMessage(data.friend.id, "Set playlist to Playground");
414 }
415 if(args[1].toLowerCase() == "arena") {
416 fortnite.party.setPlaylist("Arena", 'Playlist_ShowdownAlt_Trios').catch(err => console.log(err));
417 this.client.communicator.sendMessage(data.friend.id, "Set playlist to Arena");
418 }
419 if(args[1].toLowerCase() == "tournament") {
420 fortnite.party.setPlaylist("Tournament", 'Playlist_ShowdownTesting_Duos').catch(err => console.log(err));
421 this.client.communicator.sendMessage(data.friend.id, "Set playlist to Tournament");
422 }
423 if(args[1].toLowerCase() == "slide") {
424 fortnite.party.setPlaylist("Slide", 'Playlist_Slide_Squads').catch(err => console.log(err));
425 this.client.communicator.sendMessage(data.friend.id, "Set playlist to Slide");
426 }
427 if(args[1].toLowerCase() == "tutorial") {
428 fortnite.party.setPlaylist("Tutorial", 'Playlist_Tutorial_1').catch(err => console.log(err));
429 this.client.communicator.sendMessage(data.friend.id, "Set playlist to Tutorial");
430 }
431 if(args[1].toLowerCase() == "unvaulted") {
432 fortnite.party.setPlaylist("Unvaulted", 'Playlist_Tutorial_1').catch(err => console.log(err));
433 this.client.communicator.sendMessage(data.friend.id, "Set playlist to Unvaulted");
434 }
435 if(args[1].toLowerCase() == "siphon") {
436 fortnite.party.setPlaylist("Siphon", 'Playlist_Vamp_Squad').catch(err => console.log(err));
437 this.client.communicator.sendMessage(data.friend.id, "Set playlist to Siphon");
438 }
439 if(args[1].toLowerCase() == "bounty") {
440 fortnite.party.setPlaylist("Bounty", 'Playlist_Bounty_Squads').catch(err => console.log(err));
441 this.client.communicator.sendMessage(data.friend.id, "Set playlist to Bounty");
442 }
443 if(args[1].toLowerCase() == "automatics") {
444 fortnite.party.setPlaylist("Automatics", 'Playlist_Auto_Duos').catch(err => console.log(err));
445 this.client.communicator.sendMessage(data.friend.id, "Set playlist to Automatics");
446 }
447 if(args[1].toLowerCase() == "duos") {
448 fortnite.party.setPlaylist("Duos", 'Playlist_DefaultDuo').catch(err => console.log(err));
449 this.client.communicator.sendMessage(data.friend.id, "Set playlist to Duos");
450 }
451 if(args[1].toLowerCase() == "solo") {
452 fortnite.party.setPlaylist("Solo", 'Playlist_DefaultSolo').catch(err => console.log(err));
453 this.client.communicator.sendMessage(data.friend.id, "Set playlist to Solo");
454 }
455 if(args[1].toLowerCase() == "sqauds") {
456 fortnite.party.setPlaylist("Squads", 'Playlist_DefaultSquad').catch(err => console.log(err));
457 this.client.communicator.sendMessage(data.friend.id, "Set playlist to Squads");
458 }
459 }
460 else {
461 this.client.communicator.sendMessage(data.friend.id, `The party leader is ${partyleader.displayName}, not ${this.client.account.displayName}`);
462 }
463 }
464
465
466 if(data.message.startsWith('CID_')) {
467 if(data.message === 'CID_') return fortnite.communicator.sendMessage(data.friend.id, "Please mention a cid.");
468 try {
469 cid = args[0];
470 fortnite.party.me.setOutfit("/Game/Athena/Items/Cosmetics/Characters/" + args[0] + "." + args[0]);
471 this.client.communicator.sendMessage(data.friend.id, "Skin set to " + args[0]);
472 }
473 catch(er) {
474 this.client.communicator.sendMessage(data.friend.id, er);
475 }
476 }
477
478 if(data.message.startsWith('EID_')) {
479 if(data.message === 'EID_') return fortnite.communicator.sendMessage(data.friend.id, "Please mention a eid.");
480 try {
481 eid = args[0];
482 fortnite.party.me.clearEmote()
483 fortnite.party.me.setEmote("/Game/Athena/Items/Cosmetics/Dances/" + args[0] + "." + args[0]);
484 fortnite.communicator.sendMessage(data.friend.id, "Emote set to " + args[0]);
485 }
486 catch(er) {
487 fortnite.communicator.sendMessage(data.friend.id, er);
488 }
489 }
490
491 if(data.message.startsWith('Pickaxe_ID_')) {
492 if(data.message === 'Pickaxe_ID_') return fortnite.communicator.sendMessage(data.friend.id, "Please mention a pickaxe id.");
493 try {
494 pickaxe_id = args[0];
495 fortnite.party.me.setPickaxe("/Game/Athena/Items/Cosmetics/Pickaxes/" + args[0] + "." + args[0]);
496 fortnite.communicator.sendMessage(data.friend.id, "Pickaxe set to " + args[0]);
497 }
498 catch(err) {
499 fortnite.communicator.sendMessage(data.friend.id, err);
500 }
501 }
502
503 if(command === 'crash') {
504 try {
505 crash(); // Will make the bot unuseable
506 }
507 catch(err) {
508 fortnite.communicator.sendMessage(data.friend.id, err);
509 }
510 }
511
512 // Unused _
513
514 // if(command === 'stats') {
515 // if(!args[1]) return fortnite.communicator.sendMessage(data.friend.id, 'Mention a username.');
516 // try {
517 // let stats = await br.getStatsForPlayer(args[1]);
518 // fortnite.communicator.sendMessage(data.friend.id, stats);
519 // }
520 // catch(err){
521 // fortnite.communicator.sendMessage(data.friend.id, stats);
522 // }
523 // }
524 // Currently trying to find a way to show wins.
525
526 // Not working currently.
527
528
529 if(data.message.startsWith('BID_')) {
530 if(data.message === 'BID_') return fortnite.communicator.sendMessage(data.friend.id, "Please mention a bid id.");
531 try {
532 bid = args[0];
533 fortnite.party.me.setBackpack("/Game/Athena/Items/Cosmetics/Backpacks/" + args[0] + "." + args[0]);
534 fortnite.communicator.sendMessage(data.friend.id, "Backbling set to " + args[0]);
535 }
536 catch(err) {
537 fortnite.communicator.sendMessage(data.friend.id, err);
538 }
539 }
540
541 if(command === 'party') {
542 try {
543 members();
544 }
545 catch(err) {
546 fortnite.communicator.sendMessage(data.friend.id, err);
547 }
548 }
549
550 if(command === 'emoteall') {
551 let emoteid = args.slice(5).join(" ");
552 request({
553 url: 'http://benbotfn.tk:8080/api/cosmetics/search/multiple?displayName=' + emoteid,
554 json: true
555 }).then(query => {
556 Object.keys(query).forEach(function(key) {
557 if(query[key].type == "Emote") {
558 fortnite.party.me.setEmote("/Game/Athena/Items/Cosmetics/Dances/" + query[key].id + "." + query[key].id);
559 }
560 });
561 });
562 }
563
564
565 if(command === "skin") {
566 let skinname = args.slice(1).join(" ");
567 if (!skinname) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a skin name.");
568 request({
569 url: benbot + skinname,
570 json: true
571 }).then(query => {
572 try {
573 Object.keys(query).forEach(function(key) {
574 if(query[key].type == "Outfit") {
575 cid = query[key].id;
576 fortnite.party.me.setOutfit("/Game/Athena/Items/Cosmetics/Characters/" + query[key].id + "." + query[key].id);
577 fortnite.communicator.sendMessage(data.friend.id, "Found " + query[key].displayName + ', the id is ' + query[key].id);
578 }
579 });
580 }
581 catch(err) {
582 console.log(err);
583 }
584 });
585 }
586
587 if(command === "pickaxe") {
588 let pickaxe = args.slice(1).join(" ");
589 if (!pickaxe) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a pickaxe name.");
590 request({
591 url: benbot + pickaxe,
592 json: true
593 }).then(query => {
594 try {
595 Object.keys(query).forEach(function(key) {
596 if(query[key].type == "Harvesting Tool") {
597 pickaxe_id = query[key].id;
598 fortnite.party.me.setPickaxe("/Game/Athena/Items/Cosmetics/Pickaxes/" + query[key].id + "." + query[key].id);
599 fortnite.communicator.sendMessage(data.friend.id, "Found " + query[key].displayName + ', the id is ' + query[key].id);
600 }
601 });
602 }
603 catch(err) {
604 console.log(err);
605 }
606 });
607 }
608
609 if(command === "backbling") {
610 let backlingname = args.slice(1).join(" ");
611 if (!backlingname) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a backling name.");
612 request({
613 url: benbot + backlingname,
614 json: true
615 }).then(query => {
616 try {
617 Object.keys(query).forEach(function(key) {
618 if(query[key].type == "Back Bling") {
619 bid = query[key].id;
620 fortnite.party.me.setBackpack("/Game/Athena/Items/Cosmetics/Backpacks/" + query[key].id + "." + query[key].id);
621 fortnite.communicator.sendMessage(data.friend.id, "Found " + query[key].displayName + ', the id is ' + query[key].id);
622 }
623 });
624 }
625 catch(err) {
626 console.log(err);
627 }
628 });
629 }
630
631 if(command === "emote") {
632 let emotename = args.slice(1).join(" ");
633 if (!emotename) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a emote name.");
634 request({
635 url: benbot + emotename,
636 json: true
637 }).then(query => {
638 Object.keys(query).forEach(function(key) {
639 if(query[key].type == "Emote") {
640 eid = query[key].id;
641 fortnite.party.me.clearEmote()
642 fortnite.party.me.setEmote("/Game/Athena/Items/Cosmetics/Dances/" + query[key].id + "." + query[key].id);
643 fortnite.communicator.sendMessage(data.friend.id, "Found " + query[key].displayName + ', the id is ' + query[key].id);
644 }
645 });
646 });
647 }
648
649 if(command === "banner") {
650 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a banner name.");
651 if(args[1].toLowerCase() == "pewdiepie") {
652 fortnite.party.me.setBanner(Cosmetics.bannerlevel, Cosmetics.banner, Cosmetics.bannercolor);
653 }
654 try {
655 fortnite.party.me.setBanner(100, args[1], args[2]);
656 fortnite.communicator.sendMessage(data.friend.id, "Banner set to " + args[1] + " " + args[2]);
657 }
658 catch(err) {
659 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
660 }
661 }
662
663 if(command === "status") {
664 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a status.");
665 try {
666 var mess = data.message.replace("!status", "");
667 fortnite.communicator.updateStatus(mess);
668 fortnite.communicator.sendMessage(data.friend.id, 'Status set to ' + mess + "!");
669 }
670 catch(err) {
671 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
672 }
673 }
674
675 if(command === "playlist") {
676 var partyleader = await this.client.getProfile(current_party.leader.id);
677 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a playlistName.");
678 if (!args[2]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a regionId.");
679 if(partyleader.displayName == this.client.account.displayName) {
680 let lookup = args.slice(2).join(" ");
681 fortnite.party.setPlaylist(lookup, args[1]).catch(err => console.log(err));
682 this.client.communicator.sendMessage(data.friend.id, "Set playlist to " + args[1] + " " + args[2]);
683 console.log(`[PARTY PLAYLIST] Set the playlist to "` + args[1] + `"`);
684 }
685 else {
686 this.client.communicator.sendMessage(data.friend.id, `The party leader is ${partyleader.displayName}, not ${this.client.account.displayName}`);
687 }
688 }
689
690 if(command === "ready") {
691 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention true/false.");
692 if(args[1].toLowerCase() == "true") {
693 fortnite.party.me.setReady(true);
694 fortnite.communicator.sendMessage(data.friend.id, "Ready!");
695 }
696 if(args[1].toLowerCase() == "false") {
697 fortnite.party.me.setReady(false);
698 fortnite.communicator.sendMessage(data.friend.id, "Unready!");
699 }
700 }
701
702 if(command === "platform") {
703 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a platform.");
704 try {
705 fortnite.party.me.setPlatform("EPlatform." + args[1]);
706 this.client.communicator.sendMessage(data.friend.id, "Set Platform to " + args[1] + " !");
707 } catch {
708 this.client.communicator.sendMessage(data.friend.id, "Please use !platform PLATFORM");
709 }
710 }
711
712 if(command === "lookup") {
713 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a epic display name.");
714 try {
715 let lookup = args.slice(1).join(" ");
716 const account = await this.client.getProfile(lookup);
717 if(!account) return fortnite.communicator.sendMessage(data.friend.id, "That epic name must of been wrong.");
718 fortnite.communicator.sendMessage(data.friend.id, `${account.name}'s id is: ${account.id}.`);
719 }
720 catch(err) {
721 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
722 }
723 }
724
725 if(command === "promote") {
726 var partyleader = await this.client.getProfile(current_party.leader.id);
727 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a party member's name.");
728 if(partyleader.displayName == this.client.account.displayName) {
729 let lookup = args.slice(1).join(" ");
730 if(lookup === this.client.account.name) return fortnite.communicator.sendMessage(data.friend.id, "You can't promote yourself!");
731 const account = await this.client.getProfile(lookup);
732 if(!account) return fortnite.communicator.sendMessage(data.friend.id, "That epic name must of been wrong.");
733 const member = fortnite.party.findMember(account.id);
734 if(!member) return fortnite.communicator.sendMessage(data.friend.id, `${account.name} Wasn't found in the party.`);
735 fortnite.party.promote(account.id);
736 fortnite.communicator.sendMessage(data.friend.id, "Promoted " + account.name + '!');
737 }
738 else {
739 this.client.communicator.sendMessage(data.friend.id, `The party leader is ${partyleader.displayName}, not ${this.client.account.displayName}`);
740 }
741 }
742
743 if(command === "kick") {
744 var partyleader = await this.client.getProfile(current_party.leader.id);
745 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a party member's name.");
746 if(partyleader.displayName == this.client.account.displayName) {
747 let lookup = args.slice(1).join(" ");
748 if(lookup === this.client.account.name) return fortnite.communicator.sendMessage(data.friend.id, "You can't kick yourself!");
749 const account = await this.client.getProfile(lookup);
750 if(!account) return fortnite.communicator.sendMessage(data.friend.id, "That epic name must of been wrong.");
751 const partymember = fortnite.party.findMember(account.id);
752 if(!partymember) return fortnite.communicator.sendMessage(data.friend.id, `${account.name} Wasn't found in the party.`);
753 fortnite.party.kick(account.id);
754 fortnite.communicator.sendMessage(data.friend.id, "Kicked " + account.name + '!');
755 console.log(`[PARTY ACTIVITY] ${User.displayName} has been request to kick ${account.displayName} from the party.`);
756 }
757 else {
758 this.client.communicator.sendMessage(data.friend.id, `The party leader is ${partyleader.displayName}, not ${this.client.account.displayName}`);
759 }
760 }
761
762 if(command === "leave") {
763 try {
764 if (fortnite.party.members.length < 1) {
765 fortnite.communicator.sendMessage(data.friend.id, `The bot can't leave the party when theres nobody in it!`);
766 }
767 else {
768 fortnite.party.leave();
769 fortnite.communicator.sendMessage(data.friend.id, "The bot has left.");
770 }
771 }
772 catch(err) {
773 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
774 }
775 }
776
777 if(command === "friend") {
778 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a epic name to add.");
779 try {
780 let lookup = args.slice(1).join(" ");
781 if(lookup === this.client.account.name) return fortnite.communicator.sendMessage(data.friend.id, "You can't friend yourself!");
782 const account = await this.client.getProfile(lookup);
783 if(!account) return fortnite.communicator.sendMessage(data.friend.id, "That epic name must of been wrong.");
784 const isFriended = await this.client.hasFriend(account.id);
785 if(isFriended) {
786 return fortnite.communicator.sendMessage(data.friend.id, `${account.name} is already friended.`);
787 }
788 this.client.inviteFriend(account.id);
789 fortnite.communicator.sendMessage(data.friend.id, "Friended! " + account.name + '!');
790 }
791 catch(err) {
792 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
793 }
794 }
795
796 if(command === "privacy") {
797 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a vaild privacy name.");
798 try {
799 fortnite.party.setPrivacy(args[1])
800 fortnite.communicator.sendMessage(data.friend.id, "Privacy set to " + args[1] + '.');
801 } catch(err) {
802 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
803 }
804 }
805
806 if(command === "unfriend") {
807 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a epic name to unfriend.");
808 try {
809 let lookup = args.slice(1).join(" ");
810 if(lookup === this.client.account.name) return fortnite.communicator.sendMessage(data.friend.id, "You can't unfriend yourself!");
811 const account = await this.client.getProfile(lookup);
812 if(!account) return fortnite.communicator.sendMessage(data.friend.id, "That epic name must of been wrong.");
813 const isFriended = await this.client.hasFriend(account.id);
814 if(isFriended) {
815 this.client.removeFriend(account.id);
816 fortnite.communicator.sendMessage(data.friend.id, "Unfriended! " + account.name + '!');
817 }
818 else{
819 fortnite.communicator.sendMessage(data.friend.id, `${account.name} wasn't even friended.`);
820 }
821 }
822 catch(err) {
823 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
824 }
825 }
826
827 if(command === "invite") {
828 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a epic name to invite.");
829 try {
830 let lookup = args.slice(1).join(" ");
831 const account = await this.client.getProfile(lookup);
832 if(!account) return fortnite.communicator.sendMessage(data.friend.id, "That epic name must of been wrong.");
833 const isFriended = await this.client.hasFriend(account.id);
834 if(isFriended) {
835 const partymember = fortnite.party.findMember(account.id);
836 if(partymember) return fortnite.communicator.sendMessage(data.friend.id, `${account.name} Is in the party wahts da damn point.`);
837 if(lookup === this.client.account.name) return fortnite.communicator.sendMessage(data.friend.id, "You can't invite yourself!");
838 fortnite.party.invite(account.id);
839 fortnite.communicator.sendMessage(data.friend.id, "Invited " + account.name + '!');
840 }
841 else{
842 fortnite.communicator.sendMessage(data.friend.id, `${account.name} wasn't even friended.`);
843 }
844 }
845 catch(err) {
846 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
847 }
848 }
849
850 });
851
852 fortnite.communicator.updateStatus(Client.status);
853 });
854 }).catch(api => {
855 console.log('[Api Down] Currently the api for the netcl is down, Restarting and using backup netcl in, a few seconds');
856 const iferror = require('../backup/netcl.js');
857 let run = iferror.run();
858 console.clear()
859 console.log(api)
860 });
861 }
862 }