PayDay 3 Stats+

ajoute des stats

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         PayDay 3 Stats+
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  ajoute des stats
// @author       DEV314R
// @match        https://pd3.gg/challenges/*
// @icon         https://icons.duckduckgo.com/ip2/pd3.gg.ico
// @run-at       document-end
// @grant        none
// ==/UserScript==
const interval=10//minute


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

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

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

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

if (max > current) {
objectivesProgressElement.insertAdjacentHTML('afterend',`<a> Proche:`+(prochemax-current)+` IP:`+pointinf+`<br>Total:`+(max-current)+`</a>`);
}
  }
}



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 10 minutes
    setInterval(appuyerSurBoutonToutesLesXMinutes, interval * 60 * 1000);
}
appuyerSurBoutonToutesLesXMinutes();


}
//},1000)