PayDay 3 Stats+

ajoute des stats, filtre pour voir vos défis bientôt fini(Top 4%), update auto(10min), (modifier les variables: interval et top si besoin)

当前为 2023-11-30 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         PayDay 3 Stats+
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  ajoute des stats, filtre pour voir vos défis bientôt fini(Top 4%), update auto(10min), (modifier les variables: interval et top si besoin)
// @author       DEV314R
// @match        https://pd3.gg/challenges/*
// @icon         https://icons.duckduckgo.com/ip2/pd3.gg.ico
// @run-at       document-end
// @license      MIT
// @grant        none
// ==/UserScript==
const interval=10//minute
const top=4//%

if (location.href.search(/challenges\/(weapons|heists|special-units|equipment|miscellaneous)/gi) > -1) {

const filterRow = document.querySelector(".filter > .row");
filterRow.insertAdjacentHTML('beforeend', `<div class="col-auto"><div class="filter-item"><input type="checkbox" autocomplete="off" class="control-check" id="avenir" >&nbsp;Top `+top+`% Proche</input></div></div>`);


const objectivesProgressElements = document.querySelectorAll(".objectives-progress");

let highestProchemax = 0;

for (const El of objectivesProgressElements) {
    const prochmax = El.querySelector(".objectives > .objective:not(.completed) > div.text");

    if(prochmax){
    const prochemaxValue=parseInt(prochmax.textContent);
    highestProchemax=Math.max(highestProchemax,prochemaxValue);
    }
}

const threshold=(top/100) * highestProchemax;

for(const El of objectivesProgressElements){
    const maxElement=El.querySelector(".objectives > .objective:last-child  > div.text");
    const currentElement=El.querySelector(".current-progress > div.text");
    const prochmax=El.querySelector(".objectives > .objective:not(.completed) > div.text");
    const pointproch=El.querySelector(".objectives-progress > div > div.objectives > .objective:not(.completed) > div.text");

    if (maxElement&&currentElement&&prochmax&&pointproch){
        const max = parseInt(maxElement.textContent);
        const current = parseInt(currentElement.textContent);
        const prochemax = parseInt(prochmax.textContent);
        const pointinf = parseInt(pointproch.title.match(/\d.+/gi));

   if(max>current){
   El.insertAdjacentHTML('afterend', `<a>Proche:${prochemax - current}<br>PI:${pointinf}<br>Total:${max - current}</a>`);
   }
document.getElementById("avenir").addEventListener("change",function () {
const isChecked=this.checked;
El.parentElement.style.display=isChecked&&(prochemax-current)>threshold ? "none" : "";
})

}
}

function appuyerSurBoutonToutesLesXMinutes() {
    // Vérifie si le dernier appui sur le bouton a été enregistré
    let lastButtonClickTime = localStorage.getItem('lastButtonClickTime');

    // Si c'est la première fois, ou si cela fait plus de 10 minutes depuis le dernier appui
    if (!lastButtonClickTime || (Date.now() - lastButtonClickTime > interval * 60 * 1000)) {
        // Appuie sur le bouton
       document.querySelector("#updateUserStatsBtn").click();

        // Enregistre le temps de l'appui sur le bouton actuel
        localStorage.setItem('lastButtonClickTime', Date.now());
    }

    // Configure l'intervalle pour appeler la fonction toutes les interval minutes
    setInterval(appuyerSurBoutonToutesLesXMinutes, interval * 60 * 1000);
}
appuyerSurBoutonToutesLesXMinutes();


}