Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.privacy    |    Discussing privacy, laws, tinfoil hats    |    112,125 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 111,773 of 112,125    |
|    Marion to All    |
|    Improving Aloha free VPN privacy using a    |
|    19 Oct 25 22:34:24    |
   
   [continued from previous message]   
      
    ; Step 3: Use client-relative coordinates for mouse and pixel sampling   
    CoordMode "Mouse", "Client"   
    CoordMode "Pixel", "Client"   
      
    ; Step 5: Shield icon position (stable across monitors)   
    buttonX := 131   
    buttonY := 55   
      
    ; Step 6: Periodically ensure the shield is ON (click only when gray)   
    intervalMs := 500 ; 500 ms = 0.5 seconds   
      
    ; Colors from Window Spy (hex RRGGBB)   
    blueHex := 0x5895F6 ; blue (ON)   
    grayHex := 0xBEBEC4 ; gray (OFF)   
    tolerance := 30 ; color distance tolerance (increase if needed)   
      
    ; Step 7: Use the launched PID in the watcher and start timers   
    SetTimer(ClickIfGray, intervalMs)   
    SetTimer(CheckAppRunning, 1000)   
    Return   
      
    ; --- Functions ---   
      
    ClickIfGray(*) {   
    global buttonX, buttonY, grayHex, tolerance, appPid   
    hwnd := WinExist("ahk_pid " appPid)   
    if !hwnd   
    return   
      
    ; Force a repaint by toggling transparency (no visible bounce)   
    WinSetTransparent(254, "ahk_id " hwnd)   
    WinSetTransparent("OFF", "ahk_id " hwnd)   
      
    ; Sample a 3x3 area around the shield pixel (client-relative)   
    total := 0   
    count := 0   
    for dx in [-1, 0, 1] {   
    for dy in [-1, 0, 1] {   
    x := buttonX + dx   
    y := buttonY + dy   
    color := PixelGetColor(x, y, "RGB")   
    total += color   
    count += 1   
    }   
    }   
    avgColor := Round(total / count)   
      
    ; Show the sampled color value in a tooltip (for debugging)   
    ; ToolTip "Sampled color: " avgColor   
    ; 16315633 in hex = 0xF8F8F1 is a light gray-white shade.   
    ; 5937144 in hex = 0x5A8A88 is a teal-blue shade.   
      
    ToolTip "Sampled color: " Format("0x{:06X}", avgColor)   
      
    if IsColorClose(avgColor, grayHex, tolerance) {   
    MouseGetPos(&oldX, &oldY)   
    MouseMove(buttonX, buttonY, 0)   
    Click   
    MouseMove(oldX, oldY, 0)   
    }   
      
    }   
      
    IsColorClose(c1, c2, tol) {   
    r1 := (c1 >> 16) & 0xFF   
    g1 := (c1 >> 8) & 0xFF   
    b1 := (c1) & 0xFF   
    r2 := (c2 >> 16) & 0xFF   
    g2 := (c2 >> 8) & 0xFF   
    b2 := (c2) & 0xFF   
    dist := Sqrt((r1 - r2)**2 + (g1 - g2)**2 + (b1 - b2)**2)   
    return dist <= tol   
    }   
      
    CheckAppRunning(*) {   
    global appPid   
    if !WinExist("ahk_pid " appPid) {   
    SetTimer(ClickIfGray, 0)   
    SetTimer(CheckAppRunning, 0)   
    ExitApp   
    }   
    }   
      
    ; End of C:\data\sys\ahk\alohavpn.ahk   
   --   
   I go to trouble and time and effort to write my Usenet posts because I'm   
   kind hearted enough to care that everyone gets excellent researched data.   
      
   --- 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