Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const EGClient = require('epicgames-client').Client;
- const fortnite = require('epicgames-fortnite-client');
- const Discord = require("discord.js")
- const bot = new Discord.Client()
- client.on('message', msg => {
- if (msg.content === 'ping') {
- msg.reply('Pong!');
- }
- });
- client.login('NTY5NTM3MjUwMDExMTE5NjE5.XLyFIw.qccAZIjE0uyINdcIhCa69AufQvs');
- const Fortnite = require('epicgames-fortnite-client');
- const { ESubGame } = Fortnite;
- let activeparty;
- const jid = "322accaecfbb44b7a952f845cf77f046@prod.ol.epicgames.com"
- let eg = new EGClient({
- email: 'isadasdasdom',
- password: 'Fedasdsadsad10'
- });
- //const member = EGClient
- eg.init().then(async (success) => {
- if (!success)
- throw new Error('Cannot initialize EpicGames launcher')
- if (!await eg.login())
- throw ('Error while initialize or login process.');
- console.log("logged in")
- const fortnite = await eg.runGame(Fortnite);
- const br = await fortnite.runSubGame(ESubGame.BattleRoyale)
- let xd = await br.getPlaylist(true);
- console.log("Playlists Loaded");
- const party = await fortnite.communicator.makeParty({
- typeId: 286331153,
- appId: "MzQ0NmNkNzI2OTRjNGE0NDg1ZDgxYjc3YWRiYjIxNDE6OTIwOWQ0YTVlMjVhNDU3ZmI5YjA3NDg5ZDMxM2I0MWE",
- buildId: "ZWM2ODRiOGM2ODdmNDc5ZmFkZWEzY2IyYWQ4M2Y1YzY6ZTFmMzFjMjExZjI4NDEzMTg2MjYyZDM3YTEzZmM4NGQ",
- });
- fortnite.communicator.on("friend:request", request => {
- console.log("Friend Request Accepted")
- request.accept()
- })
- fortnite.communicator.on("party:invitation", invitation => {
- invitation.accept()
- console.log("The invitation was accepted")
- activeparty = invitation.party;
- })
- fortnite.communicator.on("party:member:data", async data => {
- //console.log(data);
- //member.setBrBanner(, )
- eg.communicator.on('friend:message', async data => {
- let author = await eg.getProfile(data.friend.id);
- let emotemessage;
- let skinmessage;
- let backmessage;
- let id = data.friend.id;
- console.log(author.displayName + ': ' + data.message);
- // Message reader^
- let args = data.message.split(" ");
- let command = args[0];
- let cosmeticid = args[1];
- let passLevel = args[1];
- if(command == "!play"){
- activeparty.members.forEach(async member => {
- emotemessage = cosmeticid;
- member.setEmote("/Game/Athena/Items/Cosmetics/Dances/" + "EID_" + emotemessage + "." + "EID_" + emotemessage, member.jid);
- })
- }
- else if (command == "!skin"){
- activeparty.members.forEach(async member => {
- skinmessage = cosmeticid;
- member.setBRCharacter("/Game/Athena/Items/Cosmetics/Characters/" + skinmessage + "." + skinmessage, member.jid);
- })
- }
- else if (command == "!stop"){
- activeparty.members.forEach(async member => {
- member.clearEmote(member.jid)
- })
- }
- else if (command == "!level"){
- activeparty.members.forEach(async member => {
- passmessage = passLevel;
- member.setBattlePass(true, passmessage, passmessage, passmessage, member.jid)
- console.log("set level to" + " " + passmessage)
- })}
- else if (command == "!back"){
- activeparty.members.forEach(async member => {
- backmessage = cosmeticid;
- member.setBackpack("/Game/Athena/Items/Cosmetics/Characters/" + backmessage + "." + "/Game/Athena/Items/Cosmetics/Characters/" + backmessage, member.jid);
- })
- }
- else{
- fortnite.communicator.sendMessage(id, "Insert an emote or skin please");
- }})
- fortnite.communicator.on('friend:message', async data => {
- data.reply('hi');
- })
- })})
Add Comment
Please, Sign In to add comment