SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 1,325 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const EGClient = require('epicgames-client').Client;
  2. const Fortnite = require('epicgames-fortnite-client');
  3. const EInputType  = require('epicgames-client').EInputType;
  4.  
  5. var _ = require('lodash');
  6.  
  7. accountid = 'your bot accountID';
  8. status = 'status you want';
  9.  
  10. let eg = new EGClient({
  11.     email: 'email',
  12.     password: 'password',
  13.     debug: console.log
  14. });
  15.  
  16. (async _ => {
  17.    
  18.     var c_party;
  19.  
  20.     if(!await eg.init() || !await eg.login())
  21.         throw 'Cannot connect to Epic Games servers...';
  22.    
  23.     let communicator = eg.communicator;
  24.     let fortnite = await eg.runGame(Fortnite);
  25.    
  26.  
  27. // fortnite.
  28.     fortnite.communicator.updateStatus(status);
  29.  
  30.     communicator.on('friend:request', async data => {
  31.         if(data.friend.id != accountid){
  32.             eg.acceptFriendRequest(data.friend.id).then(async (ac_result) => {
  33.                 /*adding friend ops was seccessful*/
  34.             });
  35.         }
  36.     });
  37.  
  38.     fortnite.communicator.on('party:invitation', async invitation => {
  39.  
  40.         c_party = invitation.party;
  41.        
  42.         invitation.party.me.setBRCharacter('/Game/Athena/Items/Cosmetics/Characters/CID_029_Athena_Commando_F_Halloween.CID_029_Athena_Commando_F_Halloween');
  43.        
  44.         await invitation.accept();
  45.        
  46.         invitation.party.me.setBattlePass(true, 99999999, 99999999, 99999999);
  47.  
  48.     });
  49.  
  50.     fortnite.communicator.on('friend:message', async data => {
  51.  
  52.         if(data.message == 'help'){
  53.               communicator.sendMessage(data.friend.id, 'Commands: !skin, !emote, !backbling, !banner, !stop');
  54.         }
  55.        
  56.       var args = data.message.split(" ");
  57.  
  58.  
  59. // Updates the Status of the Bot
  60.       if (args[0] == "!status"){
  61. fortnite.communicator.updateStatus(args[1];
  62. }
  63.       if (args[0] == "!skin"){
  64.           c_party.members.forEach(async member => {
  65.               try{
  66.                     member.clearEmote(member.jid);
  67.                     member.setBRCharacter("/Game/Athena/Items/Cosmetics/Characters/" + args[1] + "." + args[1], member.jid);
  68.               }catch(e){
  69.                   communicator.sendMessage(data.friend.id, 'Cant set skin because it is invalid skin!');
  70.               }
  71.           });
  72.       }
  73.       if (args[0] == "!emote"){
  74.           c_party.members.forEach(async member => {
  75.               try{
  76.                     member.setEmote("/Game/Athena/Items/Cosmetics/Dances/" + args[1] + "." + args[1], member.jid);
  77.               }catch(e){
  78.                   communicator.sendMessage(data.friend.id, 'Cant set emote because it is invalid emote!');
  79.               }
  80.           });
  81.       }
  82.      
  83.       if (args[0] == "!backbling"){
  84.           c_party.members.forEach(async member => {
  85.               try{
  86.                     member.setBackpack("/Game/Athena/Items/Cosmetics/Backpacks/" + args[1] + "." + args[1], member.jid);
  87.               }catch(e){
  88.                   communicator.sendMessage(data.friend.id, 'Cant set backbling because it is invalid backbling!');
  89.               }
  90.           });
  91.       }
  92.      
  93.       if (args[0] == "!banner"){
  94.           c_party.members.forEach(async member => {
  95.               try{
  96.                     member.setBRBanner(args[1], args[2], 99999999, member.jid);
  97.               }catch(e){
  98.                   communicator.sendMessage(data.friend.id, 'Cant set banner because it is invalid banner!');
  99.               }
  100.           });
  101.       }
  102.        
  103.       if(args[0] == "!ready"){
  104.           if(args[1] == "on" || args[1] == "off") {
  105.              c_party.members.forEach(async member => {
  106.               try{
  107.                     member.setReady(args[1] == "on" ? true : false, member.jid);
  108.               }catch(e){
  109.                   communicator.sendMessage(data.friend.id, 'Cant set ready because it is unknown error!');
  110.               }
  111.              });
  112.           }else{
  113.               communicator.sendMessage(data.friend.id, 'Cant set ready because it is invalid swtich!');
  114.           }
  115.       }
  116.      
  117.       if(args[0] == "!stop"){
  118.         c_party.members.forEach(async member => {
  119.           member.clearEmote(member.jid);
  120.         });
  121.       }
  122.  
  123.     });
  124.  
  125.     /* rest of your code goes here */
  126.  
  127. })();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top