major update/remote host the JS and user loader
This commit is contained in:
51
GrepoRemoteLoader.user.js
Normal file
51
GrepoRemoteLoader.user.js
Normal file
@@ -0,0 +1,51 @@
|
||||
// ==UserScript==
|
||||
// @name Grepolis Remote Loader
|
||||
// @namespace http://tampermonkey.net/
|
||||
// @version 4.0.0
|
||||
// @description Dynamically loads the Grepolis Remote Control bot from the server
|
||||
// @author Dimitrios
|
||||
// @match https://*.grepolis.com/game/*
|
||||
// @grant unsafeWindow
|
||||
// @grant GM_xmlhttpRequest
|
||||
// @connect grepo.haunter-pets.top
|
||||
// @updateURL https://git.haunter-pets.top/haunter/grepo-remote/raw/branch/main/GrepoRemoteLoader.user.js
|
||||
// @downloadURL https://git.haunter-pets.top/haunter/grepo-remote/raw/branch/main/GrepoRemoteLoader.user.js
|
||||
// ==/UserScript==
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
|
||||
// Set to your VPS domain
|
||||
const BASE_URL = 'https://grepo.haunter-pets.top';
|
||||
|
||||
function loadBot() {
|
||||
console.log('[Loader] Fetching bot code from server...');
|
||||
|
||||
GM_xmlhttpRequest({
|
||||
method: 'GET',
|
||||
url: `${BASE_URL}/api/bot?t=${Date.now()}`,
|
||||
onload: function(response) {
|
||||
if (response.status === 200) {
|
||||
console.log('[Loader] Bot code downloaded successfully! Executing...');
|
||||
try {
|
||||
eval(response.responseText);
|
||||
} catch (e) {
|
||||
console.error('[Loader] Error executing bot code:', e);
|
||||
}
|
||||
} else {
|
||||
console.error('[Loader] Failed to download bot. Server returned:', response.status);
|
||||
}
|
||||
},
|
||||
onerror: function(err) {
|
||||
console.error('[Loader] Connection error while trying to reach the server.', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Wait for page to be ready before loading the heavy bot logic
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', loadBot);
|
||||
} else {
|
||||
loadBot();
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user