Skip to content

crva/lswitch

Repository files navigation

lswitch

Desktop app for storing Riot accounts and automating Riot Client login/switch flow on Windows.

Overview

lswitch is a Wails application with a Go backend and React frontend. It solves the repetitive process of:

  • closing running League client processes
  • opening Riot Client
  • clicking Riot UI elements in sequence
  • typing account credentials automatically
  • relaunching League after login

The app keeps accounts in a local SQLite database and lets users trigger automation from a simple desktop UI.

Technology Stack

  • Wails v2 (desktop shell + Go/JS bridge)
  • Go (backend logic, database layer, Windows automation)
  • React + TypeScript (frontend)
  • TailwindCSS v4 (UI styling)
  • SQLite via modernc.org/sqlite (local account storage)
  • Win32 API calls (user32.dll) for window detection, click posting, and key input
  • Vite (frontend tooling)

How It Works

Riot Client automation

When the user clicks Log In, the frontend calls StartV1 with automation options and selected account credentials.

Backend flow:

  1. Kill LeagueClientUx.exe and LeagueClient.exe if running.
  2. Start Riot Client from C:\Riot Games\Riot Client\RiotClientServices.exe.
  3. Wait until a visible window containing Riot Client is found.
  4. Convert configured grid cells to click points.
  5. Send click events and credential characters through window messages.
  6. Launch League with Riot client service arguments.

Grid calibration concept

Automation uses a logical N x N grid over the Riot Client window (GridSize, default 30).

  • Coordinates are col,row and are 1-based.
  • Each coordinate maps to the center of that grid cell.
  • This makes clicks resolution-independent as long as the Riot UI layout is consistent.

Configured targets:

  • Click1, Click2: pre-login UI clicks (for account/logout navigation)
  • LoginUserCell: username field
  • LoginPassCell: password field
  • LoginButtonCell: sign-in button

Frontend <-> backend interaction

  • Frontend calls Go methods through Wails bindings (frontend/wailsjs/go/main/App.*).
  • Account CRUD methods persist data in SQLite.
  • Backend logs are emitted as Wails events (app:log) and streamed live in the UI log panel.

Installation And Development

Prerequisites

  • Windows (automation backend is Windows-only)
  • Go 1.23+
  • Node.js 18+ and npm
  • Wails CLI v2
  • Installed Riot Client in default path: C:\Riot Games\Riot Client\RiotClientServices.exe

Install Wails CLI:

go install github.com/wailsapp/wails/v2/cmd/wails@latest

Install frontend dependencies

cd frontend
npm install
cd ..

Run in development

From repository root:

wails dev

Build desktop binary

wails build

Basic Usage

  1. Start the app with wails dev (or run a built binary).
  2. Add one or more Riot accounts in the left panel.
  3. Select an account.
  4. Click Log In.
  5. Watch progress and errors in Runtime Logs.

The app will execute the configured switch/login sequence and then launch League.

Grid Calibration

The current implementation expects fixed grid cell values passed in V1Options (currently set in frontend/src/App.tsx).

What the grid is

  • A virtual GridSize x GridSize map of the Riot Client window.
  • Cell (1,1) starts at top-left.
  • Clicks are sent to each cell center.

How to generate a grid reference

There is no built-in grid image generator in the current code path. Use this manual process:

  1. Open Riot Client to the target screen.
  2. Take a screenshot.
  3. Overlay a 30 x 30 grid in any image tool.
  4. Read target positions as col,row and update the values used by StartV1 options.

Why this helps

  • Avoids hard-coded pixel coordinates.
  • Keeps automation more stable across window sizes/resolutions.

Configuration And CLI Flags

  • No active CLI flags are implemented in the current application entrypoint.
  • Runtime automation configuration is currently passed as V1Options from the frontend.

Active V1Options fields:

  • GridSize
  • BetweenClickMs
  • Click1, Click2
  • LoginUserCell, LoginPassCell, LoginButtonCell
  • AccountUsername, AccountPassword

Current defaults in frontend/src/App.tsx:

  • GridSize: 30
  • BetweenClickMs: 1500
  • Click1: "25,3"
  • Click2: "21,12"
  • LoginUserCell: "2,10"
  • LoginPassCell: "2,12"
  • LoginButtonCell: "4,25"

Notes

  • Credentials are stored in local SQLite as plain text in the current implementation.
  • Automation depends on Riot Client UI layout and expected window title.

About

Desktop app for storing Riot accounts and automating Riot Client login/switch flow on Windows.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors