Template Variables


This page lists Custom Variables, Generic Variables, Player Variables, Game Variables, Race Variables, RaceTeamVariables, CheckTRN Variables, and Message Forwarding Variables.

- Custom Variables
Custom variables allow you to quickly change any part of your templates and HTML pages. Custom variables are stored in a file called "CustomVariables.TXT" in AutoTroll's root directory. The syntax of variables in the file lists your custom variable (e.g., TimeZone) followed by an equal sign, followed by the value. You shouldn't have any spaces on either side of the equal sign.

Example:
TimeZone=PST
GamePage=games/games.html

To use a custom variable, in your template simply specify the name within brackets.

Example:
[Host.Name] is located in the [TimeZone] time zone. You can check
for a list of games at [Host.URL][GamePage].

Note: you can use custom variables in
conditional statements too.

- Generic Variables

These variables are valid in or out of any cycle.
[ActiveGameCount]Total number of games in your game database minus the completed games. Includes stalled, running and joining.  
[ActivePlayerCount]Number of players who have sent any message to AutoTroll within the last 60 days.  
[Admin.Name] Name specified in settings | Admin Name  
[Admin.EMail] EMail specified in settings | Admin E-mail  
[Host.Name] Name specified in settings | Host Name  
[Host.EMail] EMail specified in settings | Host E-mail  
[Host.URL]The web address you enter in setup  
[IPAddress] Returns current IP address of AT.  
[LastPlayerNumber]Returns the highest/last player account number entered in AutoTroll  
[LongDate] System defined. e.g., Sunday, January 4, 1997  
[NoHTML]Special variable for web tamplates. See the bottom of display modifiers for more info.  
[ShortDate] System defined. e.g., mm/dd/yy  
[Time12] 12 hour time hh:mm AM/PM  
[Time24] 24 hour time hh:mm  
[TotalPlayers]Total number of players in your player database  
[TotalGames]Total number of games in your game database  


- Player Variables
These variables are only valid when AutoTroll knows the player account. There are several instances when AutoTroll knows the player account. These include:
1. When a player sends a message that conforms to the rules for
identifying a player.
2. When AutoTroll sends the player his rst packet
3. During a player cycle.
[Player.Alias]Alias (if blank, then displays player name)  
[Player.AllyHostWarning]Sets if the player will recieve a warning message if their allies/team mates don't have their TRN in. 'Yes' or 'No'  
[Player.AttZip]If player uses zip attachments 'Yes' or 'No'  
[Player.BroadCastMsg] If player wants to get general messages 'Yes' or 'No'  
[Player.ComitLevel] Settable from player's dialog  
[Player.ClassName] Class Name (see Ranking System)  
[Player.ClassPercent] Class Percent points  
[Player.EMail] Primary E-Mail address  
[Player.EMail2] Second e-mail address  
[Player.FTPRST] If player wants RSTs ftp'd 'Yes' or 'No'  
[Player.HostWarning] If player wants to receive host warnings 'Yes' or 'No'  
[Player.HTMLName] Displays player.name with HTML codes for the player class.  
[Player.HTMLClassName] Class Name (see Ranking System) with HTML codes  
[Player.HTMLClassPercent] Class Percent points HTML codes for their Class  
[Player.LastContact] Date/Time when AutoTroll last saw a message from the player.  
[Player.LongFiles]If player uses long filename support  
[Player.LongDesc]Displays description field editable on player's dialog box  
[Player.Name] Player's Name  
[Player.NewGameMsg] If player wants to get new game messages  
[Player.Number] Account Number  
[Player.Password]Returns player password  
[Player.PrivateEMail] If player has Hide EMail checked.  
[Player.PublicEMail] Returns 'PRIVATE' if player chose Private EMail in their configs, otherwise it returns the player's real e-mail address  
[Player.RankName] Player's rank name  
[Player.RankPoints] Total Ranking points  
[Player.TRNRatio]The number of RSTs sent, divided by the number of TRNs received.  
[Player.UseEMail2] 'Yes' or 'No' if player uses enables e-mail2  
[Player.UseMime] If player uses mime (no means they get file attachments using UUencode)  
These three correspond to their settings for your custom defined variables. Although you can change what they mean and display, the template variables are always these:
[Player.UDef1]
[Player.UDef2]
[Player.UDef3]
The following are 24 custom variables are not used by AutoTroll, but you can use them to help you determine which race to assign a player as they join a game, custom point systems, or whatever you like.. You may also decide to use some/all of these as more custom variables that store an integer number instead of a yes/no like the above [Player.UDef?] variables. An example of such a use might be to store the number of years a player has played, or the number of games he has won, or the number of games he prefers to play in....
[Player.Choice1]
[Player.Choice2]
[Player.Choice3]
[Player.Choice4]
[Player.Choice5]
[Player.Choice6]
[Player.Choice7]
[Player.Choice8]
[Player.Choice9]
[Player.Choice10]
[Player.Choice11]

[Player.Choice12]
[Player.Choice13]
[Player.Choice14]
[Player.Choice15]
[Player.Choice16]
[Player.Choice17]
[Player.Choice18]
[Player.Choice19]
[Player.Choice20]
[Player.Choice21]
[Player.Choice22]
[Player.Choice23]
[Player.Choice24]

In addition, within a Player cycle, the folowing variables are valid:

[Player.Index]      Gives the index or count of the current iteration in the player loop

-
Game Variables
Valid when AutoTroll knows the game number, these include:
1. When any of the GAME-*.atf templates are sent out.
2. CHKTRN-GoodTRN.atf template is sent
3. If the player Sets the game with a template command

[Game.AScoreToWin] This variable is not used.  
[Game.Dir] String of game directory "c:\progra~1\host\game~1". Useful especially with the addon manager for addons with their own config file that take the game directory as an argument.  
[Game.DropTurns]Equals the number of turns a player can miss before being kicked out. (see Removing Inactive "dead beat" players).  
[Game.EarlyHost] Yes or No if you have a "Allow Early Hosting" checked under normal scheduled games on the game schedule page.  
[Game.EndTurn] Turn number you've specified the game to end at, or 0 if turned off (see Ending Game Scenerios)  
[Game.EndPercent] AutoScore percent that ends the game, or 0 if turned off (see Ending Game Scenerios)  
[Game.EventStatus] Similar to what's displayed on AT's main screen  
[Game.HostDay] Next Scheduled Host day (e.g., Monday, Tuesday, ...)  
[Game.HostDate] Next Scheduled Host day (e.g., xx/xx/xx)  
[Game.HostTime]Next Scheduled host time (e.g., xx:xx:xx XX)  
[Game.HostHours]Number of hours from now (when AT reads the template) until the next host run.  
[Game.isPrivate] 'Yes' or 'No' if the game is private  
[Game.isTeamGame] 'Yes' or 'No' if the game is a team game.  
[Game.Joinable]'Yes' or 'No' depending if you have 'Allow Joining" checked  
[Game.LastHost] Last Host date & time (e.g., xx/xx/xx xx:xx:xx XX)  
[Game.LastHostDay] Last Host date (e.g., xx/xx/xx XX )  
[Game.LastHostTime] Last host time  
[Game.LongDesc] 255 character description  
[Game.LongDesc2] 255 character description  
[Game.MinClass] Minimum player class value to auto-join a game.  
[Game.Memo] Like LongDesc, but no limit to maximum length  
[Game.MinRank] Minimum player rank value to auto-join a game  
[Game.Name] Name of game  
[Game.Number] Game Number  
[Game.NextHost] Next Host day & time (e.g., xx/xx/xx xx:xx:xx XX)  
[Game.Openings] Number of openings in the game.  
[Game.Players]Number of players in the game.  
[Game.RacesOpen] 1,2,6,B = string of races open - 'Closed' if Allow joining is false.  
[Game.RacesPlayed] 3,4,5,7,8,9,A = string of races being played  
[Game.Schedule] S_T_T_S = string of days to host Sunday to Saturday  
[Game.Status] Stalled, Delayed, Joining, Running, Completed  
[Game.TurnsIn] 1o34x_789A_ = string of turns in. 'o'=race is open, 'x' means race is dead, '_' means turn is missing, 1..9,A,B means turn is received  
[Game.Turn] Turn Number  
These variables can be set for each game on the
game config page.
[Game.UDef1]
[Game.UDef2]
[Game.UDef3]
[Game.UDef4]
[Game.UDef5]
[Game.UDef6]

[Game.UDef7]
[Game.UDef8]
[Game.UDef9]
[Game.UDef10]
[Game.UDef11]
   Text value that can be set from game configuration page
[Game.UDef12]   
Text value that can be set from game configuration page
Game.WarnHours]    Hours before host to send warning message for missing TRNs


-
Race Variables
These variables are valid
1. Within a [CycleEach Race ...] cycle
2. Within a [CycleEach GameForPlayer ...] cycle
3. Or more generally, whenever both a game is defined and a player is known. An example of this is when sending out RSTs in the
game-sendrst.atf template. See the Examples for more info.
[Race.AScorePercent] For games that use AutoScore, this will show the race's AutoScore percent.  
[Race.AScoreValue] For games that use AutoScore, this will show the race's AutoScore value.  
[Race.AScoreRank] For games that use AutoScore, this will show the race's AutoScore ranking as 1..11  
[Race.AScoreRankFMT] For games that use AutoScore, this will show the race's AutoScore ranking as 1st, 2nd .. 11th.  
[Race.isPlayed] 'Yes' or 'No' if the race is being played.  
[Race.isOpen] 'Yes' or 'No' if the race is being open to be joined.  
[Race.LastChange] Last turn activity of drop/joined  
[Race.Missed] This is the number of consecutive turns missed by the race. If the value is 0, then they submitted a TRN last turn. If it is 3, then there has been no TRN submitted for this race in 3 host runs. This number only cares about TRN files, not of a cplayer that might have played for the missing TRN.  
[Race.MissingTeamTRNs]1,3,4 for a person who is allied with 1,3,4 and those turns are not in (does not include own race)  
[Race.Name] The Solar Federation...The Missing Colonies of Man  
[Race.ShortName]The Feds...The Colonies  
[Race.AdjName]Fed...Colonial  
[Race.Number] '1' .. '11'  
[Race.OtherRST] Shows the races this race has allied with (ie the races who get this race's RST)  
[Race.QPlayed] 'Yes' or 'No' if the race is being played by The Q  
[Race.TeamList] Shows the races who have allied with this race (ie the RSTs this race gets)  
[Race.TurnStatus] 'Missing', 'Received', 'Open' or 'Dead'  
[Race.ZipName] This is the zip filename that is sent to the race. This can be useful to put into web templates as a link so players can download their RSTs from the web.  
[Race.Flag1]'Yes' or 'No' flag that can be set with game config settings  
[Race.Flag2]'Yes' or 'No' flag that can be set with game config settings  
[Race.Flag3]'Yes' or 'No' flag that can be set with game config settings  
[Race.Flag4]'Yes' or 'No' flag that can be set with game config settings  
[Race.Flag5]'Yes' or 'No' flag that can be set with game config settings  
[Race.Flag6]'Yes' or 'No' flag that can be set with game config settings  
[Race.Flag7]'Yes' or 'No' flag that can be set with game config settings  
[Race.Flag8]'Yes' or 'No' flag that can be set with game config settings  

- Race Team Varaibles
These variables are valid in games that are marked as team games. The variables reflect the team's value - a team is all those players who are allied with one another. The variables belong in a Race cycle just like the Race.* variables.
[Team.AScorePercent] For games that use AutoScore, this will show the team's AutoScore percent.  
[Team.AScoreRank] For games that use AutoScore, this will show the team's AutoScore ranking as 1..11  
[Team.AScoreValue] For games that use AutoScore, this will show the team's AutoScore value.  
[Team.AScoreRankFMT] For games that use AutoScore, this will show the team's AutoScore ranking as 1st, 2nd .. 11th.  

- Message Forwarding Variables
These variables are only valid when one player is
forwarding a message to another player.
[Forward.Text]            Will show the text of the message to forward.  
[Forward.RaceName]      Will show the race name of the player who sent the message to forward.  
[Forward.RaceNumber]Will show the race number of the player who sent the message.  


-
CHECK TRN Variables
These variables are only valid in one of the CHKTRN-*.atf
template files. The files each variable is valid in is listed below each variable.
[TRN.TimeStamp]TimeStamp of submitted TRN. Valid in  
#CheckTRN-Good  
#CheckTRN-Cheat  
#CheckTRN-Corrupt  
#CheckTRN-UknownGame  
[TRN.StatusCode]Errorlevel returned from chktrn.exe Valid in:  
#CheckTRN-Good  
#CheckTRN-Cheat  
#CheckTRN-Corrupt  
[TRN.Output]Output / text from checktrn.exe. Valid in:  
#CheckTRN-Good  
#CheckTRN-Cheat  
#CheckTRN-Corrupt  
[TRN.FileSent]Name of TRN file player set Valid in all chktrn templates  
#CheckTRN-Good  
#CheckTRN-Cheat  
#CheckTRN-Corrupt  
#CheckTRN-UknownGame  

See Also :
Modifying the display of variables
Template Examples