Wiki

Clone wiki

LucidBot / Filters

Filters

Filters are used to narrow down the results of list-type commands. For example, you might be interested in checking mod wpa for a kd, but don't want to see their t/m's. You'd then use a filter to filter away all non wanted races and personalities from the result. Filters are not applicable to all commands, and all filter types are not supported for all commands either, although the bot will silently just ignore them if you supply them anyway.

A filter looks like this:

[!Faery, !Elf, !Mystic, Warrior, War Hero, >40k nw, 400-1000 acres, <24 age]

I.e. it's specified by enclosing it inside [] and it's a comma separated list of as many filters as you want to use. The above filter could be used with a command as follows:

!wpa (13:37) [!Faery, !Elf, !Mystic, Warrior, War Hero, >40k nw, 400-1000 acres, <24 age]

The result would list the wpa of all provinces in (13:37) that are NOT Faery, Elf or a Mystic, but ones that are either Warrior or War Hero, have over 40k networth and are between 400-1000 acres. Those with intel older than 24 hours will be ignored.

Common Filter Types

Most of the filters are of a few common types, namely:

  1. Number filter
  2. Entity filter
  3. Boolean filter

Number filters

A Number filter is basically what it sounds like. You filter based on some type of resource or maybe a date. These filters are all of the form <range> <keyword> where the range specifies which numbers are allowed, and they keyword identifies what type of filter it is. The range can be defined as:

  1. Larger than (>24, meaning all numbers ABOVE 24 are allowed)
  2. Less than (<24, meaning all number BELOW 24 are allowed)
  3. Range (400-1000, meaning all numbers between 400 and 100, including both those, are allowed)

Note that date based filters are also number filters, using amount of hours as their number.

Entity filters

An Entity filter points out a specific entity, for example a race or personality. These filters may also be inverted, meaning saying NOT this entity. As examples:

  1. Mystic (means Mystic personalities pass the filter, but others are removed, unless there's another personality filter that allows some other personality. I.e. you can combine multiple entity filters)
  2. !Orc (means that all Orcs are removed from the result)

Boolean filters

A Boolean filter is basically binary filter, meaning something like read/unread or admin/regular user. This type of filter is not as common as the other two. These filters are on the form <keyword> <true or false>.

Currently available filters

AgeFilter

Filters based on age, i.e. how long since something was added. This is a number filter, and the keywords you can use to specify that you want this filter are: age, old & updated

ArchivedFilter

Used to filter based on if something is considered archived or live. This is a boolean filter and the keywords are: archived & saved

BpaFilter

Filters on science books per acre, using the keyword bpa

BuildingFilter

Filters on % of buildings, using the building names as keywords. Example: [>10 farms] means remove anyone that doesn't have at least 10% farms built. Note that you shouldn't be using a % sign after the number in the filter.

CurrentDefenseFilter

Filters on current defense (calculated based on whatever intel is available), using the keyword cdef

CurrentOffenseFilter

Filters on current defense (calculated based on whatever intel is available), using the keyword coff

DefenseFilter

Filters on mod defense (armies out are ignored), using the keywords def, defense & md

ExpiringFilter

Filters on when something expires or returns, using the keywords expires, returns & ends

FoodFilter

Filters on amount of food, using the keywords food & bushels

HorsesFilter

Filters on amount of war horses, using the keyword horses

KingdomLocationFilter

Filters on kd location. This is an entity filter, so the keyword is the actual kd location, which may also be negated

LandFilter

Filters on amount of land, using the keywords acres & land

MoneyFilter

Filters on amount of gold coins, using the keywords gc, money & gold

NetworthFilter

Filters on networth, using the keywords networth & nw

OffenseFilter

Same as the defense filter but for offense, uses the keywords off, offense & mo

PeasantsFilter

Filters on amount of peasants, using the keywords pop & peasants

PersonalityFilter

An entity filter for personalities

PmdFilter

Filters on practical mod defense (assuming offensive elites are sent out), using the keyword pmd

PmoFilter

Filters on practical mod offense (assuming offensive elites are sent out), using the keyword pmo

RaceFilter

An entity filter for races

ReadFilter

Used to filter based on if something has been read yet or is still unread. This is a boolean filter and the keyword is: read

RecipientFilter

Filters on who is the recipient of something, most commonly some type of message. This filter is kind of like an entity filter, except that it also uses keywords, namely recipiemt & user. For example: [recipient LucidEssence].

RunesFilter

Filters on amount of runes, using the keyword runes

ScienceBooksFilter

Filters on amount of science books, using the keywords science, sci & books

SenderFilter

Filters on who sent something, most commonly some type of message. This filter is kind of like an entity filter, except that it also uses a keyword, namely sender. For example: [sender LucidEssence].

SoldiersFilter

Filters on amount of soldiers, using the keywords solds & soldiers

TpaFilter

Filters on mod tpa, using the keyword tpa

WpaFilter

Filters on mod wpa, using the keyword wpa

Can haz moar filters?!?!

Filters are usually not too hard to add, at least not for easily accessible types of data, like resources. Keywords are really easy to add. In other words, don't be afraid to ask for more filters and keywords if you feel the currently supported don't cover your needs!

Updated