This repository has been archived by the owner on Mar 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.js
75 lines (65 loc) · 2.22 KB
/
run.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// https://ricovz.com/
// Riot X Arcane game: Instant Rewards Unlock.
// Follow the README.md for instructions.
// Credits: Rico, Duong & CoPilot. (:
// Language: Javascript, run in browser console.
const lang = window.location.toString().split('/')[3];
const uri = "https://xp1missions.riotgames.com";
function parseMissions() {
let request = new XMLHttpRequest()
request.open("GET", `${uri}/xp1missions/v1/missions/${lang}`, false)
request.withCredentials = true;
request.send();
let response = request.responseText;
let missions = JSON.parse(response);
return missions;
}
function grabToken(missionID) {
let preStringify = {
"mission_uid": missionID
}
let stringify = JSON.stringify(preStringify)
let request = new XMLHttpRequest()
request.open("POST", `${uri}/xp1missions/v1/generateToken/${lang}`, false)
request.withCredentials = true;
request.send(stringify);
let response = request.responseText;
let token = JSON.parse(response).token;
return token;
}
function pushMission(missionID) {
let token = grabToken(missionID);
let preStringify = {
"mission_uid": missionID,
"token": token
}
let stringify = JSON.stringify(preStringify)
let request = new XMLHttpRequest()
console.log("[💌] Attempting to push mission as completed...\n")
request.open("POST", `${uri}/xp1missions/v1/completeMission/${lang}`, false)
request.withCredentials = true;
request.send(stringify);
let response = request.responseText;
let mission = JSON.parse(response);
console.log("[💚] Pushed mission as finished.\n")
return mission;
}
function unlockAll() {
while (true) {
let allMissions = parseMissions().available_missions;
let x = 0;
allMissions.forEach((mission) => {
if (mission.mission_type == "simple_interactive") {
pushMission(mission.uid);
x += 1;
}
});
if (x == 0) {
break;
}
}
location.reload()
}
console.log("[💙] Starting script...\n")
console.log("[💙] Please be patient, this might take a bit...\n")
unlockAll();