Skip to content
TORNLIFE More

Unique Outcomes Script

Started by strongp [1338026] on in Tools & Userscripts.

0 replies · 178 views · thread synced · 5 days ago · View on torn.com
About this thread

Posts archived: 1 / 1 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
1
Discussion span
→
People posting
1
Likes on archived posts
1
Authority score
34 / 100
Historical score
13 / 100
Story score
23 / 100
Engagement score
41 / 100
strongp [1338026]

I'm a script newbie but had great fun writing a script to beep when the mobster was available for pickpocketing.

 

Now I've got that UO I was wondering about how to script to pick up the UO on shoplifting - I'm assuming it's possible to scan for the star that indicates the UO is available - but I can't test for what I'm searching for as I can't see any stars, and whereas the last script searched for a string on the rendered page this one will have to search the page source for the correct string to match...

 

Does anybody have any pointers - this is the script I used for the mobster BTW:

 

const keyword = "Mobster"; // Replace with the word you want to track

// Function to play a beep sound
function playBeep() {
    const audioContext = new (window.AudioContext || window.webkitAudioContext)();
    const oscillator = audioContext.createOscillator();
    oscillator.type = "sine"; // Type of sound wave (sine, square, etc.)
    oscillator.frequency.setValueAtTime(440, audioContext.currentTime); // Frequency in Hz (440 Hz = "A" note)
    oscillator.connect(audioContext.destination);
    oscillator.start();
    oscillator.stop(audioContext.currentTime + 0.2); // Play the sound for 0.2 seconds
}

// Check for the keyword on the page
setInterval(() => {
    if (document.body.innerText.includes(keyword)) {
        playBeep(); // Play beep sound
        //alert(`Keyword "${keyword}" detected!`); // Optional: Show an alert box
    }
}, 5000); // Check every 5 seconds