Bounty Alert

Bounty detection for Torn profiles

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

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