· 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 const arrofskins = skins[Math.floor(Math.random() * skins.length)];
240
241 fortnite.party.me.setOutfit("/Game/Athena/Items/Cosmetics/Characters/" + arrofskins + '.' + arrofskins);
242
243 fortnite.party.me.setBackpack("/Game/Athena/Items/Cosmetics/Backpacks/" + bid + "." + bid);
244
245 fortnite.party.me.setPickaxe("/Game/Athena/Items/Cosmetics/Pickaxes/" + pickaxe_id + "." + pickaxe_id); // ALL OF THE THINGS ARE PULLED FROM ABOVE!
246
247 const arrofbanners = banners[Math.floor(Math.random() * banners.length)];
248
249 if(arrofbanners == "StandardBanner") {
250 randombanner = arrofbanners + Math.floor(Math.random() * 31) + 1
251 }
252 if(arrofbanners == "InfluencerBanner") {
253 randombanner = arrofbanners + Math.floor(Math.random() * 58) + 1
254 }
255 else{
256 if(arrofbanners == "StandardBanner") {
257 return;
258 }
259 randombanner = arrofbanners
260 }
261
262 randombannercolor = 'defaultcolor' + Math.floor(Math.random() * 8) + 1
263
264 randombannerlevel = Math.floor(Math.random() * 100) + 1
265
266 await fortnite.party.me.setBanner(randombannerlevel, randombanner, randombannercolor);
267
268 fortnite.party.me.setBattlePass(true, randombannerlevel, randombannerlevel, 100, 100);
269
270 }
271 else{
272 console.log('[PARTY MEMBER] ' + profile.name + ', Has joined!');
273 var memberprofile = JSON.parse(member.meta.schema.AthenaCosmeticLoadout_j);
274 console.log('[PARTY MEMBER ID] ' + profile.name + ', id is ' + profile.id);
275 console.log(`[PARTY COUNT] Members count: ${fortnite.party.members.length}`);
276 }
277 });
278
279 fortnite.communicator.on('friend:message', async (data) => {
280
281 var prefix = '!'
282 var args = data.message.split(" ");
283 var cargs = data.message.slice(prefix.length).split(/ +/);
284 var command = cargs.shift().toLowerCase();
285 var User = await eg.getProfile(data.friend.id);
286
287 function crash() {
288 if (fortnite.party.members.length < 1) {
289 return fortnite.communicator.sendMessage(data.friend.id, `Theres no point when the the bot is alone :(.`);
290 }
291 fortnite.party.me.setOutfit("/Game/Athena/Items/Cosmetics/Characters//./");
292 fortnite.communicator.sendMessage(data.friend.id, `Crashed everyone in the party!`);
293 console.log('[BOT UNUSEDABLE] The bot now crashes you if you invite it, restart the bot to fix this.');
294 console.log('[BOT UNUSEABLE] This was caused by the crash command.');
295 }
296
297 function members() {
298 fortnite.communicator.sendMessage(data.friend.id, "Party Info");
299 if (fortnite.party.members.length > 1) {
300 fortnite.communicator.sendMessage(data.friend.id, `There is ${fortnite.party.members.length} members in the party!`);
301 if(partyleader.displayName === eg.account.displayName) {
302 fortnite.communicator.sendMessage(data.friend.id, `The bot is currently party leader.`)
303 }
304 else {
305 fortnite.communicator.sendMessage(data.friend.id, `The party leader is ${partyleader.displayName}`);
306 }
307 }
308 else {
309 fortnite.communicator.sendMessage(data.friend.id, `The bot is alone :(`);
310 }
311 }
312
313
314 // Fortnite commands start here
315
316 if (command === 'variant') {
317 let skinid = args.slice(2).join(" ");
318 if (!skinid) return fortnite.communicator.sendMessage(data.friend.id, 'Mention a skin name or a cid!');
319 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, 'Mention a query! Examples: Mat1, Stage1');
320 if (!skinid == 'CID_') return fortnite.communicator.sendMessage(data.friend.id, 'Yeahhh, well thats not a cid.');
321 request({
322 url: 'https://fnserver.terax235.com/api/v1.2/variants/search',
323 json: true,
324 headers: {
325 'type': "skin",
326 'item': skinid,
327 'query': args[1]
328 }
329 }).then(query => {
330 const variants = [{"item":"AthenaCharacter","channel":query.data.channel,"variant":query.data.tag}];
331
332 setOutfit(fortnite.party.me, "/Game/Athena/Items/Cosmetics/Characters/" + query.data.parent + '.' + query.data.parent, undefined, variants)
333 fortnite.communicator.sendMessage(data.friend.id, 'Found style, ' + query.data.name.en)
334 }).catch(query => {
335 if(query.statusCode === 404){
336 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.`);
337 }
338 });
339 }
340
341 if(command === 'help') {
342 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');
343 }
344
345 if(command === 'style') {
346 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Pick one of the styles the bot has currently: skull ghoul renegade");
347 if(args[1].toLowerCase() == "skull") {
348 try{
349 fortnite.party.me.setOutfit("/Game/Athena/Items/Cosmetics/Characters/cid_030_athena_commando_m_halloween.cid_030_athena_commando_m_halloween");
350
351 const variants = [{"item":"AthenaCharacter","channel":"Progressive","variant":"Stage3"},
352 {"item":"AthenaCharacter","channel":"ClothingColor","variant":"Mat1"}];
353
354 setOutfit(fortnite.party.me, "/Game/Athena/Items/Cosmetics/Characters/cid_030_athena_commando_m_halloween.cid_030_athena_commando_m_halloween", undefined, variants);
355 fortnite.communicator.sendMessage(data.friend.id, 'Skin set to skull trooper, the variant is set to PURPLE.');
356 } catch(err){
357 console.log(err);
358 }
359 }
360 if(args[1].toLowerCase() == "ghoul") {
361 try {
362 fortnite.party.me.setOutfit("/Game/Athena/Items/Cosmetics/Characters/cid_029_athena_commando_f_halloween.cid_029_athena_commando_f_halloween");
363 const variants = [{"item":"AthenaCharacter","channel":"Material","variant":"Mat3"}];
364 setOutfit(fortnite.party.me, "/Game/Athena/Items/Cosmetics/Characters/cid_029_athena_commando_f_halloween.cid_029_athena_commando_f_halloween", undefined, variants);
365 fortnite.communicator.sendMessage(data.friend.id, 'Skin set to ghoul trooper, variant set to PINK.');
366 }
367 catch(err){
368 console.log(err);
369 }
370 }
371 if(args[1].toLowerCase() == "renegade") {
372 const variants = [{"item":"AthenaCharacter","channel":"Material","variant":"Mat2"}];
373
374 setOutfit(fortnite.party.me, "/Game/Athena/Items/Cosmetics/Characters/CID_028_Athena_Commando_F.CID_028_Athena_Commando_F", undefined, variants);
375 fortnite.communicator.sendMessage(data.friend.id, "Skin set to Renegade Raider, the variant is on CHECKERED.");
376 }
377 else{
378 if(args[1].toLowerCase() == "renegade") {
379 return;
380 }
381 if(args[1].toLowerCase() == "ghoul") {
382 return;
383 }
384 if(args[1].toLowerCase() == "skull") {
385 return;
386 }
387 return fortnite.communicator.sendMessage(data.friend.id, "Thats not a correct value!");
388 }
389 } // Merged commands into one command.
390
391 if(data.message.startsWith('CID_')) {
392 if(data.message === 'CID_') return fortnite.communicator.sendMessage(data.friend.id, "Please mention a cid.");
393 try {
394 cid = args[0];
395 fortnite.party.me.setOutfit("/Game/Athena/Items/Cosmetics/Characters/" + args[0] + "." + args[0]);
396 eg.communicator.sendMessage(data.friend.id, "Skin set to " + args[0]);
397 }
398 catch(er) {
399 eg.communicator.sendMessage(data.friend.id, er);
400 }
401 }
402
403 if(data.message.startsWith('EID_')) {
404 if(data.message === 'EID_') return fortnite.communicator.sendMessage(data.friend.id, "Please mention a eid.");
405 try {
406 eid = args[0];
407 fortnite.party.me.clearEmote()
408 fortnite.party.me.setEmote("/Game/Athena/Items/Cosmetics/Dances/" + args[0] + "." + args[0]);
409 fortnite.communicator.sendMessage(data.friend.id, "Emote set to " + args[0]);
410 }
411 catch(er) {
412 fortnite.communicator.sendMessage(data.friend.id, er);
413 }
414 }
415
416 if(data.message.startsWith('Pickaxe_ID_')) {
417 if(data.message === 'Pickaxe_ID_') return fortnite.communicator.sendMessage(data.friend.id, "Please mention a pickaxe id.");
418 try {
419 pickaxe_id = args[0];
420 fortnite.party.me.setPickaxe("/Game/Athena/Items/Cosmetics/Pickaxes/" + args[0] + "." + args[0]);
421 fortnite.communicator.sendMessage(data.friend.id, "Pickaxe set to " + args[0]);
422 }
423 catch(err) {
424 fortnite.communicator.sendMessage(data.friend.id, err);
425 }
426 }
427
428 if(command === 'crash') {
429 try {
430 crash(); // Will make the bot unuseable
431 }
432 catch(err) {
433 fortnite.communicator.sendMessage(data.friend.id, err);
434 }
435 }
436
437 // Unused _
438
439 // if(command === 'stats') {
440 // if(!args[1]) return fortnite.communicator.sendMessage(data.friend.id, 'Mention a username.');
441 // try {
442 // let stats = await br.getStatsForPlayer(args[1]);
443 // fortnite.communicator.sendMessage(data.friend.id, stats);
444 // }
445 // catch(err){
446 // fortnite.communicator.sendMessage(data.friend.id, stats);
447 // }
448 // }
449 // Currently trying to find a way to show wins.
450
451 // Not working currently.
452
453
454 if(data.message.startsWith('BID_')) {
455 if(data.message === 'BID_') return fortnite.communicator.sendMessage(data.friend.id, "Please mention a bid id.");
456 try {
457 bid = args[0];
458 fortnite.party.me.setBackpack("/Game/Athena/Items/Cosmetics/Backpacks/" + args[0] + "." + args[0]);
459 fortnite.communicator.sendMessage(data.friend.id, "Backbling set to " + args[0]);
460 }
461 catch(err) {
462 fortnite.communicator.sendMessage(data.friend.id, err);
463 }
464 }
465
466
467 if(command === 'ltm') { // Idea by !minein4#0001
468 var partyleader = await eg.getProfile(current_party.leader.id);
469 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a playlist name.");
470 if(partyleader.displayName == eg.account.displayName) {
471 if(args[1].toLowerCase() == "50v50") {
472 fortnite.party.setPlaylist("50v50", 'Playlist_50v50').catch(err => console.log(err));
473 eg.communicator.sendMessage(data.friend.id, "Set playlist to 50v50");
474 }
475 if(args[1].toLowerCase() == "chameleon") {
476 fortnite.party.setPlaylist("Chameleon", 'Playlist_ChaCha').catch(err => console.log(err));
477 eg.communicator.sendMessage(data.friend.id, "Set playlist to Chameleon");
478 }
479 if(args[1].toLowerCase() == "arsenal") {
480 fortnite.party.setPlaylist("Arsenal", 'Playlist_Gungame_Reverse').catch(err => console.log(err));
481 eg.communicator.sendMessage(data.friend.id, "Set playlist to Arsenal");
482 }
483 if(args[1].toLowerCase() == "playground") {
484 fortnite.party.setPlaylist("Playground", 'Playlist_Playground').catch(err => console.log(err));
485 eg.communicator.sendMessage(data.friend.id, "Set playlist to Playground");
486 }
487 if(args[1].toLowerCase() == "arena") {
488 fortnite.party.setPlaylist("Arena", 'Playlist_ShowdownAlt_Trios').catch(err => console.log(err));
489 eg.communicator.sendMessage(data.friend.id, "Set playlist to Arena");
490 }
491 if(args[1].toLowerCase() == "tournament") {
492 fortnite.party.setPlaylist("Tournament", 'Playlist_ShowdownTesting_Duos').catch(err => console.log(err));
493 eg.communicator.sendMessage(data.friend.id, "Set playlist to Tournament");
494 }
495 if(args[1].toLowerCase() == "slide") {
496 fortnite.party.setPlaylist("Slide", 'Playlist_Slide_Squads').catch(err => console.log(err));
497 eg.communicator.sendMessage(data.friend.id, "Set playlist to Slide");
498 }
499 if(args[1].toLowerCase() == "tutorial") {
500 fortnite.party.setPlaylist("Tutorial", 'Playlist_Tutorial_1').catch(err => console.log(err));
501 eg.communicator.sendMessage(data.friend.id, "Set playlist to Tutorial");
502 }
503 if(args[1].toLowerCase() == "unvaulted") {
504 fortnite.party.setPlaylist("Unvaulted", 'Playlist_Tutorial_1').catch(err => console.log(err));
505 eg.communicator.sendMessage(data.friend.id, "Set playlist to Unvaulted");
506 }
507 if(args[1].toLowerCase() == "siphon") {
508 fortnite.party.setPlaylist("Siphon", 'Playlist_Vamp_Squad').catch(err => console.log(err));
509 eg.communicator.sendMessage(data.friend.id, "Set playlist to Siphon");
510 }
511 if(args[1].toLowerCase() == "bounty") {
512 fortnite.party.setPlaylist("Bounty", 'Playlist_Bounty_Squads').catch(err => console.log(err));
513 eg.communicator.sendMessage(data.friend.id, "Set playlist to Bounty");
514 }
515 if(args[1].toLowerCase() == "automatics") {
516 fortnite.party.setPlaylist("Automatics", 'Playlist_Auto_Duos').catch(err => console.log(err));
517 eg.communicator.sendMessage(data.friend.id, "Set playlist to Automatics");
518 }
519 if(args[1].toLowerCase() == "duos") {
520 fortnite.party.setPlaylist("Duos", 'Playlist_DefaultDuo').catch(err => console.log(err));
521 eg.communicator.sendMessage(data.friend.id, "Set playlist to Duos");
522 }
523 if(args[1].toLowerCase() == "solo") {
524 fortnite.party.setPlaylist("Solo", 'Playlist_DefaultSolo').catch(err => console.log(err));
525 eg.communicator.sendMessage(data.friend.id, "Set playlist to Solo");
526 }
527 if(args[1].toLowerCase() == "sqauds") {
528 fortnite.party.setPlaylist("Squads", 'Playlist_DefaultSquad').catch(err => console.log(err));
529 eg.communicator.sendMessage(data.friend.id, "Set playlist to Squads");
530 }
531 }
532 else {
533 eg.communicator.sendMessage(data.friend.id, `The party leader is ${partyleader.displayName}, not ${eg.account.displayName}`);
534 }
535 }
536
537 if(command === 'party') {
538 try {
539 members();
540 }
541 catch(err) {
542 fortnite.communicator.sendMessage(data.friend.id, err);
543 }
544 }
545
546 if(command === 'emoteall') {
547 let emoteid = args.slice(5).join(" ");
548 request({
549 url: 'http://benbotfn.tk:8080/api/cosmetics/search/multiple?displayName=' + emoteid,
550 json: true
551 }).then(query => {
552 Object.keys(query).forEach(function(key) {
553 if(query[key].type == "Emote") {
554 fortnite.party.me.setEmote("/Game/Athena/Items/Cosmetics/Dances/" + query[key].id + "." + query[key].id);
555 }
556 });
557 });
558 }
559
560
561 if(command === "skin") {
562 let skinname = args.slice(1).join(" ");
563 if (!skinname) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a skin name.");
564 request({
565 url: benbot + skinname,
566 json: true
567 }).then(query => {
568 try {
569 Object.keys(query).forEach(function(key) {
570 if(query[key].type == "Outfit") {
571 cid = query[key].id;
572 fortnite.party.me.setOutfit("/Game/Athena/Items/Cosmetics/Characters/" + query[key].id + "." + query[key].id);
573 fortnite.communicator.sendMessage(data.friend.id, "Found " + query[key].displayName + ', the id is ' + query[key].id);
574 }
575 });
576 }
577 catch(err) {
578 console.log(err);
579 }
580 });
581 }
582
583 if(command === "pickaxe") {
584 let pickaxe = args.slice(1).join(" ");
585 if (!pickaxe) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a pickaxe name.");
586 request({
587 url: benbot + pickaxe,
588 json: true
589 }).then(query => {
590 try {
591 Object.keys(query).forEach(function(key) {
592 if(query[key].type == "Harvesting Tool") {
593 pickaxe_id = query[key].id;
594 fortnite.party.me.setPickaxe("/Game/Athena/Items/Cosmetics/Pickaxes/" + query[key].id + "." + query[key].id);
595 fortnite.communicator.sendMessage(data.friend.id, "Found " + query[key].displayName + ', the id is ' + query[key].id);
596 }
597 });
598 }
599 catch(err) {
600 console.log(err);
601 }
602 });
603 }
604
605 if(command === "backbling") {
606 let backlingname = args.slice(1).join(" ");
607 if (!backlingname) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a backling name.");
608 request({
609 url: benbot + backlingname,
610 json: true
611 }).then(query => {
612 try {
613 Object.keys(query).forEach(function(key) {
614 if(query[key].type == "Back Bling") {
615 bid = query[key].id;
616 fortnite.party.me.setBackpack("/Game/Athena/Items/Cosmetics/Backpacks/" + query[key].id + "." + query[key].id);
617 fortnite.communicator.sendMessage(data.friend.id, "Found " + query[key].displayName + ', the id is ' + query[key].id);
618 }
619 });
620 }
621 catch(err) {
622 console.log(err);
623 }
624 });
625 }
626
627 if(command === "emote") {
628 let emotename = args.slice(1).join(" ");
629 if (!emotename) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a emote name.");
630 request({
631 url: benbot + emotename,
632 json: true
633 }).then(query => {
634 Object.keys(query).forEach(function(key) {
635 if(query[key].type == "Emote") {
636 eid = query[key].id;
637 fortnite.party.me.clearEmote()
638 fortnite.party.me.setEmote("/Game/Athena/Items/Cosmetics/Dances/" + query[key].id + "." + query[key].id);
639 fortnite.communicator.sendMessage(data.friend.id, "Found " + query[key].displayName + ', the id is ' + query[key].id);
640 }
641 });
642 });
643 }
644
645 if(command === "banner") {
646 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a banner name.");
647 if(args[1].toLowerCase() == "pewdiepie") {
648 fortnite.party.me.setBanner(Cosmetics.bannerlevel, Cosmetics.banner, Cosmetics.bannercolor);
649 }
650 try {
651 fortnite.party.me.setBanner(100, args[1], args[2]);
652 fortnite.communicator.sendMessage(data.friend.id, "Banner set to " + args[1] + " " + args[2]);
653 }
654 catch(err) {
655 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
656 }
657 }
658
659 if(command === "status") {
660 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a status.");
661 try {
662 var mess = data.message.replace("!status", "");
663 fortnite.communicator.updateStatus(mess);
664 fortnite.communicator.sendMessage(data.friend.id, 'Status set to ' + mess + "!");
665 }
666 catch(err) {
667 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
668 }
669 }
670
671 if(command === "playlist") {
672 var partyleader = await eg.getProfile(current_party.leader.id);
673 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a playlistName.");
674 if (!args[2]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a regionId.");
675 if(partyleader.displayName == eg.account.displayName) {
676 let lookup = args.slice(2).join(" ");
677 fortnite.party.setPlaylist(lookup, args[1]).catch(err => console.log(err));
678 eg.communicator.sendMessage(data.friend.id, "Set playlist to " + args[1] + " " + args[2]);
679 console.log(`[PARTY PLAYLIST] Set the playlist to "` + args[1] + `"`);
680 }
681 else {
682 eg.communicator.sendMessage(data.friend.id, `The party leader is ${partyleader.displayName}, not ${eg.account.displayName}`);
683 }
684 }
685
686 if(command === "ready") {
687 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention true/false.");
688 if(args[1].toLowerCase() == "true") {
689 fortnite.party.me.setReady(true);
690 fortnite.communicator.sendMessage(data.friend.id, "Ready!");
691 }
692 if(args[1].toLowerCase() == "false") {
693 fortnite.party.me.setReady(false);
694 fortnite.communicator.sendMessage(data.friend.id, "Unready!");
695 }
696 }
697
698 if(command === "platform") {
699 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a platform.");
700 try {
701 fortnite.party.me.setPlatform("EPlatform." + args[1]);
702 eg.communicator.sendMessage(data.friend.id, "Set Platform to " + args[1] + " !");
703 } catch {
704 eg.communicator.sendMessage(data.friend.id, "Please use !platform PLATFORM");
705 }
706 }
707
708 if(command === "lookup") {
709 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a epic display name.");
710 try {
711 let lookup = args.slice(1).join(" ");
712 const account = await eg.getProfile(lookup);
713 if(!account) return fortnite.communicator.sendMessage(data.friend.id, "That epic name must of been wrong.");
714 fortnite.communicator.sendMessage(data.friend.id, `${account.name}'s id is: ${account.id}.`);
715 }
716 catch(err) {
717 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
718 }
719 }
720
721 if(command === "promote") {
722 var partyleader = await eg.getProfile(current_party.leader.id);
723 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a party member's name.");
724 if(partyleader.displayName == eg.account.displayName) {
725 let lookup = args.slice(1).join(" ");
726 if(lookup === eg.account.name) return fortnite.communicator.sendMessage(data.friend.id, "You can't promote yourself!");
727 const account = await eg.getProfile(lookup);
728 if(!account) return fortnite.communicator.sendMessage(data.friend.id, "That epic name must of been wrong.");
729 const member = fortnite.party.findMember(account.id);
730 if(!member) return fortnite.communicator.sendMessage(data.friend.id, `${account.name} Wasn't found in the party.`);
731 fortnite.party.promote(account.id);
732 fortnite.communicator.sendMessage(data.friend.id, "Promoted " + account.name + '!');
733 }
734 else {
735 eg.communicator.sendMessage(data.friend.id, `The party leader is ${partyleader.displayName}, not ${eg.account.displayName}`);
736 }
737 }
738
739 if(command === "kick") {
740 var partyleader = await eg.getProfile(current_party.leader.id);
741 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a party member's name.");
742 if(partyleader.displayName == eg.account.displayName) {
743 let lookup = args.slice(1).join(" ");
744 if(lookup === eg.account.name) return fortnite.communicator.sendMessage(data.friend.id, "You can't kick yourself!");
745 const account = await eg.getProfile(lookup);
746 if(!account) return fortnite.communicator.sendMessage(data.friend.id, "That epic name must of been wrong.");
747 const partymember = fortnite.party.findMember(account.id);
748 if(!partymember) return fortnite.communicator.sendMessage(data.friend.id, `${account.name} Wasn't found in the party.`);
749 fortnite.party.kick(account.id);
750 fortnite.communicator.sendMessage(data.friend.id, "Kicked " + account.name + '!');
751 console.log(`[PARTY ACTIVITY] ${User.displayName} has been request to kick ${account.displayName} from the party.`);
752 }
753 else {
754 eg.communicator.sendMessage(data.friend.id, `The party leader is ${partyleader.displayName}, not ${eg.account.displayName}`);
755 }
756 }
757
758 if(command === "leave") {
759 try {
760 if (fortnite.party.members.length < 1) {
761 fortnite.communicator.sendMessage(data.friend.id, `The bot can't leave the party when theres nobody in it!`);
762 }
763 else {
764 fortnite.party.leave();
765 fortnite.communicator.sendMessage(data.friend.id, "The bot has left.");
766 }
767 }
768 catch(err) {
769 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
770 }
771 }
772
773 if(command === "friend") {
774 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a epic name to add.");
775 try {
776 let lookup = args.slice(1).join(" ");
777 if(lookup === eg.account.name) return fortnite.communicator.sendMessage(data.friend.id, "You can't friend yourself!");
778 const account = await eg.getProfile(lookup);
779 if(!account) return fortnite.communicator.sendMessage(data.friend.id, "That epic name must of been wrong.");
780 const isFriended = await eg.hasFriend(account.id);
781 if(isFriended) {
782 return fortnite.communicator.sendMessage(data.friend.id, `${account.name} is already friended.`);
783 }
784 eg.inviteFriend(account.id);
785 fortnite.communicator.sendMessage(data.friend.id, "Friended! " + account.name + '!');
786 }
787 catch(err) {
788 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
789 }
790 }
791
792 if(command === "privacy") {
793 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a vaild privacy name.");
794 try {
795 fortnite.party.setPrivacy(args[1])
796 fortnite.communicator.sendMessage(data.friend.id, "Privacy set to " + args[1] + '.');
797 } catch(err) {
798 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
799 }
800 }
801
802 if(command === "unfriend") {
803 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a epic name to unfriend.");
804 try {
805 let lookup = args.slice(1).join(" ");
806 if(lookup === eg.account.name) return fortnite.communicator.sendMessage(data.friend.id, "You can't unfriend yourself!");
807 const account = await eg.getProfile(lookup);
808 if(!account) return fortnite.communicator.sendMessage(data.friend.id, "That epic name must of been wrong.");
809 const isFriended = await eg.hasFriend(account.id);
810 if(isFriended) {
811 eg.removeFriend(account.id);
812 fortnite.communicator.sendMessage(data.friend.id, "Unfriended! " + account.name + '!');
813 }
814 else{
815 fortnite.communicator.sendMessage(data.friend.id, `${account.name} wasn't even friended.`);
816 }
817 }
818 catch(err) {
819 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
820 }
821 }
822
823 if(command === "removerequest") {
824 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a epic name to unfriend.");
825 try {
826 let lookup = args.slice(1).join(" ");
827 if(lookup === eg.account.name) return fortnite.communicator.sendMessage(data.friend.id, "You can't unfriend yourself!");
828 const account = await eg.getProfile(lookup);
829 if(!account) return fortnite.communicator.sendMessage(data.friend.id, "That epic name must of been wrong.");
830 eg.declineFriendRequest(account.id)
831 }
832 catch(err) {
833 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
834 }
835 }
836
837 if(command === "invite") {
838 if (!args[1]) return fortnite.communicator.sendMessage(data.friend.id, "Please mention a epic name to invite.");
839 try {
840 let lookup = args.slice(1).join(" ");
841 const account = await eg.getProfile(lookup);
842 if(!account) return fortnite.communicator.sendMessage(data.friend.id, "That epic name must of been wrong.");
843 const isFriended = await eg.hasFriend(account.id);
844 if(isFriended) {
845 const partymember = fortnite.party.findMember(account.id);
846 if(partymember) return fortnite.communicator.sendMessage(data.friend.id, `${account.name} Is in the party wahts da damn point.`);
847 if(lookup === eg.account.name) return fortnite.communicator.sendMessage(data.friend.id, "You can't invite yourself!");
848 fortnite.party.invite(account.id);
849 fortnite.communicator.sendMessage(data.friend.id, "Invited " + account.name + '!');
850 }
851 else{
852 fortnite.communicator.sendMessage(data.friend.id, `${account.name} wasn't even friended.`);
853 }
854 }
855 catch(err) {
856 fortnite.communicator.sendMessage(data.friend.id, "There was a error: " + err);
857 }
858 }
859
860 });
861
862 fortnite.communicator.updateStatus(config.Client.status);
863 });
864 }).catch(api => {
865 console.log('[Api Down] Currently the api for the netcl is down, Restarting and using backup netcl in, a few seconds');
866 const iferror = require('./netcl.js');
867 let run = iferror.run();
868 console.clear()
869 });
870 }
871 }