23_feb_battles_evasion

Если 9 или 0 минут и надеты арты, заходит в инвентарь и снимает их

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

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

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

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

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

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

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         23_feb_battles_evasion
// @namespace    http://tampermonkey.net/
// @version      0.2.3
// @description  Если 9 или 0 минут и надеты арты, заходит в инвентарь и снимает их
// @author       You
// @license     GNU GPLv3
// @match       https://www.heroeswm.ru/*
// @match       https://my.lordswm.com/*
// @match       https://www.lordswm.com/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// ==/UserScript==
function get_request(url){
    var oReq = new XMLHttpRequest();
    oReq.open("get", url, false);
    oReq.send();
    return oReq.responseText
}
function dressed(){
    let wrapper= document.createElement('div');
    wrapper.innerHTML = get_request("https://"+location.host+"/inventory.php")
    let div_table = wrapper.querySelectorAll("[art_id='0']")
    for(let i = 0; i< div_table.length; i++){
        if (!div_table[i].className.includes("slot_size inv_slot_hover slot")) continue;
        if (div_table[i].children.length>0){
            return true
            break
        }
    }
    return false
}
let loop = ()=>{
    let now = new Date()
    let time_last_digit = now.getMinutes().toString().slice(-1)
    if (time_last_digit=="9"||time_last_digit=="0"){
        if (window.location.href.includes("inventory") ){
            if(dressed()) window.try_undress_all()
        }
        else{
            if (dressed()) window.location = "https://"+location.host+"/inventory.php"
        }
    }
}
loop()
let interval1 = setInterval(loop, 3000)