Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ::echo off
- ::
- :: script to connect to a list of Windscribe city/locations from a list of locations we want to use.
- :: connects to each location in order.
- :: runs until you Cntrl-C the script.
- :: ws-temp-log.txt captures the output of the last connection
- :: ws-log.txt records all the locations we connected to.
- del ws-temp-log1.txt
- del ws-log.txt
- setlocal enabledelayedexpansion
- Set ConnectList="US" "Canada East" "Canada West" "MX" "PA" "Poland" "luxembourg"
- :: Count the list and put each item into a numbered variable
- :: element[1]=US
- :: element[2]=Canada East,
- :: etc
- Set MaxCity=0
- for %%i in (%ConnectList%) do (
- set /a MaxCity+=1
- set element[!MaxCity!]=%%i
- )
- :: display the "array"
- set element
- echo There are %MaxCity% items in the ConnectList
- set index=0
- :reconnect
- :: index runs from 0-(x-1), we need 1-X, create temp variable
- set /a in=%index% + 1
- echo Connecting to !element[%in%]!
- "C:\Program Files\Windscribe\windscribe-cli.exe" connect !element[%in%]!>ws-temp-log.txt
- for /f "delims=* skip=1 tokens=1" %%l in (ws-temp-log.txt) do (
- Set WSlocation=%%l
- )
- :: log date/time and location we connected to.
- Echo %date% %time% [%WsLocation%]>> ws-log.txt
- :: set index to the next location, take the mod(index,maxcity).
- :: This will return a number between 0 - MaxCity-1
- :: if maxcity=10, then index will be between 0-9
- ::set /a index+=1
- ::set /a index=%index% %% %MaxCity%
- ::
- :: if you want to pick a random location from the list use
- :: set /a index=%random% %% %MaxCity%
- :: wait some time (in seconds 2700=45 minutes)
- Timeout /T 1800
- goto :reconnect
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement