Command Interpolation
Server Name Command Interpolation
Server Name Command Interpolation (SNCI) provides a simple and easy form of scripting to server name. These can be used on the player list title as well.
How to use SNCI
The syntax for commands is {command_name,arg1,arg2,arg...} , which is placed within the server name. All characters can be escaped in order to have { , } , or , in closures. It means that you need to put a backslash (\) before { , } , or , if you want to use them in your servername. Whitespace of the command name or arguments is not trimmed.
Example
In this scenario, the following will be our server name:
<color=#b0b>The Stetzone</color>\n<color=#{random_list,b00,0b0,b0b}>Ruleless Anarchy</color>\n<color=#fc0><size=10>
{scp_counter} SCPs | {add,{alive_team,1},{alive_team,3}} Foundation Personnel | {add,{alive_team,2},{alive_team,4}}
Insurgents/Prisoners {warhead_detonated,| ☢ WARHEAD DETONATED ☢,}\n[{round_duration_minutes}:{round_duration_seconds}]
</size></color>
On the server list, it displays as a 20/20 server with the name of:
<color=#b0b>The Stetzone</color>
<color=#b00>Ruleless Anarchy</color>
<color=#fc0><size=10>3/5 SCPs | 12 Foundation Personnel | 4 Insurgents/Prisoners | ☢ WARHEAD DETONATED ☢ [8:29]</size></color>
The reason why it displays is:
- The interpolator encounters {random_list,b00,0b0,b0b}.
- The interpolator picks a random number from 1-3 (amount of items).
- The interpolator resolves that item just in case it has closures within it.
- Returned b00.
- The interpolator then moves to {scp_counter}.
- There were 5 SCPs at the start.
- There are only 3 now.
- Returned 3/5 .
- The interpolator keeps moving and finds {add,{alive_team,MTF},{alive_team,RSC}}
- The interpolator resolves the arguments.
- {alive_team,1} resolves to 9.
- {alive_team,3} resolves to 3.
- The interpolator adds the results together.
- Returned 12.
- The interpolator resolves the arguments.
- The interpolator scrolls along and sees {add,{alive_team,2},{alive_team,4}}. This is the same as #3 so it returned 4 and we'll skip it.
- The interpolator goes to the next closure: {warhead_detonated,| ☢ WARHEAD DETONATED ☢,}
- The warhead has detonated so it selects the first argument.
- The interpolator resolves the first argument.
- Returned | ☢ WARHEAD DETONATED ☢
- The interpolator gets to {round_duration_minutes}.
- The round has been going on for 8 minutes, 29 seconds.
- Returned 8.
- The interpolator finally reaches {round_duration_seconds}.
- The round has been going on for 8 minutes, 29 seconds.
- Returned 29.
Commands
Server info
| Name | Arguments | Returns | |||
| ip | None | The IP address of the server. | |||
| port | None | The port of the server . | |||
| number | None | Assuming the port starts at 7777, the server number. | |||
| version | None | The leading compatible version. |
Player Counts
| Name | Arguments | Returns | |||
| player_count | None | The current number of players on the server | |||
| full_player_count | None; [full] | The current out of maximum players on the server, or full if full. | |||
| max_players | None | The maximum number of players on the server. |
Round Info
| Name | Arguments | Returns | |||
| round_duration_minutes | None | The duration of the round in minutes. | |||
| round_duration_seconds | None | The duration of the round in seconds, ignoring minutes (always <60). | |||
| kills | None | Total kills this round. | |||
| kills_frag | None | Total frag grenade kills this round. | |||
| mtf_respawns | None | Total MTF respawns this round. | |||
| warhead_detonated | None;[detonated][undetonated] | Detonated or undetonated (default "☢ WARHEAD DETONATED☢" or
empty) depending on whether or not the warhead has been detonated. |
Alive Players
| Name | Arguments | Returns |
alive_role |
|
The |
alive_team |
|
The |