v2 up amoac0ßav

This commit is contained in:
2018-11-28 21:15:38 +01:00
parent ef331ec550
commit ce599faaf6
3 changed files with 34 additions and 26 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
/*Generated on:Wed Nov 28 2018 21:11:48 GMT+0100 (CET)*/ /*Generated on:Wed Nov 28 2018 21:15:37 GMT+0100 (CET)*/
var AutomaticDispose_Branch = "master"; var AutomaticDispose_Branch = "master";
var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/"; var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/";
var da_lss_adis_time = new Date().getTime(); var da_lss_adis_time = new Date().getTime();
+17 -13
View File
@@ -1,4 +1,4 @@
/*Generated on:Wed Nov 28 2018 21:11:48 GMT+0100 (CET)*/ /*Generated on:Wed Nov 28 2018 21:15:37 GMT+0100 (CET)*/
/* /*
* Dexie.js - a minimalistic wrapper for IndexedDB * Dexie.js - a minimalistic wrapper for IndexedDB
* =============================================== * ===============================================
@@ -4749,6 +4749,8 @@ class AutomaticDispose {
// Krankenhaus auswählen // Krankenhaus auswählen
Collect_Hospitals() { Collect_Hospitals() {
let that = this;
that.Hospitals = [];
if ($("h4:contains('Eigene Krankenhäuser')").length > 0) { if ($("h4:contains('Eigene Krankenhäuser')").length > 0) {
$("h4:contains('Eigene Krankenhäuser')").next("table").find("tbody").find("tr").each(function () { $("h4:contains('Eigene Krankenhäuser')").next("table").find("tbody").find("tr").each(function () {
var HospitalHref = $(this).find("a:contains('Anfahren')").attr("href"); var HospitalHref = $(this).find("a:contains('Anfahren')").attr("href");
@@ -4763,7 +4765,7 @@ class AutomaticDispose {
} }
if (HospitalFreeBeds > 0) { if (HospitalFreeBeds > 0) {
Hospitals.push({ that.Hospitals.push({
"id": HospitalID, "id": HospitalID,
"value": HospitalValue, "value": HospitalValue,
"distance": HospitalDistance, "distance": HospitalDistance,
@@ -4803,7 +4805,7 @@ class AutomaticDispose {
} }
if (HospitalFreeBeds > 0 && HospitalSpecialDepartment) { if (HospitalFreeBeds > 0 && HospitalSpecialDepartment) {
Hospitals.push({ that.Hospitals.push({
"id": HospitalID, "id": HospitalID,
"value": HospitalValue, "value": HospitalValue,
"taxes": HospitalTaxes, "taxes": HospitalTaxes,
@@ -4814,18 +4816,18 @@ class AutomaticDispose {
}); });
} }
Hospitals.sort(function (a, b) { that.Hospitals.sort(function (a, b) {
return a.value - b.value; return a.value - b.value;
}); });
Hospitals.reverse(); that.Hospitals.reverse();
this.Send_Vehicle_To_Hospital() this.Send_Vehicle_To_Hospital()
} }
// Krankenhaus einlieferung // Krankenhaus einlieferung
Send_Vehicle_To_Hospital() { Send_Vehicle_To_Hospital() {
//var HospitalID = Hospitals[0].id; //var HospitalID = Hospitals[0].id;
var HospitalHref = Hospitals[0].href; var HospitalHref = this.Hospitals[0].href;
// TODO: tellParent("ADisMissionDone(" + window.name + "," + MissionID + ");"); // TODO: tellParent("ADisMissionDone(" + window.name + "," + MissionID + ");");
document.location.href = document.location.origin + HospitalHref; document.location.href = document.location.origin + HospitalHref;
@@ -4936,6 +4938,8 @@ class AutomaticDispose {
// Gefängnis auswählen // Gefängnis auswählen
Collect_Jails() { Collect_Jails() {
let that = this;
that.Jails = [];
var CountGefangene = Number(parseInt($('#h2_prisoners').text())); var CountGefangene = Number(parseInt($('#h2_prisoners').text()));
var parentNode = $('#mission_vehicle_at_mission tr > td:nth-child(5) > a:contains("Jomaar")').parent().parent(); var parentNode = $('#mission_vehicle_at_mission tr > td:nth-child(5) > a:contains("Jomaar")').parent().parent();
var GefKw = parentNode.find('td:nth-child(2) > a[vehicle_type_id="52"]'); var GefKw = parentNode.find('td:nth-child(2) > a[vehicle_type_id="52"]');
@@ -4991,7 +4995,7 @@ class AutomaticDispose {
} }
if (JailFreeBeds >= 5) { if (JailFreeBeds >= 5) {
Jails.push({ that.Jails.push({
"id": JailID, "id": JailID,
"value": JailValue + 1000, "value": JailValue + 1000,
"text": JailText, "text": JailText,
@@ -4999,7 +5003,7 @@ class AutomaticDispose {
"href": JailHref "href": JailHref
}); });
} else if (JailFreeBeds >= 1) { } else if (JailFreeBeds >= 1) {
Jails.push({ that.Jails.push({
"id": JailID, "id": JailID,
"value": JailValue, "value": JailValue,
"text": JailText, "text": JailText,
@@ -5055,7 +5059,7 @@ class AutomaticDispose {
} }
if (JailFreeBeds >= CountGefangene) { if (JailFreeBeds >= CountGefangene) {
Jails.push({ that.Jails.push({
"id": JailID, "id": JailID,
"value": JailValue + 1000, "value": JailValue + 1000,
"text": JailText, "text": JailText,
@@ -5063,7 +5067,7 @@ class AutomaticDispose {
"href": JailHref "href": JailHref
}); });
} else if (JailFreeBeds >= 1) { } else if (JailFreeBeds >= 1) {
Jails.push({ that.Jails.push({
"id": JailID, "id": JailID,
"value": JailValue, "value": JailValue,
"text": JailText, "text": JailText,
@@ -5073,11 +5077,11 @@ class AutomaticDispose {
} }
}); });
Jails.sort(function (a, b) { that.Jails.sort(function (a, b) {
return a.value - b.value; return a.value - b.value;
}); });
Jails.reverse(); that.Jails.reverse();
if (Jails.length > 0) { if (Jails.length > 0) {
this.Send_Vehicle_To_Jail() this.Send_Vehicle_To_Jail()
} else { } else {
@@ -5114,7 +5118,7 @@ class AutomaticDispose {
// Gefängnis einlieferung // Gefängnis einlieferung
Send_Vehicle_To_Jail() { Send_Vehicle_To_Jail() {
var JailHref = Jails[0].href var JailHref = that.Jails[0].href
document.location.href = document.location.origin + JailHref; document.location.href = document.location.origin + JailHref;
} }
+16 -12
View File
@@ -274,6 +274,8 @@ class AutomaticDispose {
// Krankenhaus auswählen // Krankenhaus auswählen
Collect_Hospitals() { Collect_Hospitals() {
let that = this;
that.Hospitals = [];
if ($("h4:contains('Eigene Krankenhäuser')").length > 0) { if ($("h4:contains('Eigene Krankenhäuser')").length > 0) {
$("h4:contains('Eigene Krankenhäuser')").next("table").find("tbody").find("tr").each(function () { $("h4:contains('Eigene Krankenhäuser')").next("table").find("tbody").find("tr").each(function () {
var HospitalHref = $(this).find("a:contains('Anfahren')").attr("href"); var HospitalHref = $(this).find("a:contains('Anfahren')").attr("href");
@@ -288,7 +290,7 @@ class AutomaticDispose {
} }
if (HospitalFreeBeds > 0) { if (HospitalFreeBeds > 0) {
Hospitals.push({ that.Hospitals.push({
"id": HospitalID, "id": HospitalID,
"value": HospitalValue, "value": HospitalValue,
"distance": HospitalDistance, "distance": HospitalDistance,
@@ -328,7 +330,7 @@ class AutomaticDispose {
} }
if (HospitalFreeBeds > 0 && HospitalSpecialDepartment) { if (HospitalFreeBeds > 0 && HospitalSpecialDepartment) {
Hospitals.push({ that.Hospitals.push({
"id": HospitalID, "id": HospitalID,
"value": HospitalValue, "value": HospitalValue,
"taxes": HospitalTaxes, "taxes": HospitalTaxes,
@@ -339,18 +341,18 @@ class AutomaticDispose {
}); });
} }
Hospitals.sort(function (a, b) { that.Hospitals.sort(function (a, b) {
return a.value - b.value; return a.value - b.value;
}); });
Hospitals.reverse(); that.Hospitals.reverse();
this.Send_Vehicle_To_Hospital() this.Send_Vehicle_To_Hospital()
} }
// Krankenhaus einlieferung // Krankenhaus einlieferung
Send_Vehicle_To_Hospital() { Send_Vehicle_To_Hospital() {
//var HospitalID = Hospitals[0].id; //var HospitalID = Hospitals[0].id;
var HospitalHref = Hospitals[0].href; var HospitalHref = this.Hospitals[0].href;
// TODO: tellParent("ADisMissionDone(" + window.name + "," + MissionID + ");"); // TODO: tellParent("ADisMissionDone(" + window.name + "," + MissionID + ");");
document.location.href = document.location.origin + HospitalHref; document.location.href = document.location.origin + HospitalHref;
@@ -461,6 +463,8 @@ class AutomaticDispose {
// Gefängnis auswählen // Gefängnis auswählen
Collect_Jails() { Collect_Jails() {
let that = this;
that.Jails = [];
var CountGefangene = Number(parseInt($('#h2_prisoners').text())); var CountGefangene = Number(parseInt($('#h2_prisoners').text()));
var parentNode = $('#mission_vehicle_at_mission tr > td:nth-child(5) > a:contains("Jomaar")').parent().parent(); var parentNode = $('#mission_vehicle_at_mission tr > td:nth-child(5) > a:contains("Jomaar")').parent().parent();
var GefKw = parentNode.find('td:nth-child(2) > a[vehicle_type_id="52"]'); var GefKw = parentNode.find('td:nth-child(2) > a[vehicle_type_id="52"]');
@@ -516,7 +520,7 @@ class AutomaticDispose {
} }
if (JailFreeBeds >= 5) { if (JailFreeBeds >= 5) {
Jails.push({ that.Jails.push({
"id": JailID, "id": JailID,
"value": JailValue + 1000, "value": JailValue + 1000,
"text": JailText, "text": JailText,
@@ -524,7 +528,7 @@ class AutomaticDispose {
"href": JailHref "href": JailHref
}); });
} else if (JailFreeBeds >= 1) { } else if (JailFreeBeds >= 1) {
Jails.push({ that.Jails.push({
"id": JailID, "id": JailID,
"value": JailValue, "value": JailValue,
"text": JailText, "text": JailText,
@@ -580,7 +584,7 @@ class AutomaticDispose {
} }
if (JailFreeBeds >= CountGefangene) { if (JailFreeBeds >= CountGefangene) {
Jails.push({ that.Jails.push({
"id": JailID, "id": JailID,
"value": JailValue + 1000, "value": JailValue + 1000,
"text": JailText, "text": JailText,
@@ -588,7 +592,7 @@ class AutomaticDispose {
"href": JailHref "href": JailHref
}); });
} else if (JailFreeBeds >= 1) { } else if (JailFreeBeds >= 1) {
Jails.push({ that.Jails.push({
"id": JailID, "id": JailID,
"value": JailValue, "value": JailValue,
"text": JailText, "text": JailText,
@@ -598,11 +602,11 @@ class AutomaticDispose {
} }
}); });
Jails.sort(function (a, b) { that.Jails.sort(function (a, b) {
return a.value - b.value; return a.value - b.value;
}); });
Jails.reverse(); that.Jails.reverse();
if (Jails.length > 0) { if (Jails.length > 0) {
this.Send_Vehicle_To_Jail() this.Send_Vehicle_To_Jail()
} else { } else {
@@ -639,7 +643,7 @@ class AutomaticDispose {
// Gefängnis einlieferung // Gefängnis einlieferung
Send_Vehicle_To_Jail() { Send_Vehicle_To_Jail() {
var JailHref = Jails[0].href var JailHref = that.Jails[0].href
document.location.href = document.location.origin + JailHref; document.location.href = document.location.origin + JailHref;
} }