Module MiningUnit

Extracts a regular amount of resources from the ground.

Element class: MiningUnit

Extends: Element

Functions

getStatus () Deprecated: Returns the current status of the mining unit.
getState () Returns the current state of the mining unit.
getRemainingTime () Returns the remaining time of the current batch extraction process.
getActiveOre () Returns the item ID of the currently selected ore.
getOrePools () Returns the list of available ore pools.
getBaseRate () Returns the base production rate of the mining unit.
getEfficiency () Returns the efficiency rate of the mining unit.
getCalibrationRate () Returns the calibration rate of the mining unit.
getOptimalRate () Returns the optimal calibration rate of the mining unit.
getProductionRate () Returns the current production rate of the mining unit.
getAdjacencyBonus () Returns the territory's adjacency bonus to the territory of the mining unit.
getLastExtractionPosition () Returns the position of the last calibration excavation, in world coordinates.
getLastExtractingPlayerId () Returns the ID of the last player who calibrated the mining unit.
getLastExtractionTime () Returns the time in seconds since the last calibration of the mining unit.
getLastExtractedOre () Returns the item ID of the ore extracted during the last calibration excavation.
getLastExtractedVolume () Returns the volume of ore extracted during the last calibration excavation.
EVENT_calibrated (oreId, amount, rate) Deprecated: Event: Emitted when the mining unit is calibrated.
EVENT_onCalibrated (oreId, rate, amount) Event: Emitted when the mining unit is calibrated.
EVENT_onStarted (oreId) Event: Emitted when the mining unit started a new extraction process.
EVENT_completed (oreId, amount) Deprecated: Event: Emitted when the mining unit completes a batch.
EVENT_onCompleted (oreId, amount) Event: Emitted when the mining unit completes a batch.
EVENT_statusChanged (status) Deprecated: Event: Emitted when the mining unit status is changed.
EVENT_onStateChanged (state) Event: Emitted when the mining unit state is changed.
EVENT_onStopped () Event: Emitted when the mining unit stopped the extraction process.
mockGetClosure () Mock only, not in-game: Bundles the object into a closure so functions can be called with "." instead of ":".


Functions

getStatus ()
Deprecated: Returns the current status of the mining unit.

This method is deprecated: getState should be used instead

Returns:

    string The status of the mining unit can be: "STOPPED", "RUNNING", "JAMMED_OUTPUT_FULL".

See also:

getState ()
Returns the current state of the mining unit.

Returns:

    int The state of the mining unit can be (Stopped = 1, Running = 2, Jammed output full = 3, Jammed no output container = 4)
getRemainingTime ()
Returns the remaining time of the current batch extraction process.

Returns:

    float The remaining time in seconds.
getActiveOre ()
Returns the item ID of the currently selected ore.

Returns:

    int The item ID of the selected ore.
getOrePools ()
Returns the list of available ore pools.

Returns:

    table A list of tables composed with {[int] oreId, [float] available, [float] maximum}.
getBaseRate ()
Returns the base production rate of the mining unit.

Returns:

    float The production rate in L/h.
getEfficiency ()
Returns the efficiency rate of the mining unit.

Returns:

    float The efficiency rate.
getCalibrationRate ()
Returns the calibration rate of the mining unit.

Returns:

    float The calibration rate of the mining unit.
getOptimalRate ()
Returns the optimal calibration rate of the mining unit.

Returns:

    float the optimal calibration rate of the mining unit.
getProductionRate ()
Returns the current production rate of the mining unit.

Returns:

    float The production rate in L/h.
getAdjacencyBonus ()
Returns the territory's adjacency bonus to the territory of the mining unit.

Returns:

    float The territory's adjacency bonus.
getLastExtractionPosition ()
Returns the position of the last calibration excavation, in world coordinates.

Returns:

    The coordinates in world coordinates.
getLastExtractingPlayerId ()
Returns the ID of the last player who calibrated the mining unit.

Returns:

    int The ID of the player.
getLastExtractionTime ()
Returns the time in seconds since the last calibration of the mining unit.

Returns:

    float The time in seconds with milliseconds precision.
getLastExtractedOre ()
Returns the item ID of the ore extracted during the last calibration excavation.

Returns:

    int The item ID of the extracted ore.
getLastExtractedVolume ()
Returns the volume of ore extracted during the last calibration excavation.

Returns:

    float The volume of ore extracted in L.
EVENT_calibrated (oreId, amount, rate)
Deprecated: Event: Emitted when the mining unit is calibrated.

Note: This is documentation on an event handler, not a callable method.

This event is deprecated: EVENT_onCalibrated should be used instead.

Parameters:

  • oreId int The item ID of the ore extracted during the calibration process.
  • amount float Amount of ore extracted during the calibration process.
  • rate float The new calibration rate after calibration process.

See also:

EVENT_onCalibrated (oreId, rate, amount)
Event: Emitted when the mining unit is calibrated.

Note: This is documentation on an event handler, not a callable method.

Parameters:

  • oreId int The item ID of the ore extracted during the calibration process.
  • rate float The new calibration rate after calibration process.
  • amount float Amount of ore extracted during the calibration process.
EVENT_onStarted (oreId)
Event: Emitted when the mining unit started a new extraction process.

Note: This is documentation on an event handler, not a callable method.

Parameters:

  • oreId int The item ID of the ore mined during the extraction process.
EVENT_completed (oreId, amount)
Deprecated: Event: Emitted when the mining unit completes a batch.

Note: This is documentation on an event handler, not a callable method.

This event is deprecated: EVENT_onCompleted should be used instead.

Parameters:

  • oreId int The item ID of the ore mined during the extraction process.
  • amount float Amount of ore mined.

See also:

EVENT_onCompleted (oreId, amount)
Event: Emitted when the mining unit completes a batch.

Note: This is documentation on an event handler, not a callable method.

Parameters:

  • oreId int The item ID of the ore mined during the extraction process.
  • amount float Amount of ore mined.
EVENT_statusChanged (status)
Deprecated: Event: Emitted when the mining unit status is changed.

Note: This is documentation on an event handler, not a callable method.

This event is deprecated: EVENT_onStateChanged should be used instead.

Parameters:

  • status string The new status of the mining unit, can be: "STOPPED", "RUNNING", "JAMMED_OUTPUT_FULL".

See also:

EVENT_onStateChanged (state)
Event: Emitted when the mining unit state is changed.

Note: This is documentation on an event handler, not a callable method.

Parameters:

  • state int The state of the mining unit can be (Stopped = 1, Running = 2, Jammed output full = 3, Jammed no output container = 4)
EVENT_onStopped ()
Event: Emitted when the mining unit stopped the extraction process.

Note: This is documentation on an event handler, not a callable method.

mockGetClosure ()
Mock only, not in-game: Bundles the object into a closure so functions can be called with "." instead of ":".

Returns:

    table A table encompasing the api calls of object.

See also:

generated by LDoc 1.5.0 Last updated 2024-09-27 15:22:46