Advertisement
jose89fcb

Codigo para discord

Jun 29th, 2024
783
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let wpRequire;
  2. window.webpackChunkdiscord_app.push([[ Math.random() ], {}, (req) => { wpRequire = req; }]);
  3.  
  4. let ApplicationStreamingStore, RunningGameStore, QuestsStore, ExperimentStore, FluxDispatcher, api
  5. if(window.GLOBAL_ENV.SENTRY_TAGS.buildId === "366c746173a6ca0a801e9f4a4d7b6745e6de45d4") {
  6.     ApplicationStreamingStore = Object.values(wpRequire.c).find(x => x?.exports?.default?.getStreamerActiveStreamMetadata).exports.default;
  7.     RunningGameStore = Object.values(wpRequire.c).find(x => x?.exports?.default?.getRunningGames).exports.default;
  8.     QuestsStore = Object.values(wpRequire.c).find(x => x?.exports?.default?.getQuest).exports.default;
  9.     ExperimentStore = Object.values(wpRequire.c).find(x => x?.exports?.default?.getGuildExperiments).exports.default;
  10.     FluxDispatcher = Object.values(wpRequire.c).find(x => x?.exports?.default?.flushWaitQueue).exports.default;
  11.     api = Object.values(wpRequire.c).find(x => x?.exports?.getAPIBaseURL).exports.HTTP;
  12. } else {
  13.     ApplicationStreamingStore = Object.values(wpRequire.c).find(x => x?.exports?.Z?.getStreamerActiveStreamMetadata).exports.Z;
  14.     RunningGameStore = Object.values(wpRequire.c).find(x => x?.exports?.ZP?.getRunningGames).exports.ZP;
  15.     QuestsStore = Object.values(wpRequire.c).find(x => x?.exports?.Z?.getQuest).exports.Z;
  16.     ExperimentStore = Object.values(wpRequire.c).find(x => x?.exports?.Z?.getGuildExperiments).exports.Z;
  17.     FluxDispatcher = Object.values(wpRequire.c).find(x => x?.exports?.Z?.flushWaitQueue).exports.Z;
  18.     api = Object.values(wpRequire.c).find(x => x?.exports?.tn?.get).exports.tn;
  19. }
  20.  
  21. let quest = [...QuestsStore.quests.values()].find(x => x.userStatus?.enrolledAt && !x.userStatus?.completedAt && new Date(x.config.expiresAt).getTime() > Date.now())
  22. let isApp = navigator.userAgent.includes("Electron/")
  23. if(!isApp) {
  24.     console.log("This no longer works in browser. Use the desktop app!")
  25. } else if(!quest) {
  26.     console.log("You don't have any uncompleted quests!")
  27. } else {
  28.     const pid = Math.floor(Math.random() * 30000) + 1000
  29.    
  30.     let applicationId, applicationName, secondsNeeded, secondsDone, canPlay
  31.     if(quest.config.configVersion === 1) {
  32.         applicationId = quest.config.applicationId
  33.         applicationName = quest.config.applicationName
  34.         secondsNeeded = quest.config.streamDurationRequirementMinutes * 60
  35.         secondsDone = quest.userStatus?.streamProgressSeconds ?? 0
  36.         canPlay = quest.config.variants.includes(2)
  37.     } else if(quest.config.configVersion === 2) {
  38.         applicationId = quest.config.application.id
  39.         applicationName = quest.config.application.name
  40.         canPlay = ExperimentStore.getUserExperimentBucket("2024-04_quest_playtime_task") > 0 && quest.config.taskConfig.tasks["PLAY_ON_DESKTOP"]
  41.         const taskName = canPlay ? "PLAY_ON_DESKTOP" : "STREAM_ON_DESKTOP"
  42.         secondsNeeded = quest.config.taskConfig.tasks[taskName].target
  43.         secondsDone = quest.userStatus?.progress?.[taskName]?.value ?? 0
  44.     }
  45.  
  46.     if(canPlay) {
  47.         api.get({url: `/applications/public?application_ids=${applicationId}`}).then(res => {
  48.             const appData = res.body[0]
  49.             const exeName = appData.executables.find(x => x.os === "win32").name.replace(">","")
  50.            
  51.             const games = RunningGameStore.getRunningGames()
  52.             const fakeGame = {
  53.                 cmdLine: `C:\\Program Files\\${appData.name}\\${exeName}`,
  54.                 exeName,
  55.                 exePath: `c:/program files/${appData.name.toLowerCase()}/${exeName}`,
  56.                 hidden: false,
  57.                 isLauncher: false,
  58.                 id: applicationId,
  59.                 name: appData.name,
  60.                 pid: pid,
  61.                 pidPath: [pid],
  62.                 processName: appData.name,
  63.                 start: Date.now(),
  64.             }
  65.             games.push(fakeGame)
  66.             FluxDispatcher.dispatch({type: "RUNNING_GAMES_CHANGE", removed: [], added: [fakeGame], games: games})
  67.            
  68.             let fn = data => {
  69.                 let progress = data.userStatus.streamProgressSeconds
  70.                 console.log(`Quest progress: ${progress}/${secondsNeeded}`)
  71.                
  72.                 if(progress >= secondsNeeded) {
  73.                     console.log("Quest completed!")
  74.                    
  75.                     const idx = games.indexOf(fakeGame)
  76.                     if(idx > -1) {
  77.                         games.splice(idx, 1)
  78.                         FluxDispatcher.dispatch({type: "RUNNING_GAMES_CHANGE", removed: [fakeGame], added: [], games: []})
  79.                     }
  80.                     FluxDispatcher.unsubscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
  81.                 }
  82.             }
  83.             FluxDispatcher.subscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
  84.            
  85.             console.log(`Spoofed your game to ${applicationName}. Wait for ${Math.ceil((secondsNeeded - secondsDone) / 60)} more minutes.`)
  86.         })
  87.     } else {
  88.         let realFunc = ApplicationStreamingStore.getStreamerActiveStreamMetadata
  89.         ApplicationStreamingStore.getStreamerActiveStreamMetadata = () => ({
  90.             id: applicationId,
  91.             pid,
  92.             sourceName: null
  93.         })
  94.        
  95.         let fn = data => {
  96.             let progress = data.userStatus.streamProgressSeconds
  97.             console.log(`Quest progress: ${progress}/${secondsNeeded}`)
  98.            
  99.             if(progress >= secondsNeeded) {
  100.                 console.log("Quest completed!")
  101.                
  102.                 ApplicationStreamingStore.getStreamerActiveStreamMetadata = realFunc
  103.                 FluxDispatcher.unsubscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
  104.             }
  105.         }
  106.         FluxDispatcher.subscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn)
  107.        
  108.         console.log(`Spoofed your stream to ${applicationName}. Stream any window in vc for ${Math.ceil((secondsNeeded - secondsDone) / 60)} more minutes.`)
  109.         console.log("Remember that you need at least 1 other person to be in the vc!")
  110.     }
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement