From df45f5e8d759b23ad82ca0058cd8805113fbc19a Mon Sep 17 00:00:00 2001 From: suzuryu-nep <66098690+suzuryu-nep@users.noreply.github.com> Date: Wed, 17 Mar 2021 20:03:52 +0900 Subject: [PATCH 1/6] Updated tag class names of querySelectors --- HuntFaloop.user.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/HuntFaloop.user.js b/HuntFaloop.user.js index 0e533bf..d29e3e2 100644 --- a/HuntFaloop.user.js +++ b/HuntFaloop.user.js @@ -4,7 +4,7 @@ // @description Script for ffxiv-the-hunt.net -> faloop integration // @include https://ffxiv-the-hunt.net/* // @include https://faloop.app/* -// @version 1.0.2 +// @version 1.0.3 // ==/UserScript== const mobs = [{ id: 2962, @@ -525,12 +525,12 @@ function main_huntnet() { * @param {int} timeOfDeath - timeOfDeath in unixtime millisec */ function setDefaultTOD(timeOfDeath) { - const detailPane = document.querySelector('div.MobReport_sections__3Huvj'); + const detailPane = document.querySelector('div.MobReport_sections__3yIiX'); if (!detailPane) { console.log('Could not find the details pane. skipping.'); return; } - const button = detailPane.querySelectorAll('div.ActionBox_up-down-btns__2Y8w_ button.btn-danger')[1]; + const button = detailPane.querySelectorAll('div.ActionBox_up-down-btns__2WbRP button.btn-danger')[1]; if (!button) { console.log('Could not find subtract TOD button. skipping.'); return; @@ -563,7 +563,7 @@ function setDefaultTOD(timeOfDeath) { for (let i = 0; i < minutes; i++) { button.dispatchEvent(new MouseEvent('click', { bubbles: true })); } - const submit = detailPane.querySelector('div.ActionBox_container__1yx4z button.btn-danger'); + const submit = detailPane.querySelector('div.ActionBox_container__1piW1 button.btn-danger'); if (submit) { submit.dispatchEvent(new MouseEvent('click', { bubbles: true })); } @@ -578,7 +578,7 @@ function setDefaultTOD(timeOfDeath) { * @param {int} retryCount - retry count */ function selectMob(worldsn, mob, retryCount, timeOfDeath=null, instanceid='') { - let nameTags = Array.from(document.querySelectorAll('div.SMobRow_row__2Wfh0')); + let nameTags = Array.from(document.querySelectorAll('div.SMobRow_row__1yWLG')); let nameTag = nameTags.find(t => { const name = t.querySelector('span.h5').textContent.toLowerCase(); const instance = t.querySelector('span.h4') != null ? t.querySelector('span.h4').textContent.toLowerCase() : ''; From 2a1d57bca67b5c83217701b789f74dd3983d4033 Mon Sep 17 00:00:00 2001 From: suzuryu-nep <66098690+suzuryu-nep@users.noreply.github.com> Date: Mon, 19 Apr 2021 21:57:51 +0900 Subject: [PATCH 2/6] 21/4/19 Updated tag class names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nameTagsのクラス名変更に対応。 --- HuntFaloop.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HuntFaloop.user.js b/HuntFaloop.user.js index d29e3e2..4247901 100644 --- a/HuntFaloop.user.js +++ b/HuntFaloop.user.js @@ -4,7 +4,7 @@ // @description Script for ffxiv-the-hunt.net -> faloop integration // @include https://ffxiv-the-hunt.net/* // @include https://faloop.app/* -// @version 1.0.3 +// @version 1.0.4 // ==/UserScript== const mobs = [{ id: 2962, @@ -578,7 +578,7 @@ function setDefaultTOD(timeOfDeath) { * @param {int} retryCount - retry count */ function selectMob(worldsn, mob, retryCount, timeOfDeath=null, instanceid='') { - let nameTags = Array.from(document.querySelectorAll('div.SMobRow_row__1yWLG')); + let nameTags = Array.from(document.querySelectorAll('div.SMobsPageRow_row__2qBhm')); let nameTag = nameTags.find(t => { const name = t.querySelector('span.h5').textContent.toLowerCase(); const instance = t.querySelector('span.h4') != null ? t.querySelector('span.h4').textContent.toLowerCase() : ''; From 6bafa97f8cbb3bf21cf574df98aa86c1a7ec9f84 Mon Sep 17 00:00:00 2001 From: suzuryu-nep <66098690+suzuryu-nep@users.noreply.github.com> Date: Tue, 11 May 2021 19:15:40 +0900 Subject: [PATCH 3/6] 21/5/11 fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ワールド名badgeがある場合の挙動を修正。 -既知の問題 表示ワールドが1つでbadgeが無い場合、ワールド名を取得できない --- HuntFaloop.user.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HuntFaloop.user.js b/HuntFaloop.user.js index 4247901..7287f1c 100644 --- a/HuntFaloop.user.js +++ b/HuntFaloop.user.js @@ -582,7 +582,8 @@ function selectMob(worldsn, mob, retryCount, timeOfDeath=null, instanceid='') { let nameTag = nameTags.find(t => { const name = t.querySelector('span.h5').textContent.toLowerCase(); const instance = t.querySelector('span.h4') != null ? t.querySelector('span.h4').textContent.toLowerCase() : ''; - const sn = t.querySelector('span.badge.d-inline').textContent.toLowerCase(); + let sn_temp = t.querySelector('span.badge.mr-2').textContent.toLowerCase(); + const sn = sn_temp.slice(0, 4); console.log(`world: ${worldsn}=${sn}`, `instance: ${instanceid}=${instance}`, `mob: ${name}=${mob.name_ja.toLowerCase()}|${mob.name_en.toLowerCase()}|${mob.name_fr.toLowerCase()}|${mob.name_de.toLowerCase()}`); return (worldsn == sn && instanceid == instance && (name == mob.name_ja.toLowerCase() || From 5bf51bff0835cfd3624bf3d1161ebc3ce85d12de Mon Sep 17 00:00:00 2001 From: suzuryu-nep <66098690+suzuryu-nep@users.noreply.github.com> Date: Wed, 12 May 2021 14:18:45 +0900 Subject: [PATCH 4/6] 21/5/12 Fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -表示ワールド選択ボタンからワールド名を一時取得するようにした -ワールド名badgeが検出できない場合、一時取得したワールド名を適用するようにした 既知の問題 -スマホ向け表示で、単一ワールド表示にしていると機能しなくなる →ワールド名を取得する方法が無い。どうすればいいのこれ・・・ --- HuntFaloop.user.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HuntFaloop.user.js b/HuntFaloop.user.js index 7287f1c..279f810 100644 --- a/HuntFaloop.user.js +++ b/HuntFaloop.user.js @@ -578,11 +578,12 @@ function setDefaultTOD(timeOfDeath) { * @param {int} retryCount - retry count */ function selectMob(worldsn, mob, retryCount, timeOfDeath=null, instanceid='') { + let sn_temp2 = document.querySelector('span.w-100.text-left') != null ? document.querySelector('span.w-100.text-left').textContent.toLowerCase() : ''; let nameTags = Array.from(document.querySelectorAll('div.SMobsPageRow_row__2qBhm')); let nameTag = nameTags.find(t => { const name = t.querySelector('span.h5').textContent.toLowerCase(); const instance = t.querySelector('span.h4') != null ? t.querySelector('span.h4').textContent.toLowerCase() : ''; - let sn_temp = t.querySelector('span.badge.mr-2').textContent.toLowerCase(); + let sn_temp = t.querySelector('span.badge.mr-2') != null ? t.querySelector('span.badge.mr-2').textContent.toLowerCase() : sn_temp2; const sn = sn_temp.slice(0, 4); console.log(`world: ${worldsn}=${sn}`, `instance: ${instanceid}=${instance}`, `mob: ${name}=${mob.name_ja.toLowerCase()}|${mob.name_en.toLowerCase()}|${mob.name_fr.toLowerCase()}|${mob.name_de.toLowerCase()}`); return (worldsn == sn && instanceid == instance && From 2e67bad0aa4eb5e04a8414d01bc9e145c6bdf9b2 Mon Sep 17 00:00:00 2001 From: suzuryu-nep Date: Sun, 7 Nov 2021 09:14:50 +0900 Subject: [PATCH 5/6] Updated tag class names, and Fixed getting world names --- HuntFaloop.user.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/HuntFaloop.user.js b/HuntFaloop.user.js index 751bf6d..7b2198e 100644 --- a/HuntFaloop.user.js +++ b/HuntFaloop.user.js @@ -624,12 +624,12 @@ function main_huntnet() { * @param {int} timeOfDeath - timeOfDeath in unixtime millisec */ function setDefaultTOD(timeOfDeath) { - const detailPane = document.querySelector('div.MobReport_sections__3Huvj'); + const detailPane = document.querySelector('div.MobReport_sections__3MDui'); if (!detailPane) { console.log('Could not find the details pane. skipping.'); return; } - const button = detailPane.querySelectorAll('div.ActionBox_up-down-btns__2Y8w_ button.btn-danger')[1]; + const button = detailPane.querySelectorAll('div.ActionBox_up-down-btns__3b1sX button.btn-danger')[1]; if (!button) { console.log('Could not find subtract TOD button. skipping.'); return; @@ -662,7 +662,7 @@ function setDefaultTOD(timeOfDeath) { for (let i = 0; i < minutes; i++) { button.dispatchEvent(new MouseEvent('click', { bubbles: true })); } - const submit = detailPane.querySelector('div.ActionBox_container__1yx4z button.btn-danger'); + const submit = detailPane.querySelector('div.ActionBox_container__3TQri button.btn-danger'); if (submit) { submit.dispatchEvent(new MouseEvent('click', { bubbles: true })); } @@ -677,11 +677,13 @@ function setDefaultTOD(timeOfDeath) { * @param {int} retryCount - retry count */ function selectMob(worldsn, mob, retryCount, timeOfDeath=null, instanceid='') { - let nameTags = Array.from(document.querySelectorAll('div.SMobRow_row__2Wfh0')); + let sn_temp2 = document.querySelector('span.w-100.text-truncate') != null ? document.querySelector('span.w-100.text-truncate').textContent.toLowerCase() : ''; + let nameTags = Array.from(document.querySelectorAll('div.SMobsPageRow_row__AyBDV')); let nameTag = nameTags.find(t => { const name = t.querySelector('span.h5').textContent.toLowerCase(); const instance = t.querySelector('span.h4') != null ? t.querySelector('span.h4').textContent.toLowerCase() : ''; - const sn = t.querySelector('span.badge.d-inline').textContent.toLowerCase(); + let sn_temp = t.querySelector('span.badge.mr-2') != null ? t.querySelector('span.badge.mr-2').textContent.toLowerCase() : sn_temp2; + const sn = sn_temp.slice(0, 4); console.log(`world: ${worldsn}=${sn}`, `instance: ${instanceid}=${instance}`, `mob: ${name}=${mob.name_ja.toLowerCase()}|${mob.name_en.toLowerCase()}|${mob.name_fr.toLowerCase()}|${mob.name_de.toLowerCase()}`); return (worldsn == sn && instanceid == instance && (name == mob.name_ja.toLowerCase() || From ea4c88d1a4374614e258853c8c72c5502fa46eee Mon Sep 17 00:00:00 2001 From: suzuryu-nep Date: Sun, 7 Nov 2021 09:50:59 +0900 Subject: [PATCH 6/6] =?UTF-8?q?Remove=20DC=20names=20from=20URLs=20?= =?UTF-8?q?=E3=82=A8=E3=83=A9=E3=83=BC=E5=AF=BE=E5=BF=9C=E3=81=AE=E6=9A=AB?= =?UTF-8?q?=E5=AE=9A=E5=87=A6=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HuntFaloop.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HuntFaloop.user.js b/HuntFaloop.user.js index 7b2198e..9e20f8d 100644 --- a/HuntFaloop.user.js +++ b/HuntFaloop.user.js @@ -607,8 +607,8 @@ function main_huntnet() { } window.open( instanceid==0 ? - `https://faloop.app/${worldmap[world.toLowerCase()].dc}?worldid=${worldmap[world.toLowerCase()].id}&mobid=${currentmobid}&time=${mean}` : - `https://faloop.app/${worldmap[world.toLowerCase()].dc}?worldid=${worldmap[world.toLowerCase()].id}&mobid=${currentmobid}&instanceid=${instanceid}&time=${mean}`, "_blank"); + `https://faloop.app/?worldid=${worldmap[world.toLowerCase()].id}&mobid=${currentmobid}&time=${mean}` : + `https://faloop.app/?worldid=${worldmap[world.toLowerCase()].id}&mobid=${currentmobid}&instanceid=${instanceid}&time=${mean}`, "_blank"); } } }