Bounty Alert

Bounty detection for Torn profiles

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Bounty Alert
// @namespace    http://tampermonkey.net/
// @version      2.6.9
// @description  Bounty detection for Torn profiles
// @author       Pint-Shot-Riot 
// @match        https://www.torn.com/profiles.php?XID=*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    let isDismissed = false;

    function findBounty() {
        if (isDismissed) return;

        const icons = document.querySelectorAll('.profile-icons li, .icons li');
        let bountyElement = null;

        for (const li of icons) {
            const hasLink = li.querySelector('a[href*="bounties.php"]');
            const hasIcon = li.querySelector('i[class*="bounty"], #bounty');
            if (hasLink || hasIcon) {
                bountyElement = li;
                break;
            }
        }

        if (bountyElement) {
            // We still find the element to trigger the banner, but we don't pass the amount anymore
            renderBanner();
        }
    }

    function renderBanner() {
        if (document.getElementById('torn-bounty-alert')) return;

        const target = document.querySelector('.content-wrapper') || document.querySelector('.profile-wrapper');
        
        if (target) {
            const banner = document.createElement('div');
            banner.id = 'torn-bounty-alert';
            banner.style = `
                background: #111; 
                color: #ff3b3b; 
                padding: 15px; 
                text-align: center; 
                font-size: 24px; 
                font-weight: 900; 
                border: 5px solid #ff3b3b; 
                margin: 10px auto; 
                width: 90%;
                border-radius: 8px;
                box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
                font-family: sans-serif;
                z-index: 9999;
                cursor: pointer;
            `;
            // Removed ${amount} and replaced with generic text
            banner.innerHTML = `⚠️ BOUNTY DETECTED ⚠️<br><span style="font-size: 12px; font-weight: normal;">(Click to dismiss)</span>`;
            
            banner.addEventListener('click', () => {
                isDismissed = true;
                banner.remove();
            });

            target.prepend(banner);
            
            const context = new (window.AudioContext || window.webkitAudioContext)();
            const osc = context.createOscillator();
            const gain = context.createGain();
            
            osc.type = 'square';
            osc.frequency.value = 300;
            gain.gain.value = 0.1; 

            osc.connect(gain);
            gain.connect(context.destination);
            
            osc.start();
            osc.stop(context.currentTime + 0.1);
        }
    }

    const timer = setInterval(findBounty, 1000);
    setTimeout(() => clearInterval(timer), 10000);
})();