Purpose
Updates the player's game window title, for example:
TSWMU [ Channel 1: PVP ] | Hero | Recharge: 500000 | RS: 3 | LV: 1250 | WCoin: 1200
The title is updated periodically and only resent when the content changes. The TSWMU client (Main.dll) is required to change the window title. The module also has a side feature: a PK warning, which sends a notice when the character's kill count reaches a certain level.
How to enable
- The line
LoadModule("CustomWindowName\\CustomWindowName")inMain.lua(enabled by default). - Edit
Includes\CustomWindowName\Config.lua. - Click Reload LuaAPI.
The module attaches OnReadScript, OnTimerThread, OnSQLAsyncResult, OnCharacterClose. There is no separate SQL file; the @Recharge variable is read from the acc_recharge table of the game DB (see the configuration below). If you do not use @Recharge, set Recharge.Enable = false to avoid sending queries.
Configuration (Config.lua, CustomWindowNameConfig table)
| Key | Value | Default | Meaning |
|---|---|---|---|
Enable | true / false | true | Turns the module on / off. |
UpdateRate | seconds | 2 | Interval between two title updates. |
ServerName | string | "TSWMU" | Value of the @ServerName variable. |
BaseString | string with variables | (see example) | Title template. |
CloseString | string | "TSWMU" | Title when the character leaves the game. |
Recharge.Enable | true / false | true | false: @Recharge is always 0 and no query is sent. |
Recharge.Refresh | seconds | 60 | Interval between two DB reads (a new top-up shows up after at most this much time). |
Recharge.Query | SQL statement | SELECT TOP 1 Milestone AS value FROM acc_recharge WHERE AccountId = %d ORDER BY Id DESC | Must return exactly one column named value; %d = account ID. |
PKWarning.Enable, Count, Message | true/false, number, string | true, 5, (built in) | One-time warning when the kill count reaches Count. |
AccountLevel | table | Normal, VIP 0..3 | Maps VIP level to a name for the @AccountLevel variable; [-1] = no VIP. |
GameServer | table | "Channel 1: PVP"... | Maps GameServer code to a channel name for the @GameServer variable. |
Variables usable in BaseString:
| Variable | Value |
|---|---|
@ServerName, @GameServer | Server name; channel name from the GameServer table |
@Login, @Name | Account, character name |
@AccountLevel | VIP name |
@Level, @MasterLevel, @MajesticLevel, @TLevel | The levels; @TLevel = sum of the three levels |
@Reset, @PK | Reset count, kill count |
@Map, @CoordX, @CoordY | Map, coordinates |
@WCoinC, @WCoinP, @GoblinPoint | The coin types |
@Recharge | Value of the value column of Recharge.Query |
@ServerTime, @ServerSmallTime | Server time hh:mm:ss and hh:mm |
CustomWindowNameConfig.BaseString = "@ServerName [ @GameServer ] | @Name | Recharge: @Recharge | RS: @Reset | LV: @TLevel | WCoin: @WCoinC"