Produces mineral compounds from base minerals, boosts and unboosts creeps. Learn more about minerals from this article .
Controller level | |
1-5 | — |
6 | 3 labs |
7 | 6 labs |
8 | 10 labs |
Cost | 50,000 |
Hits | 500 |
Capacity | 3000 mineral units, 2000 energy units |
Produce | 5 mineral compound units per reaction |
Reaction cooldown | Depends on the reaction (see this article ) |
Distance to input labs | 2 squares |
Boost cost | 30 mineral units, 20 energy units per body part |
Applied effects, an array of objects with the following properties:
parameter | type | description |
---|---|---|
effect
|
number |
Effect ID of the applied effect. Can be either natural effect ID or Power ID. |
level
optional |
number |
Power level of the applied effect. Absent if the effect is not a Power effect. |
ticksRemaining
|
number |
How many ticks will the effect last. |
An object representing the position of this object in the room.
The link to the Room object. May be undefined in case if an object is a flag or a construction site and is placed in a room that is not visible to you.
The current amount of hit points of the structure.
The total amount of hit points of the structure.
A unique object identificator. You can use
Game.getObjectById
method to retrieve an object instance by its
id
.
One of the
STRUCTURE_*
constants.
Destroy this structure immediately.
One of the following codes:
constant | value | description |
---|---|---|
OK
|
0 |
The operation has been scheduled successfully. |
ERR_NOT_OWNER
|
-1 |
You are not the owner of this structure. |
ERR_BUSY
|
-4 |
Hostile creeps are in the room. |
Check whether this structure can be used. If room controller level is insufficient, then this method will return false, and the structure will be highlighted with red in the game.
A boolean value.
Toggle auto notification when the structure is under attack. The notification will be sent to your account email. Turned on by default.
parameter | type | description |
---|---|---|
enabled
|
boolean |
Whether to enable notification or disable. |
One of the following codes:
constant | value | description |
---|---|---|
OK
|
0 |
The operation has been scheduled successfully. |
ERR_NOT_OWNER
|
-1 |
You are not the owner of this structure. |
ERR_INVALID_ARGS
|
-10 |
|
Whether this is your own structure.
An object with the structure’s owner info containing the following properties:
parameter | type | description |
---|---|---|
username
|
string |
The name of the owner user. |
The amount of game ticks the lab has to wait until the next reaction or unboost operation is possible.
This property is deprecated and will be removed soon.
An alias for
.store[RESOURCE_ENERGY]
.
This property is deprecated and will be removed soon.
An alias for
.store.getCapacity(RESOURCE_ENERGY)
.
This property is deprecated and will be removed soon.
An alias for
lab.store[lab.mineralType]
.
The type of minerals containing in the lab. Labs can contain only one mineral type at the same time.
This property is deprecated and will be removed soon.
An alias for
lab.store.getCapacity(lab.mineralType || yourMineral)
.
if(structure.store.getFreeCapacity(RESOURCE_ENERGY) > 0) {
creep.transfer(structure, RESOURCE_ENERGY);
}
A
Store
object that contains cargo of this structure.
Boosts creep body parts using the containing mineral compound. The creep has to be at adjacent square to the lab.
parameter | type | description |
---|---|---|
creep
|
Creep |
The target creep. |
bodyPartsCount
optional |
number |
The number of body parts of the corresponding type to be boosted. Body parts are always counted left-to-right for
|
One of the following codes:
constant | value | description |
---|---|---|
OK
|
0 |
The operation has been scheduled successfully. |
ERR_NOT_OWNER
|
-1 |
You are not the owner of this lab. |
ERR_NOT_FOUND
|
-5 |
The mineral containing in the lab cannot boost any of the creep's body parts. |
ERR_NOT_ENOUGH_RESOURCES
|
-6 |
The lab does not have enough energy or minerals. |
ERR_INVALID_TARGET
|
-7 |
The targets is not valid creep object. |
ERR_NOT_IN_RANGE
|
-9 |
The targets are too far away. |
ERR_RCL_NOT_ENOUGH
|
-14 |
Room Controller Level insufficient to use this structure. |
Breaks mineral compounds back into reagents. The same output labs can be used by many source labs.
parameter | type | description |
---|---|---|
lab1
|
StructureLab |
The first result lab. |
lab2
|
StructureLab |
The second result lab. |
One of the following codes:
constant | value | description |
---|---|---|
OK
|
0 |
The operation has been scheduled successfully. |
ERR_NOT_OWNER
|
-1 |
You are not the owner of this lab. |
ERR_NOT_ENOUGH_RESOURCES
|
-6 |
The source lab do not have enough resources. |
ERR_INVALID_TARGET
|
-7 |
The targets are not valid lab objects. |
ERR_FULL
|
-8 |
One of targets cannot receive any more resource. |
ERR_NOT_IN_RANGE
|
-9 |
The targets are too far away. |
ERR_INVALID_ARGS
|
-10 |
The reaction cannot be reversed into this resources. |
ERR_TIRED
|
-11 |
The lab is still cooling down. |
ERR_RCL_NOT_ENOUGH
|
-14 |
Room Controller Level insufficient to use this structure. |
Produce mineral compounds using reagents from two other labs. The same input labs can be used by many output labs.
parameter | type | description |
---|---|---|
lab1
|
StructureLab (lab) |
The first source lab. |
lab2
|
StructureLab (lab) |
The second source lab. |
One of the following codes:
constant | value | description |
---|---|---|
OK
|
0 |
The operation has been scheduled successfully. |
ERR_NOT_OWNER
|
-1 |
You are not the owner of this lab. |
ERR_NOT_ENOUGH_RESOURCES
|
-6 |
The source lab do not have enough resources. |
ERR_INVALID_TARGET
|
-7 |
The targets are not valid lab objects. |
ERR_FULL
|
-8 |
The target cannot receive any more resource. |
ERR_NOT_IN_RANGE
|
-9 |
The targets are too far away. |
ERR_INVALID_ARGS
|
-10 |
The reaction cannot be run using this resources. |
ERR_TIRED
|
-11 |
The lab is still cooling down. |
ERR_RCL_NOT_ENOUGH
|
-14 |
Room Controller Level insufficient to use this structure. |
Immediately remove boosts from the creep and drop 50% of the mineral compounds used to boost it onto the ground regardless of the creep's remaining time to live. The creep has to be at adjacent square to the lab. Unboosting requires cooldown time equal to the total sum of the reactions needed to produce all the compounds applied to the creep.
parameter | type | description |
---|---|---|
creep
|
Creep |
The target creep. |
One of the following codes:
constant | value | description |
---|---|---|
OK
|
0 |
The operation has been scheduled successfully. |
ERR_NOT_OWNER
|
-1 |
You are not the owner of this lab, or the target creep. |
ERR_NOT_FOUND
|
-5 |
The target has no boosted parts. |
ERR_INVALID_TARGET
|
-7 |
The target is not a valid Creep object. |
ERR_NOT_IN_RANGE
|
-9 |
The target is too far away. |
ERR_TIRED
|
-11 |
The lab is still cooling down. |
ERR_RCL_NOT_ENOUGH
|
-14 |
Room Controller Level insufficient to use this structure. |