Files
project-cybersyn/.vscode/factorio/runtime-api-LuaPlayer.lua
Monica Moniot d2bb9e2523 api update
2022-10-28 14:40:49 -04:00

809 lines
45 KiB
Lua

---@meta
---@diagnostic disable
--$Factorio 1.1.70
--$Overlay 5
--$Section LuaPlayer
-- This file is automatically generated. Edits will be overwritten.
---A player in the game. Pay attention that a player may or may not have a character, which is the [LuaEntity](https://lua-api.factorio.com/latest/LuaEntity.html) of the little guy running around the world doing things.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html)
---@class LuaPlayer:LuaControl
---[RW]
---`true` if the player is an admin.
---
---**Note:** Trying to change player admin status from the console when you aren't an admin does nothing.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.admin)
---@field admin boolean
---[R]
---How many ticks since the last action of this player
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.afk_time)
---@field afk_time uint
---[R]
---If the main inventory will be auto sorted.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.auto_sort_main_inventory)
---@field auto_sort_main_inventory boolean
---[R]
---The item stack containing a blueprint to be setup.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.blueprint_to_setup)
---@field blueprint_to_setup LuaItemStack
---[RW]
---The character attached to this player, if any. Returns `nil` when the player is disconnected (see [LuaPlayer::connected](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connected)).
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.character)
---@field character? LuaEntity
---[RW]
---The color used when this player talks in game.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.chat_color)
---@field chat_color Color
---[RW]
---The color associated with the player. This will be used to tint the player's character as well as their buildings and vehicles.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.color)
---@field color Color
---[R]
---`true` if the player is currently connected to the game.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connected)
---@field connected boolean
---[R]
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.controller_type)
---@field controller_type defines.controllers
---[R]
---When in a cutscene; the character this player would be using once the cutscene is over, if any. Returns `nil` when the player is disconnected (see [LuaPlayer::connected](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connected)).
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.cutscene_character)
---@field cutscene_character? LuaEntity
---[R]
---The display resolution for this player.
---
---**Note:** During [on_player_created](https://lua-api.factorio.com/latest/events.html#on_player_created), this attribute will always return a resolution of `{width=1920, height=1080}`. To get the actual resolution, listen to the [on_player_display_resolution_changed](https://lua-api.factorio.com/latest/events.html#on_player_display_resolution_changed) event raised shortly afterwards.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.display_resolution)
---@field display_resolution DisplayResolution
---[R]
---The display scale for this player.
---
---**Note:** During [on_player_created](https://lua-api.factorio.com/latest/events.html#on_player_created), this attribute will always return a scale of `1`. To get the actual scale, listen to the [on_player_display_scale_changed](https://lua-api.factorio.com/latest/events.html#on_player_display_scale_changed) event raised shortly afterwards.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.display_scale)
---@field display_scale double
---[R]
---The source entity used during entity settings copy-paste, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.entity_copy_source)
---@field entity_copy_source? LuaEntity
---[RW]
---The player's game view settings.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.game_view_settings)
---@field game_view_settings GameViewSettings
---[R]
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.gui)
---@field gui LuaGui
---[RW]
---The original location of the item in the cursor, marked with a hand. `nil` if the cursor stack is empty. When writing, the specified inventory slot must be empty and the cursor stack must not be empty.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.hand_location)
---@field hand_location? ItemStackLocation
---[R]
---This player's unique index in [LuaGameScript::players](https://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.players). It is given to them when they are [created](https://lua-api.factorio.com/latest/events.html#on_player_created) and remains assigned to them until they are [removed](https://lua-api.factorio.com/latest/events.html#on_player_removed).
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.index)
---@field index uint
---[RW]
---The filters for this map editor infinity inventory settings.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.infinity_inventory_filters)
---@field infinity_inventory_filters InfinityInventoryFilter[]
---[R]
---At what tick this player was last online.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.last_online)
---@field last_online uint
---[W]
---The player's map view settings. To write to this, use a table containing the fields that should be changed.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.map_view_settings)
---@field map_view_settings MapViewSettings
---[RW]
---`true` if the minimap is visible.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.minimap_enabled)
---@field minimap_enabled boolean
---[R]
---The current per-player settings for the this player, indexed by prototype name. Returns the same structure as [LuaSettings::get_player_settings](https://lua-api.factorio.com/latest/LuaSettings.html#LuaSettings.get_player_settings).
---
---**Note:** This table will become invalid if its associated player does.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.mod_settings)
---@field mod_settings LuaCustomTable<string,ModSetting>
---[R]
---The player's username.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.name)
---@field name string
---[R]
---The class name of this object. Available even when `valid` is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.object_name)
---@field object_name string
---[R]
---How many ticks did this player spend playing this save (all sessions combined)
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.online_time)
---@field online_time uint
---[R]
---`true` if the player opened itself. I.e. if they opened the character or god-controller GUI.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.opened_self)
---@field opened_self boolean
---[RW]
---The permission group this player is part of, if any.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.permission_group)
---@field permission_group? LuaPermissionGroup
---[RW]
---If items not included in this map editor infinity inventory filters should be removed.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_unfiltered_items)
---@field remove_unfiltered_items boolean
---[R]
---The render mode of the player, like map or zoom to world. The render mode can be set using [LuaPlayer::open_map](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.open_map), [LuaPlayer::zoom_to_world](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.zoom_to_world) and [LuaPlayer::close_map](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.close_map).
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.render_mode)
---@field render_mode defines.render_mode
---[RW]
---If `true`, circle and name of given player is rendered on the map/chart.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.show_on_map)
---@field show_on_map boolean
---[RW]
---If `true`, zoom-to-world noise effect will be disabled and environmental sounds will be based on zoom-to-world view instead of position of player's character.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.spectator)
---@field spectator boolean
---[R]
---The stashed controller type, if any.
---
---**Note:** This is mainly useful when a player is in the map editor.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.stashed_controller_type)
---@field stashed_controller_type? defines.controllers
---[RW]
---The tag that is shown after the player in chat and on the map.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.tag)
---@field tag string
---[RW]
---The number of ticks until this player will respawn. `nil` if this player is not waiting to respawn.
---
---Set to `nil` to immediately respawn the player.
---
---**Note:** Set to any positive value to trigger the respawn state for this player.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.ticks_to_respawn)
---@field ticks_to_respawn? uint
---[R]
---Is this object valid? This Lua object holds a reference to an object within the game engine. It is possible that the game-engine object is removed whilst a mod still holds the corresponding Lua object. If that happens, the object becomes invalid, i.e. this attribute will be `false`. Mods are advised to check for object validity if any change to the game state might have occurred between the creation of the Lua object and its access.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.valid)
---@field valid boolean
---[W]
---The player's zoom-level.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.zoom)
---@field zoom double
local LuaPlayer={
---Gets a copy of the currently selected blueprint in the clipboard queue into the player's cursor, as if the player activated Paste.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.activate_paste)
activate_paste=function()end,
---Adds an alert to this player for the given entity of the given alert type.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.add_alert)
---@param entity LuaEntity
---@param type defines.alert_type
add_alert=function(entity,type)end,
---Adds a custom alert to this player.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.add_custom_alert)
---@param entity LuaEntity@If the alert is clicked, the map will open at the position of this entity.
---@param icon SignalID
---@param message LocalisedString
---@param show_on_map boolean
add_custom_alert=function(entity,icon,message,show_on_map)end,
---Adds the given recipe to the list of recipe notifications for this player.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.add_recipe_notification)
---@param recipe string@Name of the recipe prototype to add.
add_recipe_notification=function(recipe)end,
---Adds the given blueprint to this player's clipboard queue.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.add_to_clipboard)
---@param blueprint LuaItemStack@The blueprint to add.
add_to_clipboard=function(blueprint)end,
---Associates a character with this player.
---
---**Note:** The character must not be connected to any controller.
---
---**Note:** If this player is currently disconnected (see [LuaPlayer::connected](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connected)) the character will be immediately "logged off".
---
---**Note:** See [LuaPlayer::get_associated_characters](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_associated_characters) for more information.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.associate_character)
---@param character LuaEntity@The character entity.
associate_character=function(character)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.build_from_cursor)
---@class LuaPlayer.build_from_cursor_param
---Where the entity would be placed
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.build_from_cursor)
---@field position MapPosition
---Direction the entity would be placed
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.build_from_cursor)
---@field direction? defines.direction
---If alt build should be used instead of normal build. Defaults to normal.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.build_from_cursor)
---@field alt? boolean
---The size for building terrain if building terrain. Defaults to 2.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.build_from_cursor)
---@field terrain_building_size? uint
---If chunks covered by fog-of-war are skipped.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.build_from_cursor)
---@field skip_fog_of_war? boolean
---Builds what ever is in the cursor on the surface the player is on.
---
---**Note:** Anything built will fire normal player-built events.
---
---**Note:** The cursor stack will automatically be reduced as if the player built normally.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.build_from_cursor)
---@param param LuaPlayer.build_from_cursor_param
build_from_cursor=function(param)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_build_from_cursor)
---@class LuaPlayer.can_build_from_cursor_param
---Where the entity would be placed
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_build_from_cursor)
---@field position MapPosition
---Direction the entity would be placed
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_build_from_cursor)
---@field direction? defines.direction
---If alt build should be used instead of normal build. Defaults to normal.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_build_from_cursor)
---@field alt? boolean
---The size for building terrain if building terrain. Defaults to 2.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_build_from_cursor)
---@field terrain_building_size? uint
---If chunks covered by fog-of-war are skipped.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_build_from_cursor)
---@field skip_fog_of_war? boolean
---Checks if this player can build what ever is in the cursor on the surface the player is on.
---
---**Events:**
--- * May raise [on_built_entity](https://lua-api.factorio.com/latest/events.html#on_built_entity) instantly.
---Raised if the cursor was successfully built.
---
--- * May raise [on_pre_build](https://lua-api.factorio.com/latest/events.html#on_pre_build) instantly.
---Raised if the cursor was successfully built.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_build_from_cursor)
---@param param LuaPlayer.can_build_from_cursor_param
---@return boolean
can_build_from_cursor=function(param)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_place_entity)
---@class LuaPlayer.can_place_entity_param
---Name of the entity to check.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_place_entity)
---@field name string
---Where the entity would be placed.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_place_entity)
---@field position MapPosition
---Direction the entity would be placed. Defaults to `north`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_place_entity)
---@field direction? defines.direction
---Checks if this player can build the give entity at the given location on the surface the player is on.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.can_place_entity)
---@param param LuaPlayer.can_place_entity_param
---@return boolean
can_place_entity=function(param)end,
---Clear the chat console.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.clear_console)
clear_console=function()end,
---Invokes the "clear cursor" action on the player as if the user pressed it.
---
---**Events:**
--- * May raise [on_player_cursor_stack_changed](https://lua-api.factorio.com/latest/events.html#on_player_cursor_stack_changed) later in the current tick.
---Raised when the cursor was successfully cleared.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.clear_cursor)
---@return boolean@Whether the cursor is now empty.
clear_cursor=function()end,
---Clears all recipe notifications for this player.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.clear_recipe_notifications)
clear_recipe_notifications=function()end,
---Clears the players selection tool selection position.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.clear_selection)
clear_selection=function()end,
---Queues request to switch to the normal game view from the map or zoom to world view. Render mode change requests are processed before rendering of the next frame.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.close_map)
close_map=function()end,
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connect_to_server)
---@class LuaPlayer.connect_to_server_param
---The server (address:port) if port is not given the default Factorio port is used.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connect_to_server)
---@field address string
---The name of the server.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connect_to_server)
---@field name? LocalisedString
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connect_to_server)
---@field description? LocalisedString
---The password if different from the one used to join this game. Note, if the current password is not empty but the one required to join the new server is an empty string should be given for this field.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connect_to_server)
---@field password? string
---Asks the player if they would like to connect to the given server.
---
---**Note:** This only does anything when used on a multiplayer peer. Single player and server hosts will ignore the prompt.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connect_to_server)
---@param param LuaPlayer.connect_to_server_param
connect_to_server=function(param)end,
---Creates and attaches a character entity to this player.
---
---**Note:** The player must not have a character already connected and must be online (see [LuaPlayer::connected](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connected)).
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_character)
---@param character string?@The character to create else the default is used.
---@return boolean@Whether the character was created.
create_character=function(character)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text)
---@class LuaPlayer.create_local_flying_text_param
---The flying text to show.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text)
---@field text LocalisedString
---The location on the map at which to show the flying text.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text)
---@field position? MapPosition
---If `true`, the flying text is created at the player's cursor. Defaults to `false`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text)
---@field create_at_cursor? boolean
---The color of the flying text. Defaults to white text.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text)
---@field color? Color
---The amount of ticks that the flying text will be shown for. Defaults to `80`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text)
---@field time_to_live? uint
---The speed at which the text rises upwards in tiles/second. Can't be a negative value.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text)
---@field speed? double
---Spawn flying text that is only visible to this player. Either `position` or `create_at_cursor` are required. When `create_at_cursor` is `true`, all parameters other than `text` are ignored.
---
---**Note:** If no custom `speed` is set and the text is longer than 25 characters, its `time_to_live` and `speed` are dynamically adjusted to give players more time to read it.
---
---**Note:** Local flying text is not saved, which means it will disappear after a save/load-cycle.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.create_local_flying_text)
---@param param LuaPlayer.create_local_flying_text_param
create_local_flying_text=function(param)end,
---Disables alerts for the given alert category.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.disable_alert)
---@param alert_type defines.alert_type
---@return boolean@Whether the alert type was disabled (false if it was already disabled).
disable_alert=function(alert_type)end,
---Disable recipe groups.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.disable_recipe_groups)
disable_recipe_groups=function()end,
---Disable recipe subgroups.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.disable_recipe_subgroups)
disable_recipe_subgroups=function()end,
---Disassociates a character from this player. This is functionally the same as setting [LuaEntity::associated_player](https://lua-api.factorio.com/latest/LuaEntity.html#LuaEntity.associated_player) to `nil`.
---
---**Note:** See [LuaPlayer::get_associated_characters](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_associated_characters) for more information.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.disassociate_character)
---@param character LuaEntity@The character entity
disassociate_character=function(character)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.drag_wire)
---@class LuaPlayer.drag_wire_param
---Position at which cursor was clicked. Used only to decide which side of arithmetic combinator, decider combinator or power switch is to be connected. Entity itself to be connected is based on the player's selected entity.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.drag_wire)
---@field position MapPosition
---Start/end wire dragging at the specified location, wire type is based on the cursor contents
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.drag_wire)
---@param param LuaPlayer.drag_wire_param
---@return boolean@`true` if the action did something
drag_wire=function(param)end,
---Enables alerts for the given alert category.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.enable_alert)
---@param alert_type defines.alert_type
---@return boolean@Whether the alert type was enabled (false if it was already enabled).
enable_alert=function(alert_type)end,
---Enable recipe groups.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.enable_recipe_groups)
enable_recipe_groups=function()end,
---Enable recipe subgroups.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.enable_recipe_subgroups)
enable_recipe_subgroups=function()end,
---Exit the current cutscene. Errors if not in a cutscene.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.exit_cutscene)
exit_cutscene=function()end,
---Gets which quick bar page is being used for the given screen page or `nil` if not known.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_active_quick_bar_page)
---@param index uint@The screen page. Index 1 is the top row in the gui. Index can go beyond the visible number of bars on the screen to account for the interface config setting change.
---@return uint8?
get_active_quick_bar_page=function(index)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_alerts)
---@class LuaPlayer.get_alerts_param
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_alerts)
---@field entity? LuaEntity
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_alerts)
---@field prototype? LuaEntityPrototype
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_alerts)
---@field position? MapPosition
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_alerts)
---@field type? defines.alert_type
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_alerts)
---@field surface? SurfaceIdentification
---Get all alerts matching the given filters, or all alerts if no filters are given.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_alerts)
---@param param LuaPlayer.get_alerts_param
---@return {[uint]: {[defines.alert_type]: Alert[]}}@A mapping of surface index to an array of arrays of [alerts](https://lua-api.factorio.com/latest/Concepts.html#Alert) indexed by the [alert type](https://lua-api.factorio.com/latest/defines.html#defines.alert_type).
get_alerts=function(param)end,
---The characters associated with this player.
---
---**Note:** The array will always be empty when the player is disconnected (see [LuaPlayer::connected](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connected)) regardless of there being associated characters.
---
---**Note:** Characters associated with this player will be logged off when this player disconnects but are not controlled by any player.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_associated_characters)
---@return LuaEntity[]
get_associated_characters=function()end,
---Get the current goal description, as a localised string.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_goal_description)
---@return LocalisedString
get_goal_description=function()end,
---Gets the filter for this map editor infinity filters at the given index or `nil` if the filter index doesn't exist or is empty.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_infinity_inventory_filter)
---@param index uint@The index to get.
---@return InfinityInventoryFilter?
get_infinity_inventory_filter=function(index)end,
---Gets the quick bar filter for the given slot or `nil`.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.get_quick_bar_slot)
---@param index uint@The slot index. 1 for the first slot of page one, 2 for slot two of page one, 11 for the first slot of page 2, etc.
---@return LuaItemPrototype?
get_quick_bar_slot=function(index)end,
---All methods and properties that this object supports.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.help)
---@return string
help=function()end,
---If the given alert type is currently enabled.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.is_alert_enabled)
---@param alert_type defines.alert_type
---@return boolean
is_alert_enabled=function(alert_type)end,
---If the given alert type is currently muted.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.is_alert_muted)
---@param alert_type defines.alert_type
---@return boolean
is_alert_muted=function(alert_type)end,
---Is a custom Lua shortcut currently available?
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.is_shortcut_available)
---@param prototype_name string@Prototype name of the custom shortcut.
---@return boolean
is_shortcut_available=function(prototype_name)end,
---Is a custom Lua shortcut currently toggled?
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.is_shortcut_toggled)
---@param prototype_name string@Prototype name of the custom shortcut.
---@return boolean
is_shortcut_toggled=function(prototype_name)end,
---Jump to the specified cutscene waypoint. Only works when the player is viewing a cutscene.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.jump_to_cutscene_waypoint)
---@param waypoint_index uint
jump_to_cutscene_waypoint=function(waypoint_index)end,
---Logs a dictionary of chunks -> active entities for the surface this player is on.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.log_active_entity_chunk_counts)
log_active_entity_chunk_counts=function()end,
---Logs a dictionary of active entities -> count for the surface this player is on.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.log_active_entity_counts)
log_active_entity_counts=function()end,
---Mutes alerts for the given alert category.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.mute_alert)
---@param alert_type defines.alert_type
---@return boolean@Whether the alert type was muted (false if it was already muted).
mute_alert=function(alert_type)end,
---Queues a request to open the map at the specified position. If the map is already opened, the request will simply set the position (and scale). Render mode change requests are processed before rendering of the next frame.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.open_map)
---@param position MapPosition
---@param scale double?
open_map=function(position,scale)end,
---Invokes the "smart pipette" action on the player as if the user pressed it.
---
---**Events:**
--- * May raise [on_player_pipette](https://lua-api.factorio.com/latest/events.html#on_player_pipette) instantly.
---Raised if the entity was successfully pipetted.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.pipette_entity)
---@param entity string|LuaEntity|LuaEntityPrototype
---@return boolean@Whether the smart pipette found something to place.
pipette_entity=function(entity)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.play_sound)
---@class LuaPlayer.play_sound_param
---The sound to play.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.play_sound)
---@field path SoundPath
---Where the sound should be played. If not given, it's played at the current position of the player.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.play_sound)
---@field position? MapPosition
---The volume of the sound to play. Must be between 0 and 1 inclusive.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.play_sound)
---@field volume_modifier? double
---The volume mixer to play the sound through. Defaults to the default mixer for the given sound type.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.play_sound)
---@field override_sound_type? SoundType
---Play a sound for this player.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.play_sound)
---@param param LuaPlayer.play_sound_param
play_sound=function(param)end,
---Print text to the chat console.
---
---**Note:** Messages that are identical to a message sent in the last 60 ticks are not printed again.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.print)
---@param message LocalisedString
---@param color Color?
print=function(message,color)end,
---Print entity statistics to the player's console.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.print_entity_statistics)
---@param entities string[]?@Entity prototypes to get statistics for. If not specified or empty, display statistics for all entities.
print_entity_statistics=function(entities)end,
---Print LuaObject counts per mod.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.print_lua_object_statistics)
print_lua_object_statistics=function()end,
---Print construction robot job counts to the players console.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.print_robot_jobs)
print_robot_jobs=function()end,
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert)
---@class LuaPlayer.remove_alert_param
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert)
---@field entity? LuaEntity
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert)
---@field prototype? LuaEntityPrototype|string
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert)
---@field position? MapPosition
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert)
---@field type? defines.alert_type
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert)
---@field surface? SurfaceIdentification
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert)
---@field icon? SignalID
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert)
---@field message? LocalisedString
---Removes all alerts matching the given filters or if an empty filters table is given all alerts are removed.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.remove_alert)
---@param param LuaPlayer.remove_alert_param
remove_alert=function(param)end,
---Requests a translation for the given localised string. If the request is successful the [on_string_translated](https://lua-api.factorio.com/latest/events.html#on_string_translated) event will be fired at a later time with the results.
---
---**Note:** Does nothing if this player is not connected. (see [LuaPlayer::connected](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.connected)).
---
---**Events:**
--- * May raise [on_string_translated](https://lua-api.factorio.com/latest/events.html#on_string_translated) in a future tick.
---Raised if the request was successfully sent.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.request_translation)
---@param localised_string LocalisedString
---@return boolean@Whether the request was sent or not.
request_translation=function(localised_string)end,
---Sets which quick bar page is being used for the given screen page.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_active_quick_bar_page)
---@param screen_index uint@The screen page. Index 1 is the top row in the gui. Index can go beyond the visible number of bars on the screen to account for the interface config setting change.
---@param page_index uint@The new quick bar page.
set_active_quick_bar_page=function(screen_index,page_index)end,
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller)
---@class LuaPlayer.set_controller_param
---Which controller to use.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller)
---@field type defines.controllers
---Entity to control. Mandatory when `type` is [defines.controllers.character](https://lua-api.factorio.com/latest/defines.html#defines.controllers.character), ignored otherwise.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller)
---@field character? LuaEntity
---List of waypoints for the cutscene controller. This parameter is mandatory when `type` is [defines.controllers.cutscene](https://lua-api.factorio.com/latest/defines.html#defines.controllers.cutscene).
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller)
---@field waypoints? CutsceneWaypoint
---If specified and `type` is [defines.controllers.cutscene](https://lua-api.factorio.com/latest/defines.html#defines.controllers.cutscene), the cutscene will start at this position. If not given the start position will be the player position.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller)
---@field start_position? MapPosition
---If specified and `type` is [defines.controllers.cutscene](https://lua-api.factorio.com/latest/defines.html#defines.controllers.cutscene), the cutscene will start at this zoom level. If not given the start zoom will be the players zoom.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller)
---@field start_zoom? double
---If specified and `type` is [defines.controllers.cutscene](https://lua-api.factorio.com/latest/defines.html#defines.controllers.cutscene), it is the time in ticks it will take for the camera to pan from the final waypoint back to the starting position. If not given the camera will not pan back to the start position/zoom.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller)
---@field final_transition_time? uint
---If specified and `type` is [defines.controllers.cutscene](https://lua-api.factorio.com/latest/defines.html#defines.controllers.cutscene), the game will switch to chart-mode (map zoomed out) rendering when the zoom level is less than this value.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller)
---@field chart_mode_cutoff? double
---Set the controller type of the player.
---
---**Note:** Setting a player to [defines.controllers.editor](https://lua-api.factorio.com/latest/defines.html#defines.controllers.editor) auto promotes the player to admin and enables cheat mode.
---
---**Note:** Setting a player to [defines.controllers.editor](https://lua-api.factorio.com/latest/defines.html#defines.controllers.editor) also requires the calling player be an admin.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_controller)
---@param param LuaPlayer.set_controller_param
set_controller=function(param)end,
---Setup the screen to be shown when the game is finished.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_ending_screen_data)
---@param message LocalisedString@Message to be shown.
---@param file string?@Path to image to be shown.
set_ending_screen_data=function(message,file)end,
---Set the text in the goal window (top left).
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_goal_description)
---@param text LocalisedString?@The text to display. Lines can be delimited with `\n`. Passing an empty string or omitting this parameter entirely will make the goal window disappear.
---@param only_update boolean?@When `true`, won't play the "goal updated" sound.
set_goal_description=function(text,only_update)end,
---Sets the filter for this map editor infinity filters at the given index.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_infinity_inventory_filter)
---
---_Can only be used if this is InfinityContainer_
---@param index uint@The index to set.
---@param filter InfinityInventoryFilter|nil@The new filter or `nil` to clear the filter.
set_infinity_inventory_filter=function(index,filter)end,
---Sets the quick bar filter for the given slot.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_quick_bar_slot)
---@param index uint@The slot index. 1 for the first slot of page one, 2 for slot two of page one, 11 for the first slot of page 2, etc.
---@param filter string|LuaItemPrototype|LuaItemStack@The filter or `nil`.
set_quick_bar_slot=function(index,filter)end,
---Make a custom Lua shortcut available or unavailable.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_shortcut_available)
---@param prototype_name string@Prototype name of the custom shortcut.
---@param available boolean
set_shortcut_available=function(prototype_name,available)end,
---Toggle or untoggle a custom Lua shortcut
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.set_shortcut_toggled)
---@param prototype_name string@Prototype name of the custom shortcut.
---@param toggled boolean
set_shortcut_toggled=function(prototype_name,toggled)end,
---Starts selection with selection tool from the specified position. Does nothing if the players cursor is not a selection tool.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.start_selection)
---@param position MapPosition@The position to start selection from.
---@param selection_mode string@The type of selection to start. Can be `select`, `alternative-select`, `reverse-select`.
start_selection=function(position,selection_mode)end,
---Toggles this player into or out of the map editor. Does nothing if this player isn't an admin or if the player doesn't have permission to use the map editor.
---
---**Events:**
--- * May raise [on_player_toggled_map_editor](https://lua-api.factorio.com/latest/events.html#on_player_toggled_map_editor) instantly.
---Raised if the map editor was successfully toggled.
---
--- * May raise [on_pre_player_toggled_map_editor](https://lua-api.factorio.com/latest/events.html#on_pre_player_toggled_map_editor) instantly.
---Raised if the map editor was successfully toggled.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.toggle_map_editor)
toggle_map_editor=function()end,
---Unlock the achievements of the given player. This has any effect only when this is the local player, the achievement isn't unlocked so far and the achievement is of the type "achievement".
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.unlock_achievement)
---@param name string@name of the achievement to unlock
unlock_achievement=function(name)end,
---Unmutes alerts for the given alert category.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.unmute_alert)
---@param alert_type defines.alert_type
---@return boolean@Whether the alert type was unmuted (false if it was wasn't muted).
unmute_alert=function(alert_type)end,
---Uses the current item in the cursor if it's a capsule or does nothing if not.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.use_from_cursor)
---@param position MapPosition@Where the item would be used.
use_from_cursor=function(position)end,
---Queues a request to zoom to world at the specified position. If the player is already zooming to world, the request will simply set the position (and scale). Render mode change requests are processed before rendering of the next frame.
---
---[View documentation](https://lua-api.factorio.com/latest/LuaPlayer.html#LuaPlayer.zoom_to_world)
---@param position MapPosition
---@param scale double?
zoom_to_world=function(position,scale)end,
}