home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 42,524 of 42,547   
   Marion to All   
   Improving Aloha free VPN privacy using a   
   19 Oct 25 22:34:24   
   
   XPost: alt.privacy, alt.comp.freeware   
   From: marionf@fact.com   
      
   Aloha is a free VPN browser but it's crippleware in that the VPN shuts off   
   randomly, necessitating an always running underlying proxy or VPN.   
      
   To combat the fact the free VPN randomly shuts off (by design), this   
   AutoHotkey script makes the Aloha browser actually immensely more useable.   
      
   I wrote this script to first launch the Aloha VPN Browser, and, if you have   
   "On Startup" URLs, it waits for its window, then it continuously monitors   
   the VPN shield icon inside that browser (every half second) and clicks it   
   only when the VPN shield is detected as gray (off) so the VPN remains   
   enabled (blue) at all times.   
      
   If perchance the Aloha browser window is covered over by another window,   
   the script forces a tiny repaint of the Aloha window before sampling pixel   
   colors again.   
      
   I also added follow-me code if the browser window is resized or moved (even   
   if it's moved to another monitor) by using client-relative coordinates so   
   it works across monitors and window positions, and exits gracefully when   
   the Aloha browser process closes.   
      
   Clicks are implemented to avoid stealing focus or visibly moving the mouse   
   and the script preserves mouse position around its clicks.   
      
   The script originally included a clear-browsing-data action in earlier   
   versions but the current version removed that click to simplify behavior.   
       
      
   The script forces a tiny visual change (transparency toggle) to prompt   
   Aloha to repaint shield pixels when the window is unfocused so pixel   
   sampling remains accurate.   
      
   In summary, this AHK script will prevent Aloha VPN dropouts using an automatic   
   shield-re-enable AHK script   
      
   (which runs silently in the bg w/o stealing focus or moving the mouse.)   
      
   It wasn't easy to write. But here it is all done and working for you!   
   Please improve, of course, so everyone benefits from every post you make.   
      
     ; C:\data\sys\ahk\alohavpn.ahk   
     ; This is alohavpn.ahk v1.7   
     ; This script automatically launches the Aloha VPN Browser,   
     ; presses a button to clear browsing data, and continuously   
     ; monitors the VPN shield icon by clicking it only if it's off   
     ; (gray) to ensure the VPN stays enabled (blue) even if the   
     ; browser window isn't the active window or if it's behind others.   
     ; Behavior:   
     ;  1) Opens Aloha browser   
     ;  2) Clicks VPN (gray) shield icon to enable it (blue);   
     ;  3) Then periodically checks the shield x:y location 140:53;   
     ;  4) If the shield is gray (off), click it; if blue (on), do nothing.   
     ; Notes:   
     ; Limit on comment line length is .......................................   
     ;  Coordinates are relative to the Aloha window (CoordMode "Window").   
     ;  The origin (0,0) is the window top-left corner (incl title/borders).   
     ;  The X increases to the right; the Y increases downward.   
     ;  Works regardless of monitor the window is on or where it's moved.   
     ;  Works regardless of window size.   
     ;  Works on the window regardless if it's active (current focus) or not.   
     ;  Use Window Spy to confirm pixel colors and window-relative coordinates.   
     ;  Clicks use ControlClick so focus isn't stolen & the mouse doesn't move.   
     ; Versions   
     ;  v1.0 20250910 59 lines   
     ;   Launches the freeware Aloha VPN Browser [Version 4.9.0.0 (64-bit)]   
     ;   Set the shortcut TARGET = C:\data\sys\ahk\aloha_vpn.ahk   
     ;   This script runs Aloha which opens to clearBrowserData   
     ;       
     ;   This script taps the "Clear data" button on bottom right   
     ;   Then it taps the VPN shield at top to turn the shield on automatically   
     ;  v1.1 20251016 68 lines   
     ;   Taps the shield icon every 30 seconds   
     ;   The probem is that it toggles it off if it had been toggled on   
     ;   v1.2 20251016 75 lines   
     ;   Use "C:\Program Files\AutoHotkey\WindowSpy.ahk" to get the color   
     ;   Click 601, 68 ; this is in the blue/gray part (5895F6/BEBEC4)   
     ;  v1.3 20251016 142 lines   
     ;   If gray, tap it. If blue, don't tap it.   
     ;   Colors from Window Spy (hex RRGGBB)   
     ;    blueHex := 0x5895F6   
     ;    grayHex := 0xBEBEC4   
     ;    tolerance := 30  ; adjust if needed (0-441)   
     ;   ControlClick without moving the visible mouse (no flicker)   
     ;  v1.4 20251016 148 lines   
     ;   Changed the time period from 30 seconds to 1 second   
     ;   30 seconds = 30000, 1 second = 1000   
     ;  v1.5 20251016 127 lines   
     ;   Cleaned up comments   
     ;  v1.6 20251016 161 lines   
     ;   Changed hard-coded path to aloha.exe to be independent of user   
     ;   Added detection of run failure for a more robust watcher   
     ;  v1.7 20251017 175 lines   
     ;   Removed the clear-cookies click to simplify the script.   
     ;   Added the ability to monitor the shield no matter where it is.   
     ;   Changed x:y coordinates relative to the screen top-left origin   
     ;   to x:y (140:53) coordinates relative to the window top-left origin.   
     ;   Screen: 602, 67, Window: 140, 53   
     ;   No matter where the Aloha window is on the monitor, the shield   
     ;   icon will always be at (140,53) relative to the window's origin.   
     ;   Client: 132, 53 (default) (i.e., main monitor)   
     ;   Color: 5895F6 (Red=58 Green=95 Blue=F6) (blue)   
     ;   Active windows position   
     ;   Screen: x: 462 y: 14 w: 910	h: 1060   
     ;   Client: x: 470 y: 14 w: 894	h: 1052   
     ;   The shield icon is always (139,54) relative to window origin   
     ;   (or (131,54) in client coordinates).   
     ;   Aloha wasn't repainting shield icon when the window is unfocused.   
     ;   so we needed to force a tiny "change" in aloha to repaint pixels.   
     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   
      
     ; Step 1: Launch Aloha VPN Browser and capture its PID   
     ; The new instance replaces older running instances sans prompting.   
     #SingleInstance Force   
     ; Use path to aloha which is independent of the user   
     localAppData := EnvGet("LOCALAPPDATA")   
     exePath := localAppData . "\Aloha Mobile\Aloha\Application\aloha.exe"   
      
     if !FileExist(exePath) {   
         MsgBox "Aloha executable not found:" "'n" exePath   
         ExitApp   
     }   
      
     ; Start the exe (don't treat Run's return as authoritative)   
     Run(exePath)   
      
     ; Wait up to 10 seconds for the Aloha window to appear, then get its PID   
     if !WinWait("ahk_class Chrome_WidgetWin_1", , 10) {   
         MsgBox "Aloha started but no window appeared within 10s. Check that it   
   launched correctly."   
         ExitApp   
     }   
      
     ; Get the PID of the window we just waited for   
     appPid := WinGetPID("ahk_class Chrome_WidgetWin_1")   
     if !appPid {   
         MsgBox "Could not determine Aloha PID after launch."   
         ExitApp   
     }   
      
     ; Step 2: Wait for the browser window and allow page to render   
     ; WinWait "ahk_class Chrome_WidgetWin_1",, 15   
     Sleep 3000   
      
      
   [continued in next message]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca