typed-factorio
Version:
Featureful typescript definitions for the Factorio modding api.
1,345 lines (1,342 loc) • 108 kB
TypeScript
// This is an auto-generated file. Do not edit directly!
/** @noSelfInFile */
import type {
EventId,
OnAchievementGainedEvent,
OnAiCommandCompletedEvent,
OnAreaClonedEvent,
OnBiterBaseBuiltEvent,
OnBrushClonedEvent,
OnBuildBaseArrivedEvent,
OnBuiltEntityEvent,
OnCancelledDeconstructionEvent,
OnCancelledUpgradeEvent,
OnCargoPodDeliveredCargoEvent,
OnCargoPodFinishedAscendingEvent,
OnCargoPodFinishedDescendingEvent,
OnCharacterCorpseExpiredEvent,
OnChartTagAddedEvent,
OnChartTagModifiedEvent,
OnChartTagRemovedEvent,
OnChunkChartedEvent,
OnChunkDeletedEvent,
OnChunkGeneratedEvent,
OnCombatRobotExpiredEvent,
OnConsoleChatEvent,
OnConsoleCommandEvent,
OnCutsceneCancelledEvent,
OnCutsceneFinishedEvent,
OnCutsceneStartedEvent,
OnCutsceneWaypointReachedEvent,
OnEntityClonedEvent,
OnEntityColorChangedEvent,
OnEntityDamagedEvent,
OnEntityDiedEvent,
OnEntityLogisticSlotChangedEvent,
OnEntityRenamedEvent,
OnEntitySettingsPastedEvent,
OnEntitySpawnedEvent,
OnEquipmentInsertedEvent,
OnEquipmentRemovedEvent,
OnForceCeaseFireChangedEvent,
OnForceCreatedEvent,
OnForceFriendsChangedEvent,
OnForceResetEvent,
OnForcesMergedEvent,
OnForcesMergingEvent,
OnGameCreatedFromScenarioEvent,
OnGuiCheckedStateChangedEvent,
OnGuiClickEvent,
OnGuiClosedEvent,
OnGuiConfirmedEvent,
OnGuiElemChangedEvent,
OnGuiHoverEvent,
OnGuiLeaveEvent,
OnGuiLocationChangedEvent,
OnGuiOpenedEvent,
OnGuiSelectedTabChangedEvent,
OnGuiSelectionStateChangedEvent,
OnGuiSwitchStateChangedEvent,
OnGuiTextChangedEvent,
OnGuiValueChangedEvent,
OnLandMineArmedEvent,
OnLuaShortcutEvent,
OnMarkedForDeconstructionEvent,
OnMarkedForUpgradeEvent,
OnMarketItemPurchasedEvent,
OnModItemOpenedEvent,
OnMultiplayerInitEvent,
OnObjectDestroyedEvent,
OnPermissionGroupAddedEvent,
OnPermissionGroupDeletedEvent,
OnPermissionGroupEditedEvent,
OnPermissionStringImportedEvent,
OnPickedUpItemEvent,
OnPlayerAltReverseSelectedAreaEvent,
OnPlayerAltSelectedAreaEvent,
OnPlayerAmmoInventoryChangedEvent,
OnPlayerArmorInventoryChangedEvent,
OnPlayerBannedEvent,
OnPlayerBuiltTileEvent,
OnPlayerCancelledCraftingEvent,
OnPlayerChangedForceEvent,
OnPlayerChangedPositionEvent,
OnPlayerChangedSurfaceEvent,
OnPlayerCheatModeDisabledEvent,
OnPlayerCheatModeEnabledEvent,
OnPlayerClickedGpsTagEvent,
OnPlayerConfiguredBlueprintEvent,
OnPlayerControllerChangedEvent,
OnPlayerCraftedItemEvent,
OnPlayerCreatedEvent,
OnPlayerCursorStackChangedEvent,
OnPlayerDeconstructedAreaEvent,
OnPlayerDemotedEvent,
OnPlayerDiedEvent,
OnPlayerDisplayDensityScaleChangedEvent,
OnPlayerDisplayResolutionChangedEvent,
OnPlayerDisplayScaleChangedEvent,
OnPlayerDrivingChangedStateEvent,
OnPlayerDroppedItemEvent,
OnPlayerFastTransferredEvent,
OnPlayerFlippedEntityEvent,
OnPlayerFlushedFluidEvent,
OnPlayerGunInventoryChangedEvent,
OnPlayerInputMethodChangedEvent,
OnPlayerJoinedGameEvent,
OnPlayerKickedEvent,
OnPlayerLeftGameEvent,
OnPlayerLocaleChangedEvent,
OnPlayerMainInventoryChangedEvent,
OnPlayerMinedEntityEvent,
OnPlayerMinedItemEvent,
OnPlayerMinedTileEvent,
OnPlayerMutedEvent,
OnPlayerPipetteEvent,
OnPlayerPlacedEquipmentEvent,
OnPlayerPromotedEvent,
OnPlayerRemovedEquipmentEvent,
OnPlayerRemovedEvent,
OnPlayerRepairedEntityEvent,
OnPlayerRespawnedEvent,
OnPlayerReverseSelectedAreaEvent,
OnPlayerRotatedEntityEvent,
OnPlayerSelectedAreaEvent,
OnPlayerSetQuickBarSlotEvent,
OnPlayerSetupBlueprintEvent,
OnPlayerToggledAltModeEvent,
OnPlayerToggledMapEditorEvent,
OnPlayerTrashInventoryChangedEvent,
OnPlayerUnbannedEvent,
OnPlayerUnmutedEvent,
OnPlayerUsedCapsuleEvent,
OnPlayerUsedSpidertronRemoteEvent,
OnPostEntityDiedEvent,
OnPreBuildEvent,
OnPreChunkDeletedEvent,
OnPreEntitySettingsPastedEvent,
OnPreGhostDeconstructedEvent,
OnPreGhostUpgradedEvent,
OnPrePermissionGroupDeletedEvent,
OnPrePermissionStringImportedEvent,
OnPrePlayerCraftedItemEvent,
OnPrePlayerDiedEvent,
OnPrePlayerLeftGameEvent,
OnPrePlayerMinedItemEvent,
OnPrePlayerRemovedEvent,
OnPrePlayerToggledMapEditorEvent,
OnPreRobotExplodedCliffEvent,
OnPreScenarioFinishedEvent,
OnPreScriptInventoryResizedEvent,
OnPreSurfaceClearedEvent,
OnPreSurfaceDeletedEvent,
OnRedoAppliedEvent,
OnResearchCancelledEvent,
OnResearchFinishedEvent,
OnResearchMovedEvent,
OnResearchReversedEvent,
OnResearchStartedEvent,
OnResourceDepletedEvent,
OnRobotBuiltEntityEvent,
OnRobotBuiltTileEvent,
OnRobotExplodedCliffEvent,
OnRobotMinedEntityEvent,
OnRobotMinedEvent,
OnRobotMinedTileEvent,
OnRobotPreMinedEvent,
OnRocketLaunchedEvent,
OnRocketLaunchOrderedEvent,
OnRuntimeModSettingChangedEvent,
OnScriptInventoryResizedEvent,
OnScriptPathRequestFinishedEvent,
OnScriptTriggerEffectEvent,
OnSectorScannedEvent,
OnSegmentEntityCreatedEvent,
OnSelectedEntityChangedEvent,
OnSingleplayerInitEvent,
OnSpacePlatformBuiltEntityEvent,
OnSpacePlatformBuiltTileEvent,
OnSpacePlatformChangedStateEvent,
OnSpacePlatformMinedEntityEvent,
OnSpacePlatformMinedItemEvent,
OnSpacePlatformMinedTileEvent,
OnSpacePlatformPreMinedEvent,
OnSpiderCommandCompletedEvent,
OnStringTranslatedEvent,
OnSurfaceClearedEvent,
OnSurfaceCreatedEvent,
OnSurfaceDeletedEvent,
OnSurfaceImportedEvent,
OnSurfaceRenamedEvent,
OnTechnologyEffectsResetEvent,
OnTickEvent,
OnTrainChangedStateEvent,
OnTrainCreatedEvent,
OnTrainScheduleChangedEvent,
OnTriggerCreatedEntityEvent,
OnTriggerFiredArtilleryEvent,
OnUndoAppliedEvent,
OnUnitAddedToGroupEvent,
OnUnitGroupCreatedEvent,
OnUnitGroupFinishedGatheringEvent,
OnUnitRemovedFromGroupEvent,
OnWorkerRobotExpiredEvent,
ScriptRaisedBuiltEvent,
ScriptRaisedDestroyEvent,
ScriptRaisedReviveEvent,
ScriptRaisedSetTilesEvent,
ScriptRaisedTeleportedEvent,
} from "factorio:runtime"
declare global {
namespace defines {
enum alert_type {
collector_path_blocked,
custom,
entity_destroyed,
entity_under_attack,
no_material_for_construction,
no_platform_storage,
no_roboport_storage,
no_storage,
not_enough_construction_robots,
not_enough_repair_packs,
pipeline_overextended,
platform_tile_building_blocked,
train_no_path,
train_out_of_fuel,
turret_fire,
turret_out_of_ammo,
unclaimed_cargo,
}
/**
* AI command exit status. See {@link LuaEntity#set_command LuaEntity::set_command}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.behavior_result Online documentation}
*/
enum behavior_result {
in_progress,
fail,
success,
deleted,
}
enum build_check_type {
script,
manual,
manual_ghost,
script_ghost,
blueprint_ghost,
ghost_revive,
}
enum build_mode {
normal,
forced,
superforced,
}
enum cargo_destination {
/**
* The default destination type of a cargo pod when created runtime. Setting its destination to any other type will instantly launch it.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.cargo_destination.invalid Online documentation}
*/
invalid,
/**
* Cargo pods with orbit destination are destroyed when ascent is completed.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.cargo_destination.orbit Online documentation}
*/
orbit,
/**
* Any cargo landing pad or space platform hub.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.cargo_destination.station Online documentation}
*/
station,
/**
* Cargo pods will switch destination type from surface to station before starting descent if there is a station available and {@link CargoDestination#position CargoDestination::position} has not been specified. Note, setting the destination to "surface" when the surface is the same as the one the pod is on forces it to find and set a landing position.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.cargo_destination.surface Online documentation}
*/
surface,
/**
* Only used for sending a space platform starter pack to a platform that is waiting for one. Regular deliveries to space platform hubs use {@link defines.cargo_destination.station station} destination type instead.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.cargo_destination.space_platform Online documentation}
*/
space_platform,
}
/**
* State of a chain signal.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.chain_signal_state Online documentation}
*/
enum chain_signal_state {
none,
all_open,
partially_open,
none_open,
}
enum chunk_generated_status {
nothing,
custom_tiles,
basic_tiles,
corrected_tiles,
tiles,
entities,
}
/**
* Command given to units describing what they should do.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.command Online documentation}
*/
enum command {
/**
* Attack another entity.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.command.attack Online documentation}
*/
attack = 0,
/**
* Go to a specific position.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.command.go_to_location Online documentation}
*/
go_to_location = 1,
/**
* Chain commands together, see {@link defines.compound_command}.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.command.compound Online documentation}
*/
compound = 2,
/**
* Do what your group wants you to do.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.command.group Online documentation}
*/
group = 3,
/**
* Go to a place and attack what you see.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.command.attack_area Online documentation}
*/
attack_area = 4,
/**
* Chill.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.command.wander Online documentation}
*/
wander = 5,
/**
* Flee from another entity.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.command.flee Online documentation}
*/
flee = 6,
/**
* Stop moving and stay where you are.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.command.stop Online documentation}
*/
stop = 7,
/**
* Go to a position and build a base there.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.command.build_base Online documentation}
*/
build_base = 8,
}
/**
* How commands are joined together in a compound command (see {@link defines.command.compound}).
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.compound_command Online documentation}
*/
enum compound_command {
/**
* Fail on first failure. Only succeeds if all commands (executed one after another) succeed.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.compound_command.logical_and Online documentation}
*/
logical_and,
/**
* Succeed on first success. Only fails if all commands (executed one after another) fail.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.compound_command.logical_or Online documentation}
*/
logical_or,
/**
* Execute all commands in sequence and fail or succeed depending on the return status of the last command.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.compound_command.return_last Online documentation}
*/
return_last,
}
namespace control_behavior {
namespace inserter {
enum hand_read_mode {
hold,
pulse,
}
}
namespace logistic_container {
enum exclusive_mode {
send_contents,
set_requests,
none,
}
}
namespace lamp {
enum color_mode {
color_mapping,
components,
packed_rgb,
}
}
namespace mining_drill {
enum resource_read_mode {
this_miner,
entire_patch,
}
}
namespace transport_belt {
enum content_read_mode {
pulse,
hold,
entire_belt_hold,
}
}
namespace rocket_silo {
enum read_mode {
none,
logistic_inventory,
orbital_requests,
}
}
namespace roboport {
enum read_items_mode {
none,
logistics,
missing_requests,
}
}
namespace cargo_landing_pad {
enum exclusive_mode {
none,
send_contents,
set_requests,
}
}
enum type {
/**
* {@link LuaContainerControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.container Online documentation}
*/
container,
/**
* {@link LuaGenericOnOffControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.generic_on_off Online documentation}
*/
generic_on_off,
/**
* {@link LuaInserterControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.inserter Online documentation}
*/
inserter,
/**
* {@link LuaLampControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.lamp Online documentation}
*/
lamp,
/**
* {@link LuaLogisticContainerControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.logistic_container Online documentation}
*/
logistic_container,
/**
* {@link LuaRoboportControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.roboport Online documentation}
*/
roboport,
/**
* {@link LuaStorageTankControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.storage_tank Online documentation}
*/
storage_tank,
/**
* {@link LuaTrainStopControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.train_stop Online documentation}
*/
train_stop,
/**
* {@link LuaDeciderCombinatorControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.decider_combinator Online documentation}
*/
decider_combinator,
/**
* {@link LuaArithmeticCombinatorControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.arithmetic_combinator Online documentation}
*/
arithmetic_combinator,
/**
* {@link LuaConstantCombinatorControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.constant_combinator Online documentation}
*/
constant_combinator,
/**
* {@link LuaTransportBeltControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.transport_belt Online documentation}
*/
transport_belt,
/**
* {@link LuaAccumulatorControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.accumulator Online documentation}
*/
accumulator,
/**
* {@link LuaRailSignalBaseControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.rail_signal Online documentation}
*/
rail_signal,
/**
* {@link LuaRailSignalBaseControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.rail_chain_signal Online documentation}
*/
rail_chain_signal,
/**
* {@link LuaWallControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.wall Online documentation}
*/
wall,
/**
* {@link LuaMiningDrillControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.mining_drill Online documentation}
*/
mining_drill,
/**
* {@link LuaProgrammableSpeakerControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.programmable_speaker Online documentation}
*/
programmable_speaker,
/**
* {@link LuaAssemblingMachineControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.assembling_machine Online documentation}
*/
assembling_machine,
/**
* {@link LuaPumpControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.pump Online documentation}
*/
pump,
/**
* {@link LuaSelectorCombinatorControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.selector_combinator Online documentation}
*/
selector_combinator,
/**
* {@link LuaRocketSiloControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.rocket_silo Online documentation}
*/
rocket_silo,
/**
* {@link LuaTurretControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.turret Online documentation}
*/
turret,
/**
* {@link LuaReactorControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.reactor Online documentation}
*/
reactor,
/**
* {@link LuaSpacePlatformHubControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.space_platform_hub Online documentation}
*/
space_platform_hub,
/**
* {@link LuaArtilleryTurretControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.artillery_turret Online documentation}
*/
artillery_turret,
/**
* {@link LuaAsteroidCollectorControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.asteroid_collector Online documentation}
*/
asteroid_collector,
/**
* {@link LuaRadarControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.radar Online documentation}
*/
radar,
/**
* {@link LuaDisplayPanelControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.display_panel Online documentation}
*/
display_panel,
/**
* {@link LuaLoaderControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.loader Online documentation}
*/
loader,
/**
* {@link LuaCargoLandingPadControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.cargo_landing_pad Online documentation}
*/
cargo_landing_pad,
/**
* {@link LuaAgriculturalTowerControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.agricultural_tower Online documentation}
*/
agricultural_tower,
/**
* {@link LuaFurnaceControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.furnace Online documentation}
*/
furnace,
/**
* {@link LuaProxyContainerControlBehavior}
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.control_behavior.type.proxy_container Online documentation}
*/
proxy_container,
}
}
enum controllers {
/**
* Can't interact with the world, can only observe. Used in the multiplayer waiting-to-respawn screen.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.controllers.ghost Online documentation}
*/
ghost,
/**
* The controller controls a character. This is the default controller in freeplay.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.controllers.character Online documentation}
*/
character,
/**
* The controller isn't tied to a character. This is the default controller in sandbox.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.controllers.god Online documentation}
*/
god,
/**
* The Editor Controller near ultimate power to do almost anything in the game.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.controllers.editor Online documentation}
*/
editor,
/**
* The player can't interact with the world, and the camera pans around in a predefined manner.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.controllers.cutscene Online documentation}
*/
cutscene,
/**
* Can't change anything in the world but can view anything.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.controllers.spectator Online documentation}
*/
spectator,
/**
* Can't move/change items but can build ghosts/change settings.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.controllers.remote Online documentation}
*/
remote,
}
namespace deconstruction_item {
enum entity_filter_mode {
whitelist,
blacklist,
}
enum tile_filter_mode {
whitelist,
blacklist,
}
enum tile_selection_mode {
normal,
always,
never,
only,
}
}
// See https://forums.factorio.com/viewtopic.php?f=233&t=118305
/** @omit */
enum default_icon_size {}
enum difficulty {
easy,
normal,
hard,
}
enum direction {
north = 0,
northnortheast = 1,
northeast = 2,
eastnortheast = 3,
east = 4,
eastsoutheast = 5,
southeast = 6,
southsoutheast = 7,
south = 8,
southsouthwest = 9,
southwest = 10,
westsouthwest = 11,
west = 12,
westnorthwest = 13,
northwest = 14,
northnorthwest = 15,
}
enum disconnect_reason {
quit,
dropped,
reconnect,
wrong_input,
desync_limit_reached,
cannot_keep_up,
afk,
kicked,
kicked_and_deleted,
banned,
switching_servers,
}
enum distraction {
/**
* Perform command even if someone attacks the unit.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.distraction.none Online documentation}
*/
none,
/**
* Attack closer enemy entities with force.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.distraction.by_enemy Online documentation}
*/
by_enemy,
/**
* Attack closer enemy entities, including entities "built" by player (belts, inserters, chests).
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.distraction.by_anything Online documentation}
*/
by_anything,
/**
* Attack when attacked.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.distraction.by_damage Online documentation}
*/
by_damage,
}
enum entity_status {
working,
normal,
/**
* Used by ghosts.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.ghost Online documentation}
*/
ghost,
/**
* Only used if set through {@link LuaEntity#status LuaEntity::status} or {@link import("factorio:prototype").ContainerPrototype#default_status ContainerPrototype::default_status}.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.broken Online documentation}
*/
broken,
no_power,
low_power,
no_fuel,
frozen,
disabled_by_control_behavior,
opened_by_circuit_network,
closed_by_circuit_network,
disabled_by_script,
marked_for_deconstruction,
/**
* Used by space platform hubs.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.paused Online documentation}
*/
paused,
/**
* Used by generators and solar panels.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.not_plugged_in_electric_network Online documentation}
*/
not_plugged_in_electric_network,
/**
* Used by power switches.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.networks_connected Online documentation}
*/
networks_connected,
/**
* Used by power switches.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.networks_disconnected Online documentation}
*/
networks_disconnected,
/**
* Used by accumulators.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.charging Online documentation}
*/
charging,
/**
* Used by accumulators.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.discharging Online documentation}
*/
discharging,
/**
* Used by accumulators.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.fully_charged Online documentation}
*/
fully_charged,
/**
* Used by logistic containers.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.out_of_logistic_network Online documentation}
*/
out_of_logistic_network,
/**
* Used by assembling machines.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.no_recipe Online documentation}
*/
no_recipe,
/**
* Used by furnaces.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.no_ingredients Online documentation}
*/
no_ingredients,
/**
* Used by boilers, fluid turrets and fluid energy sources: Boiler has no fluid to work with.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.no_input_fluid Online documentation}
*/
no_input_fluid,
/**
* Used by labs.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.no_research_in_progress Online documentation}
*/
no_research_in_progress,
/**
* Used by mining drills.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.no_minable_resources Online documentation}
*/
no_minable_resources,
/**
* Used by cargo bays.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.not_connected_to_hub_or_pad Online documentation}
*/
not_connected_to_hub_or_pad,
/**
* Used by boilers and fluid turrets: Boiler still has some fluid but is about to run out.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.low_input_fluid Online documentation}
*/
low_input_fluid,
/**
* Used by crafting machines.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.fluid_ingredient_shortage Online documentation}
*/
fluid_ingredient_shortage,
/**
* Used by crafting machines, boilers, burner energy sources and reactors: Reactor/burner has full burnt result inventory, boiler has full output fluidbox.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.full_output Online documentation}
*/
full_output,
/**
* Used by agricultural towers.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.not_enough_space_in_output Online documentation}
*/
not_enough_space_in_output,
/**
* Used by burner energy sources.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.full_burnt_result_output Online documentation}
*/
full_burnt_result_output,
/**
* Used by crafting machines.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.item_ingredient_shortage Online documentation}
*/
item_ingredient_shortage,
/**
* Used by mining drills when the mining fluid is missing.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.missing_required_fluid Online documentation}
*/
missing_required_fluid,
/**
* Used by labs.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.missing_science_packs Online documentation}
*/
missing_science_packs,
/**
* Used by inserters.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.waiting_for_source_items Online documentation}
*/
waiting_for_source_items,
/**
* Used by inserters when wait_for_full_hand is set.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.waiting_for_more_items Online documentation}
*/
waiting_for_more_items,
/**
* Used by inserters and mining drills.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.waiting_for_space_in_destination Online documentation}
*/
waiting_for_space_in_destination,
/**
* Used by the rocket silo.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.preparing_rocket_for_launch Online documentation}
*/
preparing_rocket_for_launch,
/**
* Used by the rocket silo.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.waiting_to_launch_rocket Online documentation}
*/
waiting_to_launch_rocket,
/**
* Used by the rocket silo.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.waiting_for_space_in_platform_hub Online documentation}
*/
waiting_for_space_in_platform_hub,
/**
* Used by the rocket silo.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.launching_rocket Online documentation}
*/
launching_rocket,
/**
* Used by thrusters.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.thrust_not_required Online documentation}
*/
thrust_not_required,
/**
* Used by space platform hubs.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.on_the_way Online documentation}
*/
on_the_way,
/**
* Used by space platform hubs.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.waiting_in_orbit Online documentation}
*/
waiting_in_orbit,
/**
* Used by trains.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.waiting_at_stop Online documentation}
*/
waiting_at_stop,
/**
* Used by space platform hubs.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.waiting_for_rockets_to_arrive Online documentation}
*/
waiting_for_rockets_to_arrive,
/**
* Used by space platform hubs.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.not_enough_thrust Online documentation}
*/
not_enough_thrust,
/**
* Used by trains.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.destination_stop_full Online documentation}
*/
destination_stop_full,
/**
* Used by trains and space platform hubs.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.no_path Online documentation}
*/
no_path,
/**
* Used by beacons.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.no_modules_to_transmit Online documentation}
*/
no_modules_to_transmit,
/**
* Used by roboports.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.recharging_after_power_outage Online documentation}
*/
recharging_after_power_outage,
/**
* Used by inserters targeting entity ghosts.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.waiting_for_target_to_be_built Online documentation}
*/
waiting_for_target_to_be_built,
/**
* Used by inserters targeting rails.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.waiting_for_train Online documentation}
*/
waiting_for_train,
/**
* Used by ammo turrets.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.no_ammo Online documentation}
*/
no_ammo,
/**
* Used by heat energy sources.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.low_temperature Online documentation}
*/
low_temperature,
/**
* Used by constant combinators: Combinator is turned off via switch in GUI.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.disabled Online documentation}
*/
disabled,
/**
* Used by lamps.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.turned_off_during_daytime Online documentation}
*/
turned_off_during_daytime,
/**
* Used by rail signals.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.not_connected_to_rail Online documentation}
*/
not_connected_to_rail,
/**
* Used by rail signals.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.cant_divide_segments Online documentation}
*/
cant_divide_segments,
/**
* Used by filter inserters.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.no_filter Online documentation}
*/
no_filter,
/**
* Used by agricultural towers.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.no_spot_seedable_by_inputs Online documentation}
*/
no_spot_seedable_by_inputs,
/**
* Used by agricultural towers.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.waiting_for_plants_to_grow Online documentation}
*/
waiting_for_plants_to_grow,
/**
* Used by asteroid collectors.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.computing_navigation Online documentation}
*/
computing_navigation,
/**
* Used by pipes, pipes to ground and storage tanks.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.pipeline_overextended Online documentation}
*/
pipeline_overextended,
/**
* Used by assembling machines.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.entity_status.recipe_not_researched Online documentation}
*/
recipe_not_researched,
}
enum entity_status_diode {
green,
red,
yellow,
}
/**
* See the {@linkplain https://lua-api.factorio.com/2.0.47/events.html events page} for more info on what events contain and when they get raised.
* @see {@link https://lua-api.factorio.com/2.0.47/defines.html#defines.events Online documentation}
*/
namespace events {
/**
* Event type: {@link OnAchievementGainedEvent}
*/
const on_achievement_gained: EventId<OnAchievementGainedEvent>
/**
* Event type: {@link OnAiCommandCompletedEvent}
*/
const on_ai_command_completed: EventId<OnAiCommandCompletedEvent>
/**
* Event type: {@link OnAreaClonedEvent}
*/
const on_area_cloned: EventId<OnAreaClonedEvent>
/**
* Event type: {@link OnBiterBaseBuiltEvent}
*/
const on_biter_base_built: EventId<OnBiterBaseBuiltEvent>
/**
* Event type: {@link OnBrushClonedEvent}
*/
const on_brush_cloned: EventId<OnBrushClonedEvent>
/**
* Event type: {@link OnBuildBaseArrivedEvent}
*/
const on_build_base_arrived: EventId<OnBuildBaseArrivedEvent>
/**
* Event type: {@link OnBuiltEntityEvent}
*/
const on_built_entity: EventId<OnBuiltEntityEvent>
/**
* Event type: {@link OnCancelledDeconstructionEvent}
*/
const on_cancelled_deconstruction: EventId<OnCancelledDeconstructionEvent>
/**
* Event type: {@link OnCancelledUpgradeEvent}
*/
const on_cancelled_upgrade: EventId<OnCancelledUpgradeEvent>
/**
* Event type: {@link OnCargoPodDeliveredCargoEvent}
*/
const on_cargo_pod_delivered_cargo: EventId<OnCargoPodDeliveredCargoEvent>
/**
* Event type: {@link OnCargoPodFinishedAscendingEvent}
*/
const on_cargo_pod_finished_ascending: EventId<OnCargoPodFinishedAscendingEvent>
/**
* Event type: {@link OnCargoPodFinishedDescendingEvent}
*/
const on_cargo_pod_finished_descending: EventId<OnCargoPodFinishedDescendingEvent>
/**
* Event type: {@link OnCharacterCorpseExpiredEvent}
*/
const on_character_corpse_expired: EventId<OnCharacterCorpseExpiredEvent>
/**
* Event type: {@link OnChartTagAddedEvent}
*/
const on_chart_tag_added: EventId<OnChartTagAddedEvent>
/**
* Event type: {@link OnChartTagModifiedEvent}
*/
const on_chart_tag_modified: EventId<OnChartTagModifiedEvent>
/**
* Event type: {@link OnChartTagRemovedEvent}
*/
const on_chart_tag_removed: EventId<OnChartTagRemovedEvent>
/**
* Event type: {@link OnChunkChartedEvent}
*/
const on_chunk_charted: EventId<OnChunkChartedEvent>
/**
* Event type: {@link OnChunkDeletedEvent}
*/
const on_chunk_deleted: EventId<OnChunkDeletedEvent>
/**
* Event type: {@link OnChunkGeneratedEvent}
*/
const on_chunk_generated: EventId<OnChunkGeneratedEvent>
/**
* Event type: {@link OnCombatRobotExpiredEvent}
*/
const on_combat_robot_expired: EventId<OnCombatRobotExpiredEvent>
/**
* Event type: {@link OnConsoleChatEvent}
*/
const on_console_chat: EventId<OnConsoleChatEvent>
/**
* Event type: {@link OnConsoleCommandEvent}
*/
const on_console_command: EventId<OnConsoleCommandEvent>
/**
* Event type: {@link OnCutsceneCancelledEvent}
*/
const on_cutscene_cancelled: EventId<OnCutsceneCancelledEvent>
/**
* Event type: {@link OnCutsceneFinishedEvent}
*/
const on_cutscene_finished: EventId<OnCutsceneFinishedEvent>
/**
* Event type: {@link OnCutsceneStartedEvent}
*/
const on_cutscene_started: EventId<OnCutsceneStartedEvent>
/**
* Event type: {@link OnCutsceneWaypointReachedEvent}
*/
const on_cutscene_waypoint_reached: EventId<OnCutsceneWaypointReachedEvent>
/**
* Event type: {@link OnEntityClonedEvent}
*/
const on_entity_cloned: EventId<OnEntityClonedEvent>
/**
* Event type: {@link OnEntityColorChangedEvent}
*/
const on_entity_color_changed: EventId<OnEntityColorChangedEvent>
/**
* Event type: {@link OnEntityDamagedEvent}
*/
const on_entity_damaged: EventId<OnEntityDamagedEvent>
/**
* Event type: {@link OnEntityDiedEvent}
*/
const on_entity_died: EventId<OnEntityDiedEvent>
/**
* Event type: {@link OnEntityLogisticSlotChangedEvent}
*/
const on_entity_logistic_slot_changed: EventId<OnEntityLogisticSlotChangedEvent>
/**
* Event type: {@link OnEntityRenamedEvent}
*/
const on_entity_renamed: EventId<OnEntityRenamedEvent>
/**
* Event type: {@link OnEntitySettingsPastedEvent}
*/
const on_entity_settings_pasted: EventId<OnEntitySettingsPastedEvent>
/**
* Event type: {@link OnEntitySpawnedEvent}
*/
const on_entity_spawned: EventId<OnEntitySpawnedEvent>
/**
* Event type: {@link OnEquipmentInsertedEvent}
*/
const on_equipment_inserted: EventId<OnEquipmentInsertedEvent>
/**
* Event type: {@link OnEquipmentRemovedEvent}
*/
const on_equipment_removed: EventId<OnEquipmentRemovedEvent>
/**
* Event type: {@link OnForceCeaseFireChangedEvent}
*/
const on_force_cease_fire_changed: EventId<OnForceCeaseFireChangedEvent>
/**
* Event type: {@link OnForceCreatedEvent}
*/
const on_force_created: EventId<OnForceCreatedEvent>
/**
* Event type: {@link OnForceFriendsChangedEvent}
*/
const on_force_friends_changed: EventId<OnForceFriendsChangedEvent>
/**
* Event type: {@link OnForceResetEvent}
*/
const on_force_reset: EventId<OnForceResetEvent>
/**
* Event type: {@link OnForcesMergedEvent}
*/
const on_forces_merged: EventId<OnForcesMergedEvent>
/**
* Event type: {@link OnForcesMergingEvent}
*/
const on_forces_merging: EventId<OnForcesMergingEvent>
/**
* Event type: {@link OnGameCreatedFromScenarioEvent}
*/
const on_game_created_from_scenario: EventId<OnGameCreatedFromScenarioEvent>
/**
* Event type: {@link OnGuiCheckedStateChangedEvent}
*/
const on_gui_checked_state_changed: EventId<OnGuiCheckedStateChangedEvent>
/**
* Event type: {@link OnGuiClickEvent}
*/
const on_gui_click: EventId<OnGuiClickEvent>
/**
* Event type: {@link OnGuiClosedEvent}
*/
const on_gui_closed: EventId<OnGuiClosedEvent>
/**
* Event type: {@link OnGuiConfirmedEvent}
*/
const on_gui_confirmed: EventId<OnGuiConfirmedEvent>
/**
* Event type: {@link OnGuiElemChangedEvent}
*/
const on_gui_elem_changed: EventId<OnGuiElemChangedEvent>
/**
* Event type: {@link OnGuiHoverEvent}
*/
const on_gui_hover: EventId<OnGuiHoverEvent>
/**
* Event type: {@link OnGuiLeaveEvent}
*/
const on_gui_leave: EventId<OnGuiLeaveEvent>
/**
* Event type: {@link OnGuiLocationChangedEvent}
*/
const on_gui_location_changed: EventId<OnGuiLocationChangedEvent>
/**
* Event type: {@link OnGuiOpenedEvent}
*/
const on_gui_opened: EventId<OnGuiOpenedEvent>
/**
* Event type: {@link OnGuiSelectedTabChangedEvent}
*/
const on_gui_selected_tab_changed: EventId<OnGuiSelectedTabChangedEvent>
/**
* Event type: {@link OnGuiSelectionStateChangedEvent}
*/
const on_gui_selection_state_changed: EventId<OnGuiSelectionStateChangedEvent>
/**
* Event type: {@link OnGuiSwitchStateChangedEvent}
*/
const on_gui_switch_state_changed: EventId<OnGuiSwitchStateChangedEvent>
/**
* Event type: {@link OnGuiTextChangedEvent}
*/
const on_gui_text_changed: EventId<OnGuiTextChangedEvent>
/**
* Event type: {@link OnGuiValueChangedEvent}
*/
const on_gui_value_changed: EventId<OnGuiValueChangedEvent>
/**
* Event type: {@link OnLandMineArmedEvent}
*/
const on_land_mine_armed: EventId<OnLandMineArmedEvent>
/**
* Event type: {@link OnLuaShortcutEvent}
*/
const on_lua_shortcut: EventId<OnLuaShortcutEvent>
/**
* Event type: {@link OnMarkedForDeconstructionEvent}
*/
const on_marked_for_deconstruction: EventId<OnMarkedForDeconstructionEvent>
/**
* Event type: {@link OnMarkedForUpgradeEvent}
*/
const on_marked_for_upgrade: EventId<OnMarkedForUpgradeEvent>
/**
* Event type: {@link OnMarketItemPurchasedEvent}
*/
const on_market_item_purchased: EventId<OnMarketItemPurchasedEvent>
/**
* Event type: {@link OnModItemOpenedEvent}
*/
const on_mod_item_opened: EventId<OnModItemOpenedEvent>
/**
* Event type: {@link OnMultiplayerInitEvent}
*/
const on_multiplayer_init: EventId<OnMultiplayerInitEvent>
/**
* Event type: {@link OnObjectDestroyedEvent}
*/
const on_object_destroyed: EventId<OnObjectDestroyedEvent>
/**
* Event type: {@link OnPermissionGroupAddedEvent}
*/
const on_permission_group_added: EventId<OnPermissionGroupAddedEvent>
/**
* Event type: {@link OnPermissionGroupDeletedEvent}
*/
const on_permission_group_deleted: EventId<OnPermissionGroupDeletedEvent>
/**
* Event type: {@link OnPermissionGroupEditedEvent}
*/
const on_permission_group_edited: EventId<OnPermissionGroupEditedEvent>
/**
* Event type: {@link OnPermissionStringImportedEvent}
*/
const on_permission_string_imported: EventId<OnPermissionStringImportedEvent>
/**
* Event type: {@link OnPickedUpItemEvent}
*/
const on_picked_up_item: EventId<OnPickedUpItemEvent>
/**
* Event type: {@link OnPlayerAltReverseSelectedAreaEvent}
*/
const on_player_alt_reverse_selected_area: EventId<OnPlayerAltReverseSelectedAreaEvent>
/**
* Event type: {@link OnPlayerAltSelectedAreaEvent}
*/
const on_player_alt_selected_area: EventId<OnPlayerAltSelectedAreaEvent>
/**
* Event type: {@link OnPlayerAmmoInventoryChangedEvent}
*/
const on_player_ammo_inventory_changed: EventId<OnPlayerAmmoInventoryChangedEvent>
/**
* Event type: {@link OnPlayerArmorInventoryChangedEvent}
*/
const on_player_armor_inventory_changed: EventId<OnPlayerArmorInventoryChangedEvent>
/**
* Event type: {@link OnPlayerBannedEvent}
*/
const on_player_banned: EventId<OnPlayerBannedEvent>
/**
* Event type: {@link OnPlayerBuiltTileEvent}
*/
const on_player_built_tile: EventId<OnPlayerBuiltTileEvent>
/**
* Event type: {@link OnPlayerCancelledCraftingEvent}
*/
const on_player_cancelled_crafting: EventId<OnPlayerCancelledCraftingEvent>
/**
* Event type: {@link OnPlayerChangedForceEvent}
*/
const on_player_changed_force: EventId<OnPlayerChangedForceEvent>
/**
* Event type: {@link OnPlayerChangedPositionEvent}
*/
const on_player_changed_position: EventId<OnPlayerChangedPositionEvent>
/**
* Event type: {@link OnPlayerChangedSurfaceEvent}
*/
const on_player_changed_surface: EventId<OnPlayerChangedSurfaceEvent>
/**
* Event type: {@link OnPlayerCheatModeDisabledEvent}
*/
const on_player_cheat_mode_disabled: EventId<OnPlayerCheatModeDisabledEvent>
/**
* Event type: {@link OnPlayerCheatModeEnabledEvent}
*/
const on_player_cheat_mode_enabled: EventId<OnPlayerCheatModeEnabledEvent>
/**
* Event type: {@link OnPlayerClickedGpsTagEvent}
*/
const on_player_clicked_gps_tag: EventId<