Skip to content

nationoralliance_placeholders

test edited this page Oct 24, 2024 · 10 revisions

This page contains a list of functions that can be used as PLACEHOLDERS and FILTERS

About Arguments

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

About Placeholders

Placeholders in a text, such as in a spreadsheet or message, are replaced with actual values.

Examples:

  • {myFunction}
  • {functionWithArgs(123)}
  • {withNamedArgs(myArg: 123 otherArg: 456)}
  • ({conditional}?{ifTrue}:{ifFalse})
  • 9-({numericalFunction}+5)*3

About filters

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

Examples:

  • #myBoolean,#myOtherTrueFalseFunction
  • (#myFunction=5||#myOtherFunction<10)
  • #textFunction=abc123,#regexFunction=efg.*
  • (#myFunction<(#myOtherFunction+5)

Operators

  • TERNARY: ?
  • GREATER_EQUAL: >=
  • GREATER: >
  • LESS_EQUAL: <=
  • LESS: <
  • NOT_EQUAL: !=
  • EQUAL: =
  • PLUS: +
  • MINUS: -
  • MULTIPLY: *
  • DIVIDE: /
  • POWER: ^

nationoralliance Selectors

  • nation:NATION_NAME: A qualified nation name Example: nation:Borg
  • leader:NATION_NAME: A qualified leader name Example: leader:Danzek
  • aa:ALLIANCE_NAME: A qualified alliance name Example: aa:Rose
  • alliance:ALLIANCE_NAME: A qualified alliance name Example: alliance:Eclipse
  • nation/id=NATION_ID: A nation url Example: nation/id=6
  • alliance/id=ALLIANCE_ID: An alliance url Example: alliance/id=790
  • coalition:COALITION: A qualified coalition name Example: coalition:allies
  • ~COALITION: A coalition name Example: ~enemies
  • NATION_NAME: An unqualified nation name Example: Borg
  • LEADER_NAME: An unqualified leader name Example: Danzek
  • NATION_ID: A nation id Example: 189573
  • ALLIANCE_ID: An alliance id Example: 790
  • @ROLE_MENTION: A discord role mention or name Example: @Member
  • ROLE_ID: A discord role id Example: 123456789012345678
  • @USER_MENTION: A discord user mention or name Example: @xdnw
  • USER_ID: A discord user id Example: 123456789012345678
  • https://politicsandwar.com/index.php?id=15&tax_id=TAX_ID: A full tax url Example: https://politicsandwar.com/index.php?id=15&tax_id=1234
  • TAX_ID: A tax bracket id or url Example: tax_id=1234
  • *: All nations
  • nation(<timestamp>,<includeVM:bool>):SELECTOR: As a sheet tab name; a snapshot selector, with optional timestamp and includeVM Example: nation(5d,true):*

Sheet Columns

A google sheet url with one of the following columns is accepted: nation, alliance


Placeholders


#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


#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


#isValid - boolean

This command is public

If this exists in game

This command has no arguments


Clone this wiki locally