Last active
February 13, 2025 21:31
-
-
Save MisterX2000/c0216521e6f419126034d53941720b5c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name LSS - Custom Design | |
// @description Custom design for Leitstellenspiel | |
// @version 0.6.1 | |
// @author Mister X | |
// @namespace https://gist.github.com/MisterX2000 | |
// @homepageURL https://gist.github.com/MisterX2000/c0216521e6f419126034d53941720b5c | |
// @updateURL https://gist.github.com/MisterX2000/c0216521e6f419126034d53941720b5c/raw/LSS-CustomDesign.user.js | |
// @downloadURL https://gist.github.com/MisterX2000/c0216521e6f419126034d53941720b5c/raw/LSS-CustomDesign.user.js | |
// @include /^https?:\/\/[www.]*(?:leitstellenspiel\.de|missionchief\.co\.uk|missionchief\.com|meldkamerspel\.com|centro-de-mando\.es|missionchief-australia\.com|larmcentralen-spelet\.se|operatorratunkowy\.pl|operatore112\.it|operateur112\.fr|dispetcher112\.ru|alarmcentral-spil\.dk|nodsentralspillet\.com|operacni-stredisko\.cz|jogo-operador112\.com|operador193\.com|dyspetcher101-game\.com|missionchief-japan\.com|missionchief-korea\.com|jocdispecerat112\.com|hatakeskuspeli\.com|dispecerske-centrum\.com)\/.*$/ | |
// @require https://git.io/waitForKeyElements.js | |
// @grant GM_addStyle | |
// ==/UserScript== | |
GM_addStyle(` | |
.panel-heading { | |
padding-left: .5rem !important; | |
} | |
*::-webkit-scrollbar { | |
width: 6px !important; | |
} | |
*::-webkit-scrollbar-thumb { | |
background-color: #c2c2c2 !important; | |
} | |
*::-webkit-scrollbar-track { | |
background-color: #767676 !important; | |
} | |
*::-webkit-scrollbar-thumb:active { | |
background-color: #fff !important; | |
} | |
body.bigMap #missions_outer, body.bigMap #buildings_outer, body.bigMap #chat_outer, body.bigMap #radio_outer { | |
padding: 0 0 0 5px !important; | |
} | |
`); | |
if (window.top === window.self) { | |
window.addEventListener('load', function () { | |
// Hire Button | |
building_panel_heading = document.querySelector("#building-list-header-buttons") | |
let btn_hire = document.createElement("a"); | |
btn_hire.innerHTML = "Hire All"; | |
btn_hire.className = "btn btn-xs btn-primary"; | |
btn_hire.addEventListener("click", hire_all_staff); | |
building_panel_heading.appendChild(btn_hire); | |
function hire_all_staff() { | |
let buildings = document.querySelectorAll('*[id^="building_button_"]'); | |
for (const b of buildings) { | |
let building_type = b.getAttribute('building_type'); | |
let href = b.getAttribute("href"); | |
// ignore building_hospital & building_leitstelle | |
if (building_type == '4') { | |
console.log('NOT ' + href); | |
continue; | |
} | |
else if (building_type == '7') { | |
leitstelle = b; | |
console.log('NOT ' + href); | |
continue; | |
} | |
console.log(href); | |
fetch(href + '/hire_do/3'); | |
} | |
window.open(leitstelle.getAttribute("href") + '#tab_buildings', '_blank').focus(); | |
} | |
}, false); | |
} | |
// ============================== EASTER EGG BUTTON ============================== | |
function eegg(where) { | |
const easterEggButton = where.getElementById("easter-egg-link"); | |
if (easterEggButton) { | |
easterEggButton.click(); | |
console.log("🎯 Easter Egg button clicked!"); | |
} else { | |
console.log("⚠️ Easter Egg button not found in: ", where); | |
} | |
} | |
waitForKeyElements("#lssmv4-redesign-lightbox-iframe, frame", function(elem) { | |
elem.addEventListener("load", function () { | |
elem.removeAttribute("wfke_found"); | |
}); | |
try { | |
eegg(elem.contentDocument); // Run inside the iframe | |
} catch (e) { | |
console.warn("❌ Cannot access iframe: ", e); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name LSS - OneKey & Copy Clipboad | |
// @version 1.1.0 | |
// @description Alamieren mit einer Taste & Einsatztitel in Clipboad kopieren | |
// @author Mister X | |
// @namespace https://gist.github.com/MisterX2000 | |
// @homepageURL https://gist.github.com/MisterX2000/c0216521e6f419126034d53941720b5c | |
// @match https://www.leitstellenspiel.de/missions/* | |
// @grant GM_setClipboard | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Define key-AAO mappings | |
var keyMappings = { | |
96: '54133198', // Num0 -> LF | |
97: '54132900', // Num1 -> HLF | |
100: '54132802', // Num4 -> DLK | |
103: '54132814', // Num7 -> ELW1 | |
104: '54132952', // Num8 -> FustW | |
101: '54133175', // Num5 -> FustW DGL | |
98: '54132818', // Num2 -> RTW + NEF oder NAW | |
105: '54132803', // Num9 -> RTW | |
102: '54132818', // Num6 -> NEF | |
99: '54132818', // Num3 -> | |
110: '54133181', // Num, -> RTW + RTH | |
}; | |
$(document).keydown(function(e) { | |
if (keyMappings.hasOwnProperty(e.keyCode)) { | |
e.preventDefault(); | |
var aao_id = keyMappings[e.keyCode]; | |
var aaoElement = $('#aao_' + aao_id); | |
if (aaoElement.length) { | |
aaoElement[0].click(); | |
} | |
} else if (e.keyCode === 13) { | |
e.preventDefault(); | |
$("input[name^='commit']")[0].click(); | |
} | |
}); | |
const missionTitle = document.getElementById("missionH1").childNodes[2].nodeValue.trim(); | |
GM_setClipboard(missionTitle, "text"); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment