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 EInputType = require('epicgames-client').EInputType;
- var = require('lodash');
- accountid = 'your bot accountID';
- status = 'status you want';
- let eg = new EGClient({
- email: 'email',
- password: 'password',
- debug: console.log
- });
- (async => {
- if(!await eg.init() || !await eg.login())
- throw 'Cannot connect to Epic Games servers...';
- let communicator = eg.communicator;
- let fortnite = await eg.runGame(Fortnite);
- communicator.updateStatus(status);
- communicator.on('friend:request', async data => {
- if(data.friend.id != accountid){
- eg.acceptFriendRequest(data.friend.id).then(async (ac_result) => {
- /adding friend ops was seccessful/
- });
- }
- });
- fortnite.communicator.on('party:invitation', async invitation => {
- invitation.party.me.setBRCharacter('/Game/Athena/Items/Cosmetics/Characters/CID_029_Athena_Commando_F_Halloween.CID_029_Athena_Commando_F_Halloween');
- await invitation.accept();
- invitation.party.me.setBattlePass(true, level, xp,otherxp);
- });
- fortnite.communicator.on('friend:message', async data => {
- if(data.message == 'ping'){
- communicator.sendMessage(data.friend.id, 'pong');
- }
- });
- 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");
- }})
- });
- })();
Add Comment
Please, Sign In to add comment