Pickpocket Cyclists

Hilight cyclists and hide police officers

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         Pickpocket Cyclists
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Hilight cyclists and hide police officers
// @author       Baskerville
// @match        https://www.torn.com/loader.php?sid=crimes
// @icon         https://www.google.com/s2/favicons?sz=64&domain=torn.com
// @grant        none
// @license      MIT
// ==/UserScript==

const bell = new Audio('https://mhece.com/media/bicycle-bell.mp3')

function picker(){
    const l = document.querySelectorAll('div.crime-option')
    for(const div of l){
        let b = div.querySelector('.titleAndProps___DdeVu').textContent
        if (b.includes('Cyclist')){
            const green = '#ccffcc'
            if(div.style.backgroundColor != green){
                div.style.backgroundColor = green
                bell.play()
            }
        }
        else if (b.includes('Police')){
            div.style.display = 'none'
        }
    }
}

// Options for the observer (which mutations to observe)
const config = { attributes: true, childList: true, subtree: true }
const observer = new MutationObserver(picker)
observer.observe(document.body, config)