Changing a Lineage II window permanently.

Fairlight

Keltir
Messages
19
Reaction score
16
Going to leave a small piece of code snippet that might be useful to someone.

Because of multiboxing and Lineage II changing the window title constantly, I've made the following using AHK to keep the window with a unique name. This can be helpful for streamers in multibox servers since OBS grabs the Window Title name.

; Proper match mode for Window name
SetTitleMatchMode 2

: Executes the script as Admin, as ElmoreLab's L2 requires elevation.
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%"
ExitApp
}

; Runs the game
Run "C:\Games\Toma's Cool Server\system\L2.exe"

; Small 5s delay here since the window doesn't become available and displays a splash screen. Because of how it works, WinWaitActive doesn't work for this.
Sleep 5000

;Selects the Window with name "Lineage II"

if WinExist("Lineage II")
WinActivate

; Gets the hwnd or window ID of the focused window.
WinGet, main_id, ID, A

; This loop constantly checks for this specific game instance ID. If it's not running, it exits. If it's running, it tries to rename the Lineage II window into ElmoreLab - You can change ElmoreLab into whatever you want, eg a second script can use this as ElmoreLab Box. The reason why it's a loop is because the game constantly changes it's name back to Lineage II.
Loop
{
IfWinNotExist, ahk_id %main_id%
ExitApp
else
WinSetTitle, ahk_id %main_id%,, ElmoreLab
Sleep, 10
}
 
Last edited:
Back
Top