From 3b2adf161140d6ff2d39dd50f370f336cbf0a0c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Fr=C3=B6hle?= Date: Sat, 24 Nov 2018 16:33:56 +0100 Subject: [PATCH] cap --- dist/autoloader.js | 15 +++++++++++++-- dist/standalone.js | 2 +- script/sprechwunsch/police-opener.js | 13 ++++++++++++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/dist/autoloader.js b/dist/autoloader.js index 8a4a655..c06ca39 100755 --- a/dist/autoloader.js +++ b/dist/autoloader.js @@ -1,4 +1,4 @@ -/*Generated on:Sat Nov 24 2018 16:25:38 GMT+0100 (CET)*/ +/*Generated on:Sat Nov 24 2018 16:33:55 GMT+0100 (CET)*/ var AutomaticDispose_Branch = "master"; var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/"; var da_lss_adis_time = new Date().getTime(); @@ -6443,13 +6443,24 @@ ADisDB.on("ready", () => { }).then(() => { console.log('ADis_CollectPoliceSprechwuensche: add'); var MOIODOS = $('div#mission_list div.missionSideBarEntry:visible'); - MOIODOS.each(function (index) { + return MOIODOS.each(function (index) { console.log('ADis_CollectPoliceSprechwuensche: add', $(this).text().match(/Gefangene sollen abtransportiert werden/g)); if ($(this).text().match(/Gefangene sollen abtransportiert werden/g)) { var MissionID = $(this).attr("mission_id"); ADis_AddPoliceSprechwunschToQueue(MissionID); } }); + }).then(()=>{ + $("#building_list").find(".building_list_vehicle_element").each(function () { + var VehicleStatus = $(this).find(".building_list_fms").text(); + var VehicleType = Number(parseInt($(this).find("a").attr("vehicle_type_id"))); + var VehicleID = $(this).attr("vehicle_id"); + var _meap = $('#radio_messages_important > li.radio_message_vehicle_' + VehicleID + ' > a:contains("Zum Einsatz")').attr('href'); + var MissionID = _meap.substr(_meap.lastIndexOf("/") + 1); + if (MissionID && VehicleStatus == "5" && [32, 52].indexOf(VehicleType) !== -1) { + ADis_AddPoliceSprechwunschToQueue(MissionID); + } + }); }); } diff --git a/dist/standalone.js b/dist/standalone.js index 3a2b07b..6e0948b 100644 --- a/dist/standalone.js +++ b/dist/standalone.js @@ -1,4 +1,4 @@ -/*Generated on:Sat Nov 24 2018 16:25:38 GMT+0100 (CET)*/ +/*Generated on:Sat Nov 24 2018 16:33:55 GMT+0100 (CET)*/ function includesString(string1, string2) { return string1.toLowerCase().includes(string2.toLowerCase()); } diff --git a/script/sprechwunsch/police-opener.js b/script/sprechwunsch/police-opener.js index 3b45402..ecacc16 100755 --- a/script/sprechwunsch/police-opener.js +++ b/script/sprechwunsch/police-opener.js @@ -27,13 +27,24 @@ function ADis_CollectPoliceSprechwuensche() { }).then(() => { console.log('ADis_CollectPoliceSprechwuensche: add'); var MOIODOS = $('div#mission_list div.missionSideBarEntry:visible'); - MOIODOS.each(function (index) { + return MOIODOS.each(function (index) { console.log('ADis_CollectPoliceSprechwuensche: add', $(this).text().match(/Gefangene sollen abtransportiert werden/g)); if ($(this).text().match(/Gefangene sollen abtransportiert werden/g)) { var MissionID = $(this).attr("mission_id"); ADis_AddPoliceSprechwunschToQueue(MissionID); } }); + }).then(()=>{ + $("#building_list").find(".building_list_vehicle_element").each(function () { + var VehicleStatus = $(this).find(".building_list_fms").text(); + var VehicleType = Number(parseInt($(this).find("a").attr("vehicle_type_id"))); + var VehicleID = $(this).attr("vehicle_id"); + var _meap = $('#radio_messages_important > li.radio_message_vehicle_' + VehicleID + ' > a:contains("Zum Einsatz")').attr('href'); + var MissionID = _meap.substr(_meap.lastIndexOf("/") + 1); + if (MissionID && VehicleStatus == "5" && [32, 52].indexOf(VehicleType) !== -1) { + ADis_AddPoliceSprechwunschToQueue(MissionID); + } + }); }); }