effectsarray

Applied effects, an array of objects with the following properties:

parametertypedescription
effectnumber

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.

ticksRemainingnumber

How many ticks will the effect last.

Inherited from RoomObject
posRoomPosition

An object representing the position of this object in the room.

Inherited from RoomObject
roomRoom

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.

Inherited from Structure
hitsnumber

The current amount of hit points of the structure.

Inherited from Structure
hitsMaxnumber

The total amount of hit points of the structure.

Inherited from Structure
idstring

A unique object identificator. You can use Game.getObjectById method to retrieve an object instance by its id.

Inherited from Structure
structureTypestring

One of the STRUCTURE_* constants.

Inherited from Structure
destroy()

Destroy this structure immediately.

Return value

One of the following codes:
constantvaluedescription
OK0

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.

Inherited from Structure
isActive()

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.

Return value

A boolean value.

Inherited from Structure
notifyWhenAttacked(enabled)

Toggle auto notification when the structure is under attack. The notification will be sent to your account email. Turned on by default.

parametertypedescription
enabledboolean

Whether to enable notification or disable.

Return value

One of the following codes:
constantvaluedescription
OK0

The operation has been scheduled successfully.

ERR_NOT_OWNER-1

You are not the owner of this structure.

ERR_INVALID_ARGS-10

enable argument is not a boolean value.

Inherited from OwnedStructure
myboolean

Whether this is your own structure.

Inherited from OwnedStructure
ownerobject

An object with the structure’s owner info containing the following properties:

parametertypedescription
usernamestring

The name of the owner user.