-
Notifications
You must be signed in to change notification settings - Fork 1
/
tampermonkey-front-end-inject-for-auto-training.js
50 lines (38 loc) · 1.4 KB
/
tampermonkey-front-end-inject-for-auto-training.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
// ==UserScript==
// @name LOCALHOST TRAIN JS CLUB
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://room1.jsclub.me/*
// @match https://room2.jsclub.me/*
// @match https://room3.jsclub.me/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=jsclub.me
// @grant none
// ==/UserScript==
(function() {
'use strict';
if (window.location.href.includes('https://room1.jsclub.me/training/register')) {
setTimeout(() => document.getElementById('btn-register').click(), 5000)
setTimeout(function() {
let url = window.location.href;
let a = url.split('/')
let b = a[a.length - 1]
document.getElementById('map').value='training_map_1'
console.log(b)
fetch('http://localhost:5555?game_id=' + b)
fetch('http://localhost:5001?game_id=' + b)
}, 1000)
}
if (window.location.href.includes('https://room1.jsclub.me/training/stage')) {
const endgame = () => {document.location.href = 'https://room1.jsclub.me/training/login'}
document.addEventListener('keypress', (e) => {
if (e.key === '`') {
endgame()
}
});
setTimeout(function () {
endgame()
}, 1000 * 60 * 5);
}
})();