Windscribe Chrome Extension Region Auto Switcher

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

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 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;