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

  1. The line LoadModule("CustomWindowName\\CustomWindowName") in Main.lua (enabled by default).
  2. Edit Includes\CustomWindowName\Config.lua.
  3. 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)

KeyValueDefaultMeaning
Enabletrue / falsetrueTurns the module on / off.
UpdateRateseconds2Interval between two title updates.
ServerNamestring"TSWMU"Value of the @ServerName variable.
BaseStringstring with variables(see example)Title template.
CloseStringstring"TSWMU"Title when the character leaves the game.
Recharge.Enabletrue / falsetruefalse: @Recharge is always 0 and no query is sent.
Recharge.Refreshseconds60Interval between two DB reads (a new top-up shows up after at most this much time).
Recharge.QuerySQL statementSELECT TOP 1 Milestone AS value FROM acc_recharge WHERE AccountId = %d ORDER BY Id DESCMust return exactly one column named value; %d = account ID.
PKWarning.Enable, Count, Messagetrue/false, number, stringtrue, 5, (built in)One-time warning when the kill count reaches Count.
AccountLeveltableNormal, VIP 0..3Maps VIP level to a name for the @AccountLevel variable; [-1] = no VIP.
GameServertable"Channel 1: PVP"...Maps GameServer code to a channel name for the @GameServer variable.

Variables usable in BaseString:

VariableValue
@ServerName, @GameServerServer name; channel name from the GameServer table
@Login, @NameAccount, character name
@AccountLevelVIP name
@Level, @MasterLevel, @MajesticLevel, @TLevelThe levels; @TLevel = sum of the three levels
@Reset, @PKReset count, kill count
@Map, @CoordX, @CoordYMap, coordinates
@WCoinC, @WCoinP, @GoblinPointThe coin types
@RechargeValue of the value column of Recharge.Query
@ServerTime, @ServerSmallTimeServer time hh:mm:ss and hh:mm
CustomWindowNameConfig.BaseString = "@ServerName [ @GameServer ] | @Name | Recharge: @Recharge | RS: @Reset | LV: @TLevel | WCoin: @WCoinC"