Advertisement
Guest User

Windscribe connection rotation

a guest
Jan 31st, 2023
563
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. ::echo off
  2. ::
  3. :: script to connect to a list of Windscribe city/locations from a list of locations we want to use.
  4. :: connects to each location in order.
  5. :: runs until you Cntrl-C the script.
  6.  
  7. :: ws-temp-log.txt captures the output of the last connection
  8. :: ws-log.txt records all the locations we connected to.
  9.  
  10. del ws-temp-log1.txt
  11. del ws-log.txt
  12.  
  13. setlocal enabledelayedexpansion
  14. Set ConnectList="US" "Canada East" "Canada West" "MX" "PA" "Poland" "luxembourg"
  15.  
  16. :: Count the list and put each item into a numbered variable
  17. :: element[1]=US
  18. :: element[2]=Canada East,
  19. :: etc
  20.  
  21. Set MaxCity=0
  22. for %%i in (%ConnectList%) do (
  23. set /a MaxCity+=1
  24. set element[!MaxCity!]=%%i
  25. )
  26.  
  27. :: display the "array"
  28.  
  29. set element
  30. echo There are %MaxCity% items in the ConnectList
  31.  
  32. set index=0
  33.  
  34. :reconnect
  35. :: index runs from 0-(x-1), we need 1-X, create temp variable
  36.  
  37. set /a in=%index% + 1
  38. echo Connecting to !element[%in%]!
  39. "C:\Program Files\Windscribe\windscribe-cli.exe" connect !element[%in%]!>ws-temp-log.txt
  40.  
  41. for /f "delims=* skip=1 tokens=1" %%l in (ws-temp-log.txt) do (
  42. Set WSlocation=%%l
  43. )
  44.  
  45. :: log date/time and location we connected to.
  46. Echo %date% %time% [%WsLocation%]>> ws-log.txt
  47.  
  48. :: set index to the next location, take the mod(index,maxcity).
  49. :: This will return a number between 0 - MaxCity-1
  50. :: if maxcity=10, then index will be between 0-9
  51.  
  52. ::set /a index+=1
  53. ::set /a index=%index% %% %MaxCity%
  54.  
  55. ::
  56. :: if you want to pick a random location from the list use
  57. :: set /a index=%random% %% %MaxCity%
  58.  
  59. :: wait some time (in seconds 2700=45 minutes)
  60. Timeout /T 1800
  61.  
  62. goto :reconnect
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement