Skip to content

Instantly share code, notes, and snippets.

@MisterX2000
Last active March 14, 2024 21:37
Show Gist options
  • Save MisterX2000/c0216521e6f419126034d53941720b5c to your computer and use it in GitHub Desktop.
Save MisterX2000/c0216521e6f419126034d53941720b5c to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name LSS - Custom Design
// @description Custom design for Leitstellenspiel
// @version 0.5
// @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)\/.*$/
// @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;
}
`);
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment