-
Notifications
You must be signed in to change notification settings - Fork 5
project_placeholders
This page contains a list of functions that can be used as PLACEHOLDERS and FILTERS
Some functions here may accept an argument. The brackets imply argument type, you do NOT include them when using the function.
-
<arg>
- A required parameter -
[arg]
- An optional parameter -
<arg1|arg2>
- Multiple parameters options -
<arg=value>
- Default or suggested value -
[-f flag]
- A optional command argument flag
Placeholders in a text, such as in a spreadsheet or message, are replaced with actual values.
{myFunction}
{functionWithArgs(123)}
{withNamedArgs(myArg: 123 otherArg: 456)}
({conditional}?{ifTrue}:{ifFalse})
9-({numericalFunction}+5)*3
Filters are used to modify a selection. i.e. When you are choosing which things to act upon or display, you use filters to narrow down the selection to ones that meet a certain requirement. When the return type is a string, the filter can be compared using regex to the value. When the return type is boolean (true/false), it will be resolved to either 1 or 0
#myBoolean,#myOtherTrueFalseFunction
(#myFunction=5||#myOtherFunction<10)
#textFunction=abc123,#regexFunction=efg.*
(#myFunction<(#myOtherFunction+5)
- TERNARY:
?
- GREATER_EQUAL:
>=
- GREATER:
>
- LESS_EQUAL:
<=
- LESS:
<
- NOT_EQUAL:
!=
- EQUAL:
=
- PLUS:
+
- MINUS:
-
- MULTIPLY:
*
- DIVIDE:
/
- POWER:
^
-
PROJECT
: One of the entity values Example:ADVANCED_URBAN_PLANNING
,ARMS_STOCKPILE
,BAUXITEWORKS
,CENTER_FOR_CIVIL_ENGINEERING
,URBAN_PLANNING
,EMERGENCY_GASOLINE_RESERVE
,INTELLIGENCE_AGENCY
,INTERNATIONAL_TRADE_CENTER
,IRON_DOME
,IRON_WORKS
,MASS_IRRIGATION
,MISSILE_LAUNCH_PAD
,MOON_LANDING
,NUCLEAR_RESEARCH_FACILITY
,PROPAGANDA_BUREAU
,SPACE_PROGRAM
,SPY_SATELLITE
,URANIUM_ENRICHMENT_PROGRAM
,VITAL_DEFENSE_SYSTEM
,RECYCLING_INITIATIVE
,PIRATE_ECONOMY
,GREEN_TECHNOLOGIES
,TELECOMMUNICATIONS_SATELLITE
,ADVANCED_ENGINEERING_CORPS
,ARABLE_LAND_AGENCY
,CLINICAL_RESEARCH_CENTER
,SPECIALIZED_POLICE_TRAINING_PROGRAM
,RESEARCH_AND_DEVELOPMENT_CENTER
,ACTIVITY_CENTER
,GOVERNMENT_SUPPORT_AGENCY
,METROPOLITAN_PLANNING
,MILITARY_SALVAGE
,FALLOUT_SHELTER
,BUREAU_OF_DOMESTIC_AFFAIRS
,ADVANCED_PIRATE_ECONOMY
,MARS_LANDING
,SURVEILLANCE_NETWORK
,GUIDING_SATELLITE
,NUCLEAR_LAUNCH_FACILITY
A google sheet url with one of the following columns is accepted: project
#canBuild - boolean
This command is public
If a nation can build this project
Arguments:
<nation>
- DBNation
nation id, name or url
#cost - Map<ResourceType,Double>
This command is public
Map of resource cost of the project
This command has no arguments
#getApiName - String
This command is public
Api v3 name of project
This command has no arguments
#getAvg - double
This command is public
Get average attribute for nations with this project
Arguments:
<attribute>
- NationAttributeDouble
A completed nation attribute that accepts no arguments and returns a number
To get the attribute for an attribute with arguments, you must provide a value in brackets
See: https://github.com/xdnw/locutus/wiki/nation_placeholders
[nations]
- Set<DBNation>
A comma separated list of nations, alliances and filters
#getCount - int
This command is public
Get number of projects for a set of nations
Arguments:
[nations]
- Set<DBNation>
A comma separated list of nations, alliances and filters
#getImageName - String
This command is public
The name of this project's image
This command has no arguments
#getImageUrl - String
This command is public
The url of this project's image
This command has no arguments
#getMarketValue - double
This command is public
Market value of project
This command has no arguments
#getOutput - ResourceType
This command is public
The resource this project boosts, or null
This command has no arguments
#getRequiredProject - Project
This command is public
Get the nth required project
Arguments:
<index>
- int
A whole number
#getResource - double
This command is public
Gets a resource amount from a map of resources
Arguments:
<resources>
- Map<ResourceType, Double>
A comma separated list of resources and their amounts
<resource>
- ResourceType
The name of a resource
#getResourceCost - double
This command is public
Get cost for a specific resource
Arguments:
<type>
- ResourceType
The name of a resource
#getResourceValue - double
This command is public
Gets the total resource value for a map of resources
Arguments:
<resources>
- Map<ResourceType, Double>
A comma separated list of resources and their amounts
#getTotal - double
This command is public
Get total attribute for nations with this project
Arguments:
<attribute>
- NationAttributeDouble
A completed nation attribute that accepts no arguments and returns a number
To get the attribute for an attribute with arguments, you must provide a value in brackets
See: https://github.com/xdnw/locutus/wiki/nation_placeholders
[nations]
- Set<DBNation>
A comma separated list of nations, alliances and filters
#has - boolean
This command is public
If a nation has a project
Arguments:
<nation>
- DBNation
nation id, name or url
#hasBit - boolean
This command is public
If a bitmask has this project
Arguments:
<bitMask>
- long
A whole number
#hasProjectRequirements - boolean
This command is public
If this project has any project requirements
This command has no arguments
#isRequiredProject - boolean
This command is public
If a project is required for this project
Arguments:
<project>
- Project
A project name. Replace spaces with _
. See: https://politicsandwar.com/nation/projects/
#maxCities - int
This command is public
Required maximum cities for project, or Integer.MAX_VALUE if none
This command has no arguments
#name - String
This command is public
Name of project
This command has no arguments
#ordinal - int
This command is public
Bot id of project
This command has no arguments
#requiredCities - int
This command is public
Required minimum cities for project, or 0 if none
This command has no arguments
#requiredProjects - Set<Project>
This command is public
The set of required projects (empty if none)
This command has no arguments