WorldQuery

Group
Queries
Methods
12
Fields
None

Getting one

world:search()

Methods

MethodReturnsDescription
ids({ number })WorldQueryKeep only these world numbers.
members(boolean)WorldQueryKeep only members worlds, or only free ones.
online()WorldQueryKeep only worlds that are up.
region(WorldRegionCode | "??")WorldQueryKeep only worlds in one country. Raises for another code, in any case.
activityContaining(string)WorldQueryKeep only worlds whose activity label contains this, ignoring case and markup.
hasType(WorldTypeName)WorldQueryKeep only worlds of a kind. Raises for a name outside WorldTypeName.
withoutType(WorldTypeName)WorldQueryKeep only worlds NOT of a kind. Raises for a name outside WorldTypeName.
playersAtMost(number)WorldQueryKeep only worlds at or below a player count.
count()numberHow many worlds survived the filters. Consumes the query.
first()WorldInfo?The first world that survived the filters. Consumes the query.
random()WorldInfo?One survivor, chosen at random. Consumes the query.
collect(){ WorldInfo }Every world that survived the filters. Consumes the query.

Returned by

MethodReturnsDescription
WorldDomain.searchWorldQueryA query over the directory.

Method details

members

members: (WorldQuery, boolean) -> WorldQuery

Keep only members worlds, or only free ones.

members
true for members, false for free.

region

region: (WorldQuery, WorldRegionCode | "??") -> WorldQuery

Keep only worlds in one country. Raises for another code, in any case.

code
The country's code, as WorldInfo.region carries it: "??" is the worlds whose location is unknown.

activityContaining

activityContaining: (WorldQuery, string) -> WorldQuery

Keep only worlds whose activity label contains this, ignoring case and markup.

text
What to look for in the directory's activity label.

count

count: (WorldQuery) -> number

How many worlds survived the filters. Consumes the query.

first

first: (WorldQuery) -> WorldInfo?

The first world that survived the filters. Consumes the query.

Returns
nil when nothing matched.