Skip to content

project_placeholders

xdnw edited this page Mar 24, 2024 · 6 revisions

Placeholder Syntax

  • <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

Example discord usage

For placeholders {getLand}

For filters #getLand>30

Use round brackets for arguments #myFunction(123)


Placeholders


#canBuild - boolean

This command is public

If a nation can build this project

Arguments:

<nation> - DBNation nation id, name or url


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


Clone this wiki locally