Property Highlight

highlights properties, only yours

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name Property Highlight
// @namespace http://tampermonkey.net/
// @version 0.2
// @description highlights properties, only yours
// @author TheProfessor [1425134]
// @match https://www.torn.com/properties.php*
// @icon https://www.google.com/s2/favicons?sz=64&domain=torn.com
// @grant none
// @license MIT
// ==/UserScript==

function check(){
    var properties = $('.properties-list').children().each(function(){
        var prop = $(this);
        if ($(".image-description",prop).length>0){

                var des = $(".image-description",prop).text();

                if (des.includes('Leased to')){
                    var days_test = des.split('/')[0].split('(')[2];
                    var days = parseInt(des.split('/')[0].split('(')[1]);
                    // window.alert(days_test, typeof(days_test))
                    if (days_test <= 10){
                        $(".image-description",prop).css("background", "linear-gradient(0.25turn, rgba(255, 160, 0, 0.125), rgba(255, 160, 0, 0.325), rgba(255, 160, 0, 0.125))");
                    }
                }
                else if (des.includes('Owned by your spouse')){
                    $(".image-description",prop).css("background", "linear-gradient(0.25turn, rgba(210, 48, 48, 0.125), rgba(210, 48, 48, 0.8), rgba(210, 48, 48, 0.125))");
                }
                else if (des.includes('Owned by you') && !des.includes("spouse")){
                    $(".image-description",prop).css("background", "linear-gradient(0.25turn, rgba(40, 211, 45, 0.125), rgba(40, 211, 45, 0.325), rgba(40, 211, 45, 0.125))");
                }
                else if (des.includes('You and your spouse are living here')){
                    $(".image-description",prop).css("background", "linear-gradient(0.25turn, rgba(40, 210, 211, 0.125), rgba(40, 210, 211, 0.4), rgba(40, 210, 211, 0.125))");
                }
                else if (des.includes('Up for rent')){
                     $(".image-description",prop).css("background", "linear-gradient(0.25turn, rgba(36, 117, 255, 0.125), rgba(36, 117, 255, 0.325), rgba(36, 117, 255, 0.125))");
                }

            }
    });


}

(function() {
    setInterval(check,500);


})();