SBAuto Randomized

Automates Swagbucks surveys with randomized answers until no questions remain

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 or Violentmonkey 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         SBAuto Randomized
// @namespace    http://tampermonkey.net/
// @version      2.2
// @description  Automates Swagbucks surveys with randomized answers until no questions remain
// @author       Thaswasupbreh
// @match        http://www.swagbucks.com/surveys?t=1&m=17&a=1&s=44834408&ls=7
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const autoClickInterval = 1000; // Interval in ms

    setInterval(() => {
        try {
            const dropdownContainer = document.querySelector(".questionDropdownContainer");
            if (dropdownContainer) dropdownContainer.click();

            const optionsContainer = document.querySelector(".questionDropdownOptions");
            const options = optionsContainer ? optionsContainer.querySelectorAll("span") : [];

            if (options.length > 0) {
                const randomIndex = Math.floor(Math.random() * options.length);
                options[randomIndex].click();
            }

            const submitButton = document.querySelector(".surveyQuestionCTA button");
            if (submitButton) submitButton.click();
        } catch (err) {
            console.error("SBAuto Error:", err);
        }
    }, autoClickInterval);
})();