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 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
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
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
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
Name
Arguments
Returns
alive_role
[rolerole], ID]ex;
[Scp939]
The
amountnumber of players
alive with
thatthe specified role. The role
alive. Role ID can be
provided as a
role name or
integernumeric role ID.
alive_team
[teamteam], ID]ex;
[MTF]
The
amountnumber of players
withalive thatin the specified team. The team
alive. Team ID can be
provided as a
team name or
integernumeric team ID.
Team Numbers for alive_team
| Team Name |
Team Number |
| SCPs |
0 |
| FoundationForces |
1 |
| ChaosInsurgency |
2 |
| Scientists |
3 |
| ClassD |
4 |
| Dead |
5 |
| OtherAlive |
6 |
| Flamingos |
7 |
SCP Info
scp_counter
None
Alive SCPs (except for zombies) out of initial SCPs of the round.
scp_start
None
Initial SCPs of the round.
scp_killed
None
SCPs killed this round.
scp_kills
None
Kills by SCPs this round.
zombies_recalled
None
Zombies recalled this round.
Class D Info
classd_counter
None
Escaped Class Ds out of initial Class Ds of the round.
classd_start
None
Initial Class Ds of the round.
classd_escaped
None
Class Ds escapees this round.
Scientist Info
scientist_counter
None
Escaped scientists out of initial scientists of the round.
scientist_start
None
Initial scientists of the round.
scientist_escaped
None
Scientist escapees this round
Randomization
random
[max]; [min] [max]
Random decimal between the min (default 0) and max.
random_list
[item 1] [item 2] […]
A random item
Constants
constant_e
None
Euler's number.
constant_pi
None
Pi (π).
Operations
add
[a] [b]
a + b
subtract
[a] [b]
a - b
multiply
[a] [b]
a * b
division
[a] [b]
a / b
power
[a] [b]
a ^ b
log
[value]; [base] [value]
Log [base] (default 10) of [value].
ln
[value]
Natural log of [value]
Rounding
round
[value]
Rounds to the nearest whole number.
round_up
[value]
Rounds up to the nearest whole number.
round_down
[value]
Rounds down to the nearest whole number.
Comparisons
equals
[a] [b]
Checks equality of [a] and [b] by string representation.
greater
[a] [b]
"True" if [a] > [b], else "False".
lesser
[a] [b]
"True" if [a] < [b], else "False".
greater_or_equal
[a] [b]
"True" if [a] >= [b], else "False".
lesser_or_equal
[a] [b]
"True" if [a] <= [b], else "False".
Boolean Logic
not
[value]
Inverts [value].
or
[a] [b]
"True" if [a] OR [b] are true, else "False".
and
[a] [b]
"True" if [a] AND [b] are true, else "False".
xor
[a] [b]
"True" if [a] OR [b] but NOT [a] AND [B], else "False".
if
[condition] [a]; [condition] [a] [b]
[a] if [condition] is true else [b] (default empty)