Property Highlight

highlights properties, only yours

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==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);


})();