Compare commits
92 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6b7008e2c7 | |||
| 13b2c5b265 | |||
| ad2c6bae21 | |||
| 94efbc9bad | |||
| 1327a4f52b | |||
| 700d2b21d9 | |||
| a0521d8299 | |||
| 6361749e0d | |||
| 729fe6c857 | |||
| bbdde391ae | |||
| d9d2ed799f | |||
| 9ab4be8f1a | |||
| 443539d9ed | |||
| be5a7ff61d | |||
| 39fe750cc0 | |||
| a266c208c5 | |||
| 1e605b01dd | |||
| 9cb3c40e90 | |||
| b900993fea | |||
| 9bf82dee21 | |||
| 87d19156a3 | |||
| f7886678c4 | |||
| a6ffa303a2 | |||
| d6fbec51db | |||
| c05df83bf6 | |||
| a39e55f04a | |||
| a5ab7bd80f | |||
| 4a29d9d4d4 | |||
| 5435c440ec | |||
| 1d1fe5f9f6 | |||
| c7f627f392 | |||
| b340b7c73d | |||
| ed8ace3876 | |||
| 120dd7e484 | |||
| 1947d7180e | |||
| 60f672bf97 | |||
| dadca832ce | |||
| 43d0da95b2 | |||
| 178d847871 | |||
| 27f1319162 | |||
| 8224bd00f3 | |||
| 9d3dd45181 | |||
| c25c4fe5e9 | |||
| 9de498b739 | |||
| b24f0dd1e3 | |||
| 166e53bbc8 | |||
| ae6419f63f | |||
| 95855b96a6 | |||
| e5c5432e78 | |||
| bc3239e3b2 | |||
| 57c86e788e | |||
| d7c8342728 | |||
| e9793a7c75 | |||
| 5df1b65598 | |||
| c80fe55df9 | |||
| d2c54b866f | |||
| c4a7390c72 | |||
| e78337b3be | |||
| 3030a230c8 | |||
| c836b158b4 | |||
| 00efc5ff9c | |||
| 66d44850cf | |||
| fca21d717a | |||
| f705576d9a | |||
| de918cf2f8 | |||
| 1517dbd7f0 | |||
| c7d1157a1a | |||
| f020ae8000 | |||
| f4b04e11da | |||
| d8ecc4672e | |||
| 7fd6705513 | |||
| bb0db92ef9 | |||
| 537f48db96 | |||
| df13fc3598 | |||
| 1d50a3a2c9 | |||
| a7354d622d | |||
| b9b7e70d87 | |||
| 1c53ed7e19 | |||
| 944e3798d4 | |||
| b12b4c21e1 | |||
| 2b3782d787 | |||
| ea290015ef | |||
| ec01dfbec1 | |||
| 9a2bf77b50 | |||
| 00bbae0989 | |||
| 451c3a3568 | |||
| a51f7e4b76 | |||
| d02114b3f3 | |||
| 87f56daf15 | |||
| 0a661e44b1 | |||
| 7f146d2c41 | |||
| cf89b1178b |
+486
-67
File diff suppressed because it is too large
Load Diff
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+487
-68
File diff suppressed because it is too large
Load Diff
Vendored
+1007
-658
File diff suppressed because it is too large
Load Diff
@@ -131,11 +131,11 @@ function emsDepartment($data)
|
||||
}
|
||||
if ($key == "Benötigte GW-San") {
|
||||
$pd["use_SEG_FULL"] = true;
|
||||
} elseif ($key == "Benötigte RTW" || ($key == "Wahrscheinlichkeit, dass ein Patient transportiert werden muss" && $value > 40)) {
|
||||
} elseif ($key == "Benötigte RTW" || $key == "Wahrscheinlichkeit, dass ein Patient transportiert werden muss") {
|
||||
$pd["use_RTW"] = true;
|
||||
} elseif ($key == "NEF Anforderungswahrscheinlichkeit" && $value > 40) {
|
||||
} elseif ($key == "NEF Anforderungswahrscheinlichkeit") {
|
||||
$pd["use_NEF"] = true;
|
||||
} elseif ($key == "RTH Anforderungswahrscheinlichkeit" && $value > 30) {
|
||||
} elseif ($key == "RTH Anforderungswahrscheinlichkeit") {
|
||||
$pd["use_RTH"] = true;
|
||||
}
|
||||
}
|
||||
@@ -295,6 +295,14 @@ foreach (glob("*.json") as $filename) {
|
||||
$mission['id'] = $mission_id;
|
||||
$mission['type'] = $mission_id;
|
||||
$mission['name'] = $data['Name'];
|
||||
|
||||
//$mission['share'] = isset($data['Tritt nur ab dem Datum auf']) ? true : false;
|
||||
$mission['share'] = false;
|
||||
|
||||
if (isset($data['Credits im Durchschnitt']) && intval($data['Credits im Durchschnitt']) >= 7000 && $mission['share'] == false) {
|
||||
$mission['share'] = true;
|
||||
}
|
||||
|
||||
$fd = fireDepartment($data);
|
||||
if (array_sum($fd) > 0) {
|
||||
$mission['fire_department'] = $fd;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
for i in $(seq 420 424); do
|
||||
for i in $(seq 421 423); do
|
||||
curl -s -o "./missions/$i.html" "https://www.leitstellenspiel.de/einsaetze/$i"
|
||||
html2text -utf8 -style pretty -width 100 -o "./missions/$i.text" "./missions/$i.html"
|
||||
lynx --dump "./missions/$i.html" > "./missions/$i.txt"
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
<title>LEITSTELLENSPIEL.DE - baue deine eigene Leitstelle, in deiner Stadt!</title>
|
||||
<meta content="authenticity_token" name="csrf-param" />
|
||||
<meta content="CptcsOLVZDZ8aMSG8FWeOHL84iwqScWrX26fREfMTtI=" name="csrf-token" />
|
||||
<meta content="kX8RZLCcfKMXHlpuSdVA2uWEC3a0nLeBv2TPQyUDg/A=" name="csrf-token" />
|
||||
|
||||
<script src="/assets/application-a789289a71061d030b76a864e1d16075.js" type="text/javascript"></script>
|
||||
<script src="/assets/application-6dae189568c355807e28f829cc25cb33.js" type="text/javascript"></script>
|
||||
|
||||
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
|
||||
<!--[if lt IE 9]>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<title>LEITSTELLENSPIEL.DE - baue deine eigene Leitstelle, in deiner Stadt!</title>
|
||||
<meta content="authenticity_token" name="csrf-param" />
|
||||
<meta content="sW5qrZx5GA4BBZD98qyG7pPTzGq1WjeNCnIDfiSzzK4=" name="csrf-token" />
|
||||
<meta content="TjGsiG+tPyL8SPR51dhx6sasfS4wF1Rh9n4qtzZ+rMw=" name="csrf-token" />
|
||||
|
||||
<script src="/assets/application-a789289a71061d030b76a864e1d16075.js" type="text/javascript"></script>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<title>LEITSTELLENSPIEL.DE - baue deine eigene Leitstelle, in deiner Stadt!</title>
|
||||
<meta content="authenticity_token" name="csrf-param" />
|
||||
<meta content="BNB0VEetMlMDcjHizS6YvWvA7A6QyjqezPsrd/hf17Y=" name="csrf-token" />
|
||||
<meta content="hJglNqkHsn0i29Jl1jR6BKjpRCfjK8cVTvRYHW9X3mQ=" name="csrf-token" />
|
||||
|
||||
<script src="/assets/application-a789289a71061d030b76a864e1d16075.js" type="text/javascript"></script>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<title>LEITSTELLENSPIEL.DE - baue deine eigene Leitstelle, in deiner Stadt!</title>
|
||||
<meta content="authenticity_token" name="csrf-param" />
|
||||
<meta content="E/Anxv+qaHmWs1MWTFdBAsP34DrrQnvotX6q4tyZVIQ=" name="csrf-token" />
|
||||
<meta content="A7oqOPApiZ55rSDeWfOI6Tk/D0I8Dd/wMWOGGAJr+xw=" name="csrf-token" />
|
||||
|
||||
<script src="/assets/application-a789289a71061d030b76a864e1d16075.js" type="text/javascript"></script>
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>We're sorry, but something went wrong (500)</title>
|
||||
<style type="text/css">
|
||||
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
||||
div.dialog {
|
||||
width: 25em;
|
||||
padding: 0 4em;
|
||||
margin: 4em auto 0 auto;
|
||||
border: 1px solid #ccc;
|
||||
border-right-color: #999;
|
||||
border-bottom-color: #999;
|
||||
}
|
||||
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- This file lives in public/500.html -->
|
||||
<div id="500_hype_container" style="margin:auto;position:relative;width:600px;height:200px;overflow:hidden;">
|
||||
<script type="text/javascript" charset="utf-8" src="/500.hyperesources/500_hype_generated_script.js?47359"></script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +0,0 @@
|
||||
{"Name":null}
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1382,8 +1382,7 @@ alertFhz(elw2, 1, 'ELW2', false);
|
||||
alertFhz(dl, 1, 'DL', false);
|
||||
RTW();
|
||||
//alertFhz(rtw, 20, 'RTW', false);
|
||||
} else if ([424].indexOf(help) != -1 && !(isVerband)) {
|
||||
} else if ([43].indexOf(help) != -1 && !(isVerband)) {
|
||||
} else if ([43].indexOf(help) != -1 && !(isVerband)) {
|
||||
alertFhz(ruest, 5, 'RÜST', false);
|
||||
alertFhz(oel, 2, 'GW-ÖL', false);
|
||||
alertFhz(lf, 10, 'LF', false);
|
||||
|
||||
+520
-590
File diff suppressed because it is too large
Load Diff
@@ -1,239 +0,0 @@
|
||||
|
||||
CollectPatients() {
|
||||
const self = this;
|
||||
let PatientCounter = 0;
|
||||
|
||||
$(".mission_patient").each(function (_, elem) {
|
||||
var PatientName = $(elem).text();
|
||||
var PatientNeedRTW = false;
|
||||
var PatientNeedNEF = false;
|
||||
var PatientNeedRTH = false;
|
||||
var PatientNeedLNA = false;
|
||||
var PatientNeedOrgL = false;
|
||||
var PatientNeedSEGKTWB = false;
|
||||
var PatientNeedTragehilfe = false;
|
||||
|
||||
// Wir benötigen einen RTW oder KTW Typ B.
|
||||
if ($(elem).find(".alert-danger").length > 0 && $(elem).find(".alert-danger").text().indexOf("Wir benötigen einen RTW oder KTW Typ B") != -1) {
|
||||
PatientNeedSEGKTWB = true;
|
||||
}
|
||||
|
||||
// Wir benötigen einen RTW.
|
||||
if ($(elem).find(".alert-danger").length > 0 && $(elem).find(".alert-danger").text().indexOf("Wir benötigen ein RTW") != -1) {
|
||||
PatientNeedRTW = true;
|
||||
}
|
||||
|
||||
// Wir benötigen einen NEF.
|
||||
if ($(elem).find(".alert-danger").length > 0 && $(elem).find(".alert-danger").text().indexOf("Wir benötigen ein NEF") != -1) {
|
||||
PatientNeedNEF = true;
|
||||
}
|
||||
|
||||
// Wir benötigen einen RTH.
|
||||
if ($(elem).find(".alert-danger").length > 0 && $(elem).find(".alert-danger").text().indexOf("Wir benötigen ein RTH") != -1) {
|
||||
PatientNeedRTH = true;
|
||||
}
|
||||
|
||||
// Wir benötigen einen LNA.
|
||||
if ($(elem).find(".alert-danger").length > 0 && $(elem).find(".alert-danger").text().indexOf("Wir benötigen einen LNA") != -1) {
|
||||
PatientNeedLNA = true;
|
||||
}
|
||||
|
||||
// Wir benötigen einen OrgL.
|
||||
if ($(elem).find(".alert-danger").length > 0 && $(elem).find(".alert-danger").text().indexOf("Wir benötigen einen OrgL") != -1) {
|
||||
PatientNeedOrgL = true;
|
||||
}
|
||||
|
||||
// Wir benötigen eine Tragehilfe (z.B. durch ein LF).
|
||||
if ($(elem).find(".alert-danger").length > 0 && $(elem).find(".alert-danger").text().indexOf("Wir benötigen eine Tragehilfe") != -1) {
|
||||
PatientNeedTragehilfe = true;
|
||||
}
|
||||
|
||||
self.Patients[PatientCounter] = {
|
||||
"name": PatientName,
|
||||
"need_RTW": PatientNeedRTW,
|
||||
"need_NEF": PatientNeedNEF,
|
||||
"need_RTH": PatientNeedRTH,
|
||||
"need_LNA": PatientNeedLNA,
|
||||
"need_OrgL": PatientNeedOrgL,
|
||||
"need_SEG_KTWB": PatientNeedSEGKTWB,
|
||||
"need_Tragehilfe": PatientNeedTragehilfe
|
||||
}
|
||||
|
||||
PatientCounter++;
|
||||
});
|
||||
|
||||
return self.Patients;
|
||||
}
|
||||
|
||||
// - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
// -
|
||||
// - Process Emergency_Medical_Service
|
||||
// -
|
||||
// - -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
|
||||
|
||||
ProcessEmergencyMedicalService() {
|
||||
|
||||
const self = this;
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
// -
|
||||
// - Emergency Medical Service: Vehicles
|
||||
// -
|
||||
// - 38: KTW
|
||||
// - 28: RTW
|
||||
// - 29: NEF
|
||||
// - 74: NAW
|
||||
// - 73: GRTW
|
||||
// - 31: RTH
|
||||
// - 55: LNA
|
||||
// - 56: OrgL
|
||||
// -
|
||||
// - 58: (SEG) KTW Typ B
|
||||
// - 59: (SEG) ELW 1
|
||||
// - 60: (SEG) GW-San
|
||||
// -
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
if (typeof self.MissionConfig.emergency_medical_service == "object") // Wenn der EMS-Block in der Config definiert ist
|
||||
{
|
||||
|
||||
if (Object.keys(self.Patients).length >= 5) { // need LNA
|
||||
self._ADisVehiclesNeed["55"] = 1;
|
||||
}
|
||||
|
||||
if (Object.keys(self.Patients).length >= 10) { // need OrgL
|
||||
self._ADisVehiclesNeed["56"] = 1;
|
||||
}
|
||||
|
||||
if (Object.keys(self.Patients).length == 0) {
|
||||
if (self.MissionConfig.emergency_medical_service.use_RTW == true) {
|
||||
self._ADisVehiclesNeed["28"]++;
|
||||
}
|
||||
|
||||
if (self.MissionConfig.emergency_medical_service.use_NEF == true) {
|
||||
self._ADisVehiclesNeed["29"]++;
|
||||
}
|
||||
|
||||
if (self.MissionConfig.emergency_medical_service.use_RTH == true) {
|
||||
self._ADisVehiclesNeed["31"]++;
|
||||
}
|
||||
} else {
|
||||
for (var Key in self.Patients) {
|
||||
var Patient = self.Patients[Key];
|
||||
if (self.MissionConfig.emergency_medical_service.use_KTW == true) {
|
||||
if (!Patient.need_RTW && !Patient.need_NEF && !Patient.need_RTH) {
|
||||
self._ADisVehiclesNeed["38"]++;
|
||||
}
|
||||
}
|
||||
|
||||
if (Patient.need_LNA && self._ADisVehiclesNeed["55"] < 1) {
|
||||
self._ADisVehiclesNeed["55"]++;
|
||||
}
|
||||
|
||||
if (Patient.need_OrgL && self._ADisVehiclesNeed["56"] < 1) {
|
||||
self._ADisVehiclesNeed["56"]++;
|
||||
}
|
||||
if (Patient.need_Tragehilfe == true) {
|
||||
self._ADisVehiclesNeed["0"]++;
|
||||
}
|
||||
if (self.MissionConfig.emergency_medical_service.use_RTW == true || Patient.need_RTW == true) {
|
||||
self._ADisVehiclesNeed["28"]++;
|
||||
}
|
||||
if (self.MissionConfig.emergency_medical_service.use_NEF == true || Patient.need_NEF == true) {
|
||||
self._ADisVehiclesNeed["29"]++;
|
||||
}
|
||||
if (self.MissionConfig.emergency_medical_service.use_RTH == true || Patient.need_RTH == true) {
|
||||
self._ADisVehiclesNeed["31"]++;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// TODO: need to be refactored to make sure first KTW Typ B before RTW.
|
||||
if (self.MissionConfig.emergency_medical_service.use_SEG_ELW1_Only == "true") {
|
||||
self._ADisVehiclesNeed["59"]++;
|
||||
} else if (self.MissionConfig.emergency_medical_service.use_SEG_FULL == "true" || Object.keys(self.Patients).length >= 3) {
|
||||
self._ADisVehiclesNeed["58"]++;
|
||||
self._ADisVehiclesNeed["58"]++; // 3x KTW Type B
|
||||
self._ADisVehiclesNeed["58"]++;
|
||||
self._ADisVehiclesNeed["59"]++;
|
||||
self._ADisVehiclesNeed["60"]++;
|
||||
}
|
||||
|
||||
var VehicleTable;
|
||||
|
||||
if ($("#vehicle_show_table_body_all").length > 0) {
|
||||
VehicleTable = $("#vehicle_show_table_body_all");
|
||||
} else {
|
||||
VehicleTable = $("#vehicle_show_table_body_rett");
|
||||
}
|
||||
|
||||
VehicleTable.find(".vehicle_select_table_tr").each(function (_, elem) {
|
||||
var VehicleID = $(elem).attr("id").replace("vehicle_element_content_", "");
|
||||
// var VehicleDistanceTime = $("#vehicle_sort_" + VehicleID).attr("sortvalue");
|
||||
var VehicleType = $(elem).attr("vehicle_type");
|
||||
|
||||
if ($("#vehicle_checkbox_" + VehicleID + ":enabled").length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (VehicleType == "KTW" && self._ADisVehiclesNeed["38"] > 0) {
|
||||
// console.log(" Automatic Dispose: Fahrzeug " + VehicleID + " " + VehicleType + " markiert");
|
||||
$("#vehicle_checkbox_" + VehicleID).click();
|
||||
self._ADisVehiclesNeed["38"]--;
|
||||
} else if ((VehicleType == "LF 20" || VehicleType == "LF 10" ||
|
||||
VehicleType == "LF 8/6" || VehicleType == "LF 20/16" ||
|
||||
VehicleType == "LF 10/6" || VehicleType == "LF 16-TS" ||
|
||||
VehicleType == "HLF 20" || VehicleType == "TSF-W" ||
|
||||
VehicleType == "TLF 2000" || VehicleType == "TLF 3000" ||
|
||||
VehicleType == "TLF 8/8" || VehicleType == "TLF 8/18" ||
|
||||
VehicleType == "TLF 16/24-Tr" || VehicleType == "TLF 16/25" ||
|
||||
VehicleType == "TLF 16/45" || VehicleType == "TLF 20/40" ||
|
||||
VehicleType == "TLF 20/40-SL" || VehicleType == "TLF 16") &&
|
||||
self._ADisVehiclesNeed["0"] + self._ADisVehiclesNeed["1"] + self._ADisVehiclesNeed["6"] + self._ADisVehiclesNeed["7"] +
|
||||
self._ADisVehiclesNeed["8"] + self._ADisVehiclesNeed["9"] + self._ADisVehiclesNeed["30"] + self._ADisVehiclesNeed["37"] +
|
||||
self._ADisVehiclesNeed["17"] + self._ADisVehiclesNeed["18"] + self._ADisVehiclesNeed["19"] + self._ADisVehiclesNeed["20"] +
|
||||
self._ADisVehiclesNeed["21"] + self._ADisVehiclesNeed["22"] + self._ADisVehiclesNeed["23"] + self._ADisVehiclesNeed["24"] +
|
||||
self._ADisVehiclesNeed["25"] + self._ADisVehiclesNeed["26"] > 0) { // LF acts as 'Tragehilfe'
|
||||
$("#vehicle_checkbox_" + VehicleID).click();
|
||||
self._ADisVehiclesNeed["0"]--;
|
||||
} else if (VehicleType == "NAW" && self._ADisVehiclesNeed["28"] > 0 && self._ADisVehiclesNeed["29"] > 0) {
|
||||
$("#vehicle_checkbox_" + VehicleID).click();
|
||||
self._ADisVehiclesNeed["74"]--;
|
||||
self._ADisVehiclesNeed["28"]--;
|
||||
self._ADisVehiclesNeed["29"]--;
|
||||
} else if (VehicleType == "GRTW" && self._ADisVehiclesNeed["73"] > 0) {
|
||||
$("#vehicle_checkbox_" + VehicleID).click();
|
||||
self._ADisVehiclesNeed["73"]--;
|
||||
} else if (VehicleType == "RTW" && self._ADisVehiclesNeed["28"] > 0) {
|
||||
$("#vehicle_checkbox_" + VehicleID).click();
|
||||
self._ADisVehiclesNeed["28"]--;
|
||||
} else if (VehicleType == "NEF" && self._ADisVehiclesNeed["29"] > 0) {
|
||||
$("#vehicle_checkbox_" + VehicleID).click();
|
||||
self._ADisVehiclesNeed["29"]--;
|
||||
} else if (VehicleType == "RTH" && self._ADisVehiclesNeed["31"] > 0) {
|
||||
$("#vehicle_checkbox_" + VehicleID).click();
|
||||
self._ADisVehiclesNeed["31"]--;
|
||||
} else if (VehicleType == "KdoW-LNA" && self._ADisVehiclesNeed["55"] > 0) {
|
||||
$("#vehicle_checkbox_" + VehicleID).click();
|
||||
self._ADisVehiclesNeed["55"]--;
|
||||
} else if (VehicleType == "KdoW-OrgL" && self._ADisVehiclesNeed["56"] > 0) {
|
||||
$("#vehicle_checkbox_" + VehicleID).click();
|
||||
self._ADisVehiclesNeed["56"]--;
|
||||
} else if (VehicleType == "KTW Typ B" && self._ADisVehiclesNeed["58"] > 0) {
|
||||
$("#vehicle_checkbox_" + VehicleID).click();
|
||||
self._ADisVehiclesNeed["58"]--;
|
||||
self._ADisVehiclesNeed["28"]--; // no need for RTW if KTW Type B is called
|
||||
} else if (VehicleType == "ELW 1 (SEG)" && self._ADisVehiclesNeed["59"] > 0) {
|
||||
$("#vehicle_checkbox_" + VehicleID).click();
|
||||
self._ADisVehiclesNeed["59"]--;
|
||||
} else if (VehicleType == "GW-San" && self._ADisVehiclesNeed["60"] > 0) {
|
||||
$("#vehicle_checkbox_" + VehicleID).click();
|
||||
self._ADisVehiclesNeed["60"]--;
|
||||
self._ADisVehiclesNeed["29"]--; // no need for NEF if GW-SAN is called
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
const AutomaticDispose = function () {
|
||||
let self = this;
|
||||
self.MaxVehicleID = 86
|
||||
self.MissionType = null
|
||||
self.MissionID = null
|
||||
self.MyRunner = null
|
||||
self.MyRunnerSettings = null
|
||||
self.OweSecure = false
|
||||
|
||||
self._ADisVehiclesNeed = {}
|
||||
self.MissionConfig = {}
|
||||
self.Vehicles = {}
|
||||
self.Patients = {}
|
||||
|
||||
self.ADis_MyHead = document.getElementsByTagName('head')[0];
|
||||
self.ADis_MyBody = document.getElementsByTagName('body')[0];
|
||||
|
||||
// -
|
||||
// - Sprechwunsch Variablen
|
||||
// -
|
||||
self.Jails = [];
|
||||
self.JailRegEx = /\(Freie Zellen\:\s+(\d)\,\s+Entfernung\:\s+(\d+\,\d+)\s+km(?:\,\s+Abgabe an Besitzer\:\s+(\d+)%)?\)/g;
|
||||
self.Hospitals = [];
|
||||
self.RescueVehicleFrameWatchDog = null;
|
||||
self.PoliceVehicleFrameWatchDog = null;
|
||||
};
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
(() => {
|
||||
let msis = (async () => {
|
||||
return await AutomaticDisposeCall.ADisDB.ADisMissions.where({
|
||||
runner: 'om',
|
||||
available: 'true',
|
||||
done: 'false'
|
||||
}).and(function (item) {
|
||||
return item.next_check <= Math.floor(new Date().getTime() / 1000)
|
||||
}).toArray()
|
||||
})();
|
||||
msis.then((result) => {
|
||||
result.sort((a, b) => {
|
||||
return a.next_check > b.next_check;
|
||||
});
|
||||
return result;
|
||||
}).then((sortedResult) => {
|
||||
console.table(sortedResult);
|
||||
});
|
||||
})();
|
||||
@@ -0,0 +1,248 @@
|
||||
// ==UserScript==
|
||||
// @name Mission Watcher
|
||||
// @version 1.0.0
|
||||
// @run-at document-end
|
||||
// @require https://cdnjs.cloudflare.com/ajax/libs/dexie/2.0.4/dexie.min.js
|
||||
// ==/UserScript==
|
||||
|
||||
|
||||
class WatchMissions {
|
||||
|
||||
constructor() {
|
||||
let self = this;
|
||||
self.DB = new Dexie('LSS_WatchMissions');
|
||||
|
||||
|
||||
self.DB.version(1).stores({
|
||||
/**
|
||||
* Missions to Watch
|
||||
* - missionID - Mission ID that should be watched.
|
||||
* - limit - If the Mission turns green more than 6 times, no more requests will be sent.
|
||||
* - data - {name, datetime, onsite{ username:{ cars: [ {name, type} ] } } }
|
||||
*/
|
||||
Missions: "++missionID"
|
||||
});
|
||||
self.DB.open().catch((err) => {
|
||||
console.error(err.stack || err);
|
||||
});
|
||||
self.DB.on("ready", async () => {
|
||||
// index page
|
||||
if (window.location.pathname === "/" || window.location.pathname === "/#" || window.location.pathname === "/#_=_") {
|
||||
self.RegisterIndexPage();
|
||||
}
|
||||
// mission page
|
||||
else if (window.location.pathname.indexOf("/missions/") !== -1 && window.name == 'watchMission') {
|
||||
self.RegisterMissionPage();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
get RandomTime() {
|
||||
const max = 6;
|
||||
const min = 1;
|
||||
return Math.floor((Math.random() * (max - min + 1) + min) * 1000);
|
||||
}
|
||||
|
||||
RegisterIndexPage() {
|
||||
let self = this;
|
||||
// -
|
||||
// - Google Font
|
||||
// -
|
||||
var styleElement = document.createElement("link");
|
||||
styleElement.rel = "stylesheet";
|
||||
styleElement.href = "https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700";
|
||||
this.ADis_MyHead.appendChild(styleElement);
|
||||
|
||||
// -
|
||||
// - FontAwesome 5
|
||||
// -
|
||||
var scriptElement = document.createElement("script");
|
||||
scriptElement.type = "text/javascript";
|
||||
scriptElement.src = "https://use.fontawesome.com/releases/v5.5.0/js/all.js";
|
||||
this.ADis_MyHead.appendChild(scriptElement);
|
||||
|
||||
// -
|
||||
// - Navbar Dashboard
|
||||
// -
|
||||
var styleElement = document.createElement("link");
|
||||
styleElement.rel = "stylesheet";
|
||||
styleElement.type = "text/css";
|
||||
styleElement.media = "screen";
|
||||
styleElement.href = this.ADisSettings.url + this.ADisSettings.branch + "/style/interface.css";
|
||||
this.ADis_MyHead.appendChild(styleElement);
|
||||
|
||||
// Create Dashboard
|
||||
$('#news_li').before('<li id="adis-nav-item"></li>');
|
||||
$('#adis-nav-item').html(`/***ADis_Navbar***/0`)
|
||||
$("#adis-dashboard").css({
|
||||
display: "none",
|
||||
opacity: "0"
|
||||
});
|
||||
}
|
||||
|
||||
// Generate HTML Table
|
||||
// Builds the HTML Table out of myList json data from Ivy restful service.
|
||||
buildHtmlTable() {
|
||||
const self = this;
|
||||
self.addTable(myList, $("#excelDataTable"));
|
||||
}
|
||||
|
||||
addTable(list, appendObj) {
|
||||
const self = this;
|
||||
appendObj.html('');
|
||||
var columns = self.addAllColumnHeaders(list, appendObj);
|
||||
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
var row$ = $('<tr/>');
|
||||
for (var colIndex = 0; colIndex < columns.length; colIndex++) {
|
||||
var cellValue = list[i][columns[colIndex]];
|
||||
|
||||
if (cellValue == null) {
|
||||
cellValue = "";
|
||||
}
|
||||
|
||||
if (cellValue.constructor === Array) {
|
||||
$a = $('<td/>');
|
||||
row$.append($a);
|
||||
self.addTable(cellValue, $a);
|
||||
|
||||
} else if (cellValue.constructor === Object) {
|
||||
|
||||
var array = $.map(cellValue, function (value, index) {
|
||||
return [value];
|
||||
});
|
||||
|
||||
$a = $('<td/>');
|
||||
row$.append($a);
|
||||
self.addObject(array, $a);
|
||||
|
||||
} else {
|
||||
row$.append($('<td/>').html(cellValue));
|
||||
}
|
||||
}
|
||||
appendObj.append(row$);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
addObject(list, appendObj) {
|
||||
const self = this;
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
var row$ = $('<tr/>');
|
||||
|
||||
var cellValue = list[i];
|
||||
|
||||
if (cellValue == null) {
|
||||
cellValue = "";
|
||||
}
|
||||
|
||||
if (cellValue.constructor === Array) {
|
||||
$a = $('<td/>');
|
||||
row$.append($a);
|
||||
self.addTable(cellValue, $a);
|
||||
|
||||
} else if (cellValue.constructor === Object) {
|
||||
|
||||
var array = $.map(cellValue, function (value, index) {
|
||||
return [value];
|
||||
});
|
||||
|
||||
$a = $('<td/>');
|
||||
row$.append($a);
|
||||
self.addObject(array, $a);
|
||||
|
||||
} else {
|
||||
row$.append($('<td/>').html(cellValue));
|
||||
}
|
||||
appendObj.append(row$);
|
||||
}
|
||||
}
|
||||
|
||||
// Adds a header row to the table and returns the set of columns.
|
||||
// Need to do union of keys from all records as some records may not contain
|
||||
// all records
|
||||
addAllColumnHeaders(list, appendObj) {
|
||||
var columnSet = [];
|
||||
var headerTr$ = $('<tr/>');
|
||||
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
var rowHash = list[i];
|
||||
for (var key in rowHash) {
|
||||
if ($.inArray(key, columnSet) == -1) {
|
||||
columnSet.push(key);
|
||||
headerTr$.append($('<th/>').html(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
appendObj.append(headerTr$);
|
||||
|
||||
return columnSet;
|
||||
}
|
||||
|
||||
// Mission Page
|
||||
|
||||
RegisterMissionPage() {
|
||||
let MissionType = null;
|
||||
let MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1);
|
||||
let help_el = $('a#mission_help');
|
||||
if (help_el.length > 0) {
|
||||
MissionType = help_el[0].href.split("?")[0];
|
||||
var re = /\d+$/i;
|
||||
var found = MissionType.match(re);
|
||||
MissionType = Number(found[0]);
|
||||
}
|
||||
|
||||
var myRows = [];
|
||||
var $headers = $("table#mission_vehicle_driving th");
|
||||
var $rows = $("table#mission_vehicle_driving tbody tr").each(function (index) {
|
||||
$cells = $(this).find("td");
|
||||
myRows[index] = {};
|
||||
$cells.each(function (cellIndex) {
|
||||
let mcoai = '';
|
||||
if (cellIndex == 1) {
|
||||
mcoai = ($($(this).find("a")[0]).text().trim() + ' ' + $($(this).find("small")[0]).text().trim()).replace(/(\r\n\t|\n|\r\t|\s{2,})/gm, "");
|
||||
} else {
|
||||
mcoai = ($(this).text().trim()).replace(/(\r\n\t|\n|\r\t|\s{2,})/gm, "");
|
||||
}
|
||||
console.log(cellIndex, mcoai, $($headers[cellIndex]).text().trim());
|
||||
if ($($headers[cellIndex]).text().trim() != '') {
|
||||
myRows[index][$($headers[cellIndex]).text().trim()] = mcoai
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Let's put this in the object like you want and convert to JSON (Note: jQuery will also do this for you on the Ajax request)
|
||||
var myObj = {};
|
||||
myObj.Anfahrt = myRows.filter(value => Object.keys(value).length !== 0);
|
||||
|
||||
myRows = [];
|
||||
$headers = $("table#mission_vehicle_at_mission th");
|
||||
$rows = $("table#mission_vehicle_at_mission tbody tr").each(function (index) {
|
||||
$cells = $(this).find("td");
|
||||
myRows[index] = {};
|
||||
$cells.each(function (cellIndex) {
|
||||
let mcoai = '';
|
||||
if (cellIndex == 1) {
|
||||
mcoai = ($($(this).find("a")[0]).text().trim() + ' ' + $($(this).find("small")[0]).text().trim()).replace(/(\r\n\t|\n|\r\t|\s{2,})/gm, "");
|
||||
} else {
|
||||
mcoai = ($(this).text().trim()).replace(/(\r\n\t|\n|\r\t|\s{2,})/gm, "");
|
||||
}
|
||||
console.log(cellIndex, mcoai, $($headers[cellIndex]).text().trim());
|
||||
if ($($headers[cellIndex]).text().trim() != '') {
|
||||
myRows[index][$($headers[cellIndex]).text().trim()] = mcoai
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Let's put this in the object like you want and convert to JSON (Note: jQuery will also do this for you on the Ajax request)
|
||||
myObj.VorOrt = myRows.filter(value => Object.keys(value).length !== 0);
|
||||
console.log(myObj);
|
||||
}
|
||||
|
||||
}
|
||||
(() => {
|
||||
'use strict';
|
||||
|
||||
new WatchMissions();
|
||||
|
||||
})()
|
||||
Reference in New Issue
Block a user