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