Skip to content

trade_placeholders

test edited this page Aug 14, 2024 · 6 revisions

These functions can be used as PLACEHOLDERS and FILTERS.

Argument info

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)

Selectors

TERNARY: ?

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

Selectors

  • TRADE_ID: Trade ID Example: 12345
  • NATION: Nation name, id, leader, url, user id or mention (see nation type) Example: Borg

Sheet Columns

A google sheet url with one of the following columns is accepted:- id

Placeholders


#getBuyer - int

This command is public

No description provided

This command has no arguments


#getBuyerNation - DBNation

This command is public

No description provided

This command has no arguments


#getDate - long

This command is public

No description provided

This command has no arguments


#getDate_accepted - long

This command is public

No description provided

This command has no arguments


#getParent_id - int

This command is public

No description provided

This command has no arguments


#getPpu - int

This command is public

No description provided

This command has no arguments


#getQuantity - int

This command is public

No description provided

This command has no arguments


#getResource - ResourceType

This command is public

No description provided

This command has no arguments


#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


#getSeller - int

This command is public

No description provided

This command has no arguments


#getSellerNation - DBNation

This command is public

No description provided

This command has no arguments


#getTradeId - int

This command is public

No description provided

This command has no arguments


#getType - TradeType

This command is public

No description provided

This command has no arguments


#isBuy - boolean

This command is public

No description provided

This command has no arguments


Clone this wiki locally