-
Notifications
You must be signed in to change notification settings - Fork 0
/
alpha_open_lootbox.js
83 lines (80 loc) · 2.7 KB
/
alpha_open_lootbox.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
76
77
78
79
80
81
82
83
function getLootBox() {
var openLootBoxRequest = {
url: "https://minealpha.net/api/user/openLootBox",
headers: {
Cookie: $persistentStore.read("AlphaNetworkCookie"),
"User-Agent":
"Mozilla/5.0 (iPhone; CPU iPhone OS 16_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148[jhsggiusfguiys784i4s763yggfyustfwgyu2768fevuyer,1.0]",
},
};
$httpClient.get(openLootBoxRequest, function (error, response, data) {
if (error) {
$notification.post("α Network LootBox 連線錯誤‼️", "", "");
$done();
} else {
if (response.status == 200) {
let obj = JSON.parse(data);
if (obj["Succeeded"]) {
var reward = obj["RewardText"];
$notification.post("α Network LootBox ✅", "", reward);
suc = true;
$done();
} else {
console.log(obj["ErrorMessage"]);
$done();
}
} else {
$notification.post("α Network LootBox 請求失敗‼️", "", "");
$done();
}
}
});
}
function skipAds() {
var adWatchRequest = {
url: "https://minealpha.net/api/user/adWatched",
headers: {
Cookie: $persistentStore.read("AlphaNetworkCookie"),
"User-Agent":
"Mozilla/5.0 (iPhone; CPU iPhone OS 16_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148[jhsggiusfguiys784i4s763yggfyustfwgyu2768fevuyer,1.0]",
},
};
$httpClient.get(adWatchRequest, function (error, response, data) {
if (error) {
$notification.post("α Network adWatch 連線錯誤‼️", "", "");
$done();
} else {
if (response.status == 200) {
let obj = JSON.parse(data);
if (obj["Succeeded"]) {
var reward = obj["RewardText"];
$notification.post("α Network ADWatch ✅", "", reward);
$done();
} else {
console.log(obj["ErrorMessage"]);
$done();
}
} else {
$notification.post("α Network adWatch 失敗‼️", "", "");
$done();
}
}
});
}
function sleep(milliseconds) {
var start = new Date().getTime();
while(1)
if ((new Date().getTime() - start) > milliseconds)
break;
}
skipAds();
var suc = false;
var limit = 0;
while(!suc) {
getLootBox();
sleep(1000);
limit = limit + 1;
if (limit == 10)
break;
}
skipAds();