forked from RMzModShop/smart-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloader.user.js
60 lines (50 loc) · 3.07 KB
/
loader.user.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
// ==UserScript==
// @name RageLoader
// @namespace RageLoader
// @description Grabs latest versions of the bot scripts automatically.
// @include http://agar.io/
// @version 1
// @grant none
// @editor http://youtube.com/Ragemoddzz
// ==/UserScript==
var rageLoaderVersion = 1;
var sha = "efde0488cc2cc176db48dd23b28a20b90314352b";
function getLatestCommit() {
window.jQuery.ajax({
url: "https://api.github.com/repos/rmzmodshop/smart-bot/git/refs/heads/master",
cache: false,
dataType: "jsonp"
}).done(function(data) {
console.dir(data["data"])
console.log("hmm: " + data["data"]["object"]["sha"]);
sha = data["data"]["object"]["sha"];
;
window.jQuery.get('https://raw.githubusercontent.com/rmzmodshop/smart-bot/master/launcher.user.js?' + Math.floor((Math.random() * 1000000) + 1), function(data) {
var latestVersion = data.replace(/(\r\n|\n|\r)/gm, "");
latestVersion = latestVersion.substring(latestVersion.indexOf("// @version") + 11, latestVersion.indexOf("// @grant"));
latestVersion = parseFloat(latestVersion + 0.0000);
var script1 = "https://cdn.rawgit.com/rmzmodshop/smart-bot/" + sha + "/launcher.user.js";
console.log("Script: " + script1);
window.jQuery("body").append('<script type="text/javascript" src="' + script1 + '"></script>');
});
window.jQuery.get('https://raw.githubusercontent.com/rmzmodshop/smart-bot/master/bot.user.js?' + Math.floor((Math.random() * 1000000) + 1), function(data) {
var latestVersion = data.replace(/(\r\n|\n|\r)/gm, "");
latestVersion = latestVersion.substring(latestVersion.indexOf("// @version") + 11, latestVersion.indexOf("// @grant"));
latestVersion = parseFloat(latestVersion + 0.0000);
var script2 = "https://cdn.rawgit.com/rmzmodshop/smart-bot/" + sha + "/bot.user.js";
console.log("Script: " + script2);
window.jQuery("body").append('<script type="text/javascript" src="' + script2 + '"></script>');
});
window.jQuery.get('https://raw.githubusercontent.com/rmzmodshop/smart-bot/master/loader.user.js?' + Math.floor((Math.random() * 1000000) + 1), function(data) {
var latestVersion = data.replace(/(\r\n|\n|\r)/gm, "");
latestVersion = latestVersion.substring(latestVersion.indexOf("// @version") + 11, latestVersion.indexOf("// @grant"));
latestVersion = parseFloat(latestVersion + 0.0000);
var myVersion = parseFloat(rageLoaderVersion + 0.0000);
if (latestVersion > myVersion) {
update("rageLoader", "loader.user.js", "https://github.com/rmzmodshop/smart-bot/blob/master/loader.user.js/");
}
console.log('Current loader.user.js Version: ' + myVersion + " on Github: " + latestVersion);
});
}).fail(function() {});
}
getLatestCommit();