This repository has been archived by the owner on Apr 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
74 lines (61 loc) · 1.87 KB
/
test.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
const r6info = require('api.js');
// Create a Ubisoft authorization
const api = r6info.generateAPIHook({
email: ",",
password: ",",
});
async function lookup(){
// Get the 'hook' object forr Spoit.KOI
let hook = await api.hookPlayerById({
id: 'cc3a555f-97fa-49e3-a7b4-f592d23e66fe'
});
/** LOOKUP **/
// Find what platforms the player is on
let platforms = await api.findPlatforms(hook);
console.log(platforms);
// Find what applications they own (Not 100% accurate, only includes Ubisoft applications)
let applications = await api.getAllApplications(hook);
console.log(applications);
// Find their smurfs
let smurfs = await api.getSmurfs(hook);
console.log(smurfs);
// Get their detailed statistics
let statistics = await api.getStatistics(hook);
console.log(statistics);
// Check if they have the default pfp
let hasDefaultPFP = await api.hasDefaultPFP(hook);
console.log(hasDefaultPFP);
/** PROFILING **/
// Fetch his basic stats to get a 'profile' object. You can use generateDetailedProfile() to get more info with the same arguments.
let profile = await api.generateSimpleProfile(hook, {debug:true});
console.log(profile);
// Rate the likelihood they are cheating
let rating = await api.calculateRating(profile);
console.log(rating);
}
lookup();
/**
A simple program that:
- Reads console input
- Calls for profile
- Checks if they are cheating
- Prints both results
searches for a Uplay account and rates the chance they are cheating
**/
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
rl.on('line', (username) => {
api.hookPlayer({
platform: 'uplay',
username
}).then((hook)=>{
api.generateSimpleProfile(hook).then((player)=>{
api.calculateRating(player).then((rating)=>{
console.log(player, rating);
});
});
}).catch(err => console.log(err));
});