Colony Integrator¶
The colony integrator can interact with a colony from MineColonies.
Requirement
Requires the MineColonies mod to be installed
Peripheral Name | Interfaces with | Has events | Introduced in |
---|---|---|---|
colonyIntegrator | Mine Colony | No | 0.7r |
Functions¶
getCitizens¶
getCitizens() -> table
Returns a list of information about every citizen in the colony.
Citizen Properties¶
citizen | Description |
---|---|
id: string |
The citizen's id |
name: string |
The citizen's name |
age: string |
The age of the citizen, either "child" or "adult" |
gender: string |
The citizen's gender, either "male" or "female" |
location: table |
The current location of the citizen (has x , y , z ) |
bedPos: table |
The position of the citizen's bed (has x , y , z ) |
saturation: number |
The citizen's food saturation |
happiness: number |
An indicator of how happy the citizen is |
health: number? |
The citizen's current health |
maxHealth: number? |
The citizen's max health |
armor: number? |
The citizen's current number of armor points |
toughness: number? |
The citizen's armor toughness |
betterFood: boolean |
Whether the citizen needs better food |
isAsleep: boolean |
If the citizen is currently asleep |
isIdle: boolean |
If the citizen is currently idle |
state: string |
A string representing the citizen's current state |
children: table |
A list of the ids of this citizen's children |
skills: table |
A table of skill names to skills where each skill has a level and xp number |
work: table? |
A table of info about the citizen's job |
home: table? |
A table of info about the citizen's house |
Work Properties¶
work | Description |
---|---|
name: string |
The name of the job |
location: table |
The work location (has x , y , z ) |
type: string |
The type of job |
level: number |
The citizen's current job level |
Home Properties¶
home | Description |
---|---|
location: table |
The home location (has x , y , z ) |
type: string |
The building type |
level: number |
The building's level |
getVisitors¶
getVisitors() -> table
This information is the same as the
citizen
table but there is an additional recruitCost
string value.
getBuildings¶
getBuildings() -> table
Building Properties¶
building | Description |
---|---|
name: string |
The name of the building |
location: table |
The buildings's location (has x , y , z ) |
type: string |
The building type |
level: number |
The building's level |
maxLevel: number |
The building's max level |
style: string |
The building's style |
storageBlocks: number |
The number of storage blocks in the building |
storageSlots: number |
The number of storage slots |
guarded: boolean |
If the building is currently being guarded |
built: boolean |
If the building is built or is under construction |
isWorkingOn: boolean |
Whether the building is being worked on |
priority: number |
The building's construction priority |
structure: table |
A table defining the bounds of the structure |
citizens: table |
A list of citizen's name s and id s |
Structure Properties¶
structure | Description |
---|---|
cornerA: table |
The first corner of the bounds (has x , y , z ) |
cornerB: table |
The second corner of the bounds (has x , y , z ) |
rotation: number |
The structure's rotation |
mirror: boolean |
If the structure has been mirrored |
getResearch¶
getResearch() -> table
Returns a table of all possible colony research as a tree where the root table contains the branch names and their respective research.
Properties¶
research | Description |
---|---|
id: string |
The research id |
name: string |
The name of the research |
status: number |
The current research status |
researchEffects: table |
A list of effects provided by the research |
children: table? |
A list of any child research |
getRequests¶
getRequests() -> table
Request Properties¶
request | Description |
---|---|
id: string |
The request's id |
name: string |
The name of the request |
desc: string |
A description about the request |
state: string |
The state of the request |
count: number |
The number of the request |
minCount: number |
The minimum of the request needed |
target: string |
The request's target |
items: table |
A list of items attached to the request |
Item Properties¶
item | Description |
---|---|
name: string |
The registry name of the item |
count: number |
The amount of the item |
maxStackSize: number |
Maximum stack size for the item type |
displayName: string |
The item's display name |
tags: table |
A list of item tags |
nbt: table |
The item's nbt data |
getWorkOrders¶
getWorkOrders() -> table
Properties¶
workOrder | Description |
---|---|
id: string |
The work order's id |
priority: number |
The priority of the work order |
workOrderType: string |
The type of work order |
changed: boolean |
If the work order changed |
isClaimed: boolean |
Whether the work order has been claimed |
builder: table |
The position of the builder (has x , y , z ) |
buildingName: string |
The name of the building |
type: string |
The type of the building |
targetLevel: number |
The building's target level |
getWorkOrderResources¶
getWorkOrderResources(workOrderId: number) -> table | nil
Properties¶
resource | Description |
---|---|
item: string |
The registry name for the item |
displayName: string |
The display name for the item |
status: string |
The status of this resource |
needed: number |
How much of the resource is needed for the job |
available: boolean |
If the resource is currently available |
delivering: boolean |
If the resource is currently being delivered |
getBuilderResources¶
getBuilderResources(position: table) -> table | nil
The position
table must contain:
- x:
number
- y:
number
- z:
number
getColonyID¶
getColonyID() -> number
getColonyName¶
getColonyName() -> string
getColonyStyle¶
getColonyStyle() -> string
getLocation¶
getLocation() -> table
Properties¶
table | Description |
---|---|
x: number |
The x coordinate |
y: number |
The y coordinate |
z: number |
The z coordinate |
getHappiness¶
getHappiness() -> number
isActive¶
isActive() -> boolean
isUnderAttack¶
isUnderAttack() -> boolean
isInColony¶
isInColony() -> boolean
1 2 3 4 5 6 7 |
|
isWithin¶
isWithin(position: table) -> boolean
The position
table must contain:
- x:
number
- y:
number
- z:
number
amountOfCitizens¶
amountOfCitizens() -> number
maxOfCitizens¶
maxOfCitizens() -> number
amountOfGraves¶
amountOfGraves() -> number
amountOfConstructionSites¶
amountOfConstructionSites() -> number
Examples¶
Citizen Monitor¶
We made a script to show every citizens and their gender on a monitor.
You can view and download the script on Github
Colony Stats¶
And here we have a script made for a pocket computer to show statistics about a colony.
You can view and download the script on Github
Changelog/Trivia¶
0.7r
Added the colony integrator