-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLSS_backalarm_standalone.user.js
42 lines (32 loc) · 1.13 KB
/
LSS_backalarm_standalone.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
// ==UserScript==
// @name Backalarm standalone
// @version 1.0
// @description Alle/RD zurückalarmieren
// @author Crazycake
// @match https://www.leitstellenspiel.de/missions/*
// @downloadURL https://github.com/Cr4zyc4k3/LSS/raw/main/LSS_backalarm_standalone.user.js
// @updateURL https://github.com/Cr4zyc4k3/LSS/raw/main/LSS_backalarm_standalone.user.js
// @grant none
// ==/UserScript==
'use strict';
let keysPressed ={};
//1 => Alle; 0 => RD
const backalarmAll = 0;
document.addEventListener('keydown', (event) => {
keysPressed[event.key] = true;
//Prevent executing while using some control keys
if (keysPressed['Control'] || keysPressed['Shift'] || keysPressed['Alt'] || keysPressed['AltGraph']) {
return;
}
else if(keysPressed['r'] && keysPressed['1'])
{
if(backalarmAll) {
document.querySelectorAll("a[href$='/backalarmAll']")[0]?.click();
return;
}
document.querySelectorAll("a[href$='/backalarmRettungsdienst']")[0]?.click();
}
});
document.addEventListener('keyup', (event) => {
delete keysPressed[event.key];
});