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 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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();


}