Windscribe Chrome Extension Region Auto Switcher

Doesn't actually work as a userscript, paste into console.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Windscribe Chrome Extension Region Auto Switcher
// @description  Doesn't actually work as a userscript, paste into console.
// @author       onlypuppy7
// @namespace    https://discord.gg/n6MEg2vfcw/
// @supportURL   http://forum.onlypuppy7.online/
// @license      GPL-3.0
// @icon         https://raw.githubusercontent.com/Hydroflame522/StateFarmClient/main/icons/StateFarmClientLogo384px.png
// @version      1.0
// @match        chrome-extension://hnmpcagpplmpfojmgmnngilcnanddlhb/popup.html
// ==/UserScript==

function clickLocationsButton() {
    document.querySelector('[aria-label="Locations"]').click();
}

function clickHeartButton() {
    document.querySelector('.css-klg4th-InlineButton-baseStyle-InlineButtonStyle-HeaderMenuItem').click();
}

function clickAtlanta() {
    const datacenters = document.querySelectorAll('.css-dn8yaz-DatacenterListItem');
    
    if (datacenters.length > 0) {
        const randomIndex = Math.floor(Math.random() * datacenters.length);
        
        datacenters[randomIndex].click();
    } else {
        console.log('No datacenter elements found.');
    }
}

function clickAutopilot() {
    var datacenterItems = document.querySelectorAll('.css-1oh5hha-BaseListItem-DatacenterListItem');
    var randomIndex = Math.floor(Math.random() * datacenterItems.length);
    datacenterItems[randomIndex].click();
}

function connect() {
    clickLocationsButton();
    setTimeout(function() {
        clickHeartButton();
        setTimeout(function() {
            clickAtlanta();
            if (REPEAT) setTimeout(function() {
                clickLocationsButton();
                setTimeout(function() {
                    clickAutopilot();
                    if (REPEAT) setTimeout(connect, DELAY);
                }, 750);
            }, DELAY);
        }, 750);
    }, 750);
}

connect();

REPEAT = false;

DELAY = 2 * 60 * 1000;