Module clan

Functions for clans

Global functions

Clan.getFromName (name) get a clan by name.

Class Clan

clan:addAtWar (clan) add a clan to the list of clans this clan is at war with
clan:addFunds (amount, who, reason) add or substract from clan funds.
clan:clearAtWar () clear the list of clans this clan is at war with
clan:echoToMembers (message) send a message to all members of the clan.
clan:getAtWar () get the list of clans this clan is at war with
clan:getCapital () get the clan's capital planet
clan:getColorname () get the colored name of the clan.
clan:getDescription () get the clan's description
clan:getFirst () get the name of the clan's first.
clan:getFlags () get the flags set on this clan.
clan:getFunds () get current clan funds.
clan:getLeader () get the name of the clan's leader.
clan:getName () get the name of the clan.
clan:getSecond () get the name of the clan's second.
clan:getShortname () get the shortname of the clan.
clan:getType () get the clan type (e.g., government, engineering, etc.)
clan:hasFlag (flag) get whether a flag is set on this clan.
clan:removeAtWar (clan) remove a clan from the list of clans this clan is at war with
clan:setFlag (flag, value) set a flag on this clan.


Global functions

Clan.getFromName (name)
get a clan by name.

Parameters:

  • name string the clan name

Returns:

    Clan the clan, or nil if not found

Class Clan

Functions on clan variables
clan:addAtWar (clan)
add a clan to the list of clans this clan is at war with

Parameters:

  • clan Clan the clan to add to the list of clans this clan is at war with

Returns:

    boolean true if the clan was added, false if it was already in the list
clan:addFunds (amount, who, reason)
add or substract from clan funds.

Parameters:

  • amount integer the amount to add. Negative amounts will subtract from the balance.
  • who string the name to use for a banklog entry. Optional; if not specified, no banklog entry will be made.
  • reason string the reason to use for a banklog entry. Optional.
clan:clearAtWar ()
clear the list of clans this clan is at war with
clan:echoToMembers (message)
send a message to all members of the clan.

Parameters:

  • message string The message to echo.

Usage:

    clan:echoToMembers("Attention: {1} has joined your clan.", newCh)
clan:getAtWar ()
get the list of clans this clan is at war with

Returns:

    string the list of clans this clan is at war with
clan:getCapital ()
get the clan's capital planet

Returns:

    planet capital the clan's capital, or nil if not set
clan:getColorname ()
get the colored name of the clan.

Returns:

    string the colored name of the clan
clan:getDescription ()
get the clan's description

Returns:

    string the clan's description
clan:getFirst ()
get the name of the clan's first.

Returns:

    string clan first's name, or nil if not set
clan:getFlags ()
get the flags set on this clan.

Returns:

    table a table of flags set on this clan
clan:getFunds ()
get current clan funds.

Returns:

    integer the current clan funds
clan:getLeader ()
get the name of the clan's leader.

Returns:

    string clan leader's name, or nil if not set
clan:getName ()
get the name of the clan.

Returns:

    string the clan name
clan:getSecond ()
get the name of the clan's second.

Returns:

    string clan second's name, or nil if not set
clan:getShortname ()
get the shortname of the clan.

Returns:

    string the short clan name
clan:getType ()
get the clan type (e.g., government, engineering, etc.)

Returns:

    string the clan type
clan:hasFlag (flag)
get whether a flag is set on this clan.

Parameters:

  • flag string The flag name to check for

Returns:

    boolean True if the flag is set, false otherwise
clan:removeAtWar (clan)
remove a clan from the list of clans this clan is at war with

Parameters:

  • clan Clan the clan to remove from the list of clans this clan is at war with

Returns:

    boolean true if the clan was removed, false if it was not in the list
clan:setFlag (flag, value)
set a flag on this clan.

Parameters:

  • flag string The flag to set
  • value boolean The new value to set

Usage:

    clan:setFlag("hidden", true)
generated by LDoc 1.5.0 Last updated 2024-10-22 16:05:00