<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.factorio.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Darkfrei</id>
	<title>Official Factorio Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.factorio.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Darkfrei"/>
	<link rel="alternate" type="text/html" href="https://wiki.factorio.com/Special:Contributions/Darkfrei"/>
	<updated>2026-04-08T01:05:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=186863</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=186863"/>
		<updated>2021-08-29T10:58:25Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Modding tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
The &#039;&#039;&#039;console&#039;&#039;&#039; is Factorio&#039;s in-game command-line interface. See [[command line parameters]] for the command line interface of the Factorio executable.&lt;br /&gt;
&lt;br /&gt;
The in-game console can be used for:&lt;br /&gt;
&lt;br /&gt;
* Chatting with other players&lt;br /&gt;
* Occasional status updates&lt;br /&gt;
* Running commands / scripts / cheats&lt;br /&gt;
&lt;br /&gt;
There are three types of commands:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[#Normal commands|Normal]]&#039;&#039;&#039; - Display information about the game and customize your experience.&lt;br /&gt;
* &#039;&#039;&#039;[[#Multiplayer commands|Multiplayer]]&#039;&#039;&#039; - Message filtering, banning users, etc.&lt;br /&gt;
* &#039;&#039;&#039;[[#Scripting and cheat commands|Scripting/Cheating]]&#039;&#039;&#039; - Run small Lua scripts (but they &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;disable achievements for the save game&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Using the console ===&lt;br /&gt;
The console display can be toggled with the {{keybinding|/}} (slash) or {{keybinding|~}} (tilde) keys.&lt;br /&gt;
&lt;br /&gt;
You can customize the keys via &#039;&#039;&#039;Settings menu → Controls → Toggle chat (and Lua console)&#039;&#039;&#039;.&lt;br /&gt;
When the console is open, you&#039;ll see a blinking cursor at the bottom of the screen; type your message or command and hit &#039;&#039;&#039;Return&#039;&#039;&#039; to send it (this will also close the console).&lt;br /&gt;
Documentation about message and command prefixes can be found further down this page.&lt;br /&gt;
&lt;br /&gt;
The console supports [[rich text]] tags. These tags are useful for sharing blueprints, marking map locations in chat or adding icons to map markers and train stations. Ctrl + Alt-clicking the map or ground will automatically insert a GPS tag and post it into the console. Shift-clicking most things with the console open will insert a tag for that thing into the console.&lt;br /&gt;
&lt;br /&gt;
When the console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages).&lt;br /&gt;
Note that by default, all executed commands are made visible to all users. The fade-out time can be changed via &#039;&#039;&#039;Settings menu → Interface → Chat message delay&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The console can be cleared with the &#039;&#039;&#039;/clear&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;uarr;}} and {{keybinding|&amp;amp;darr;}} keys to scroll through the console history. The {{keybinding|Tab}} key provides intelligent code completion on commands, options and player names.&lt;br /&gt;
&lt;br /&gt;
== Normal commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| /alerts &amp;lt;enable/disable/mute/unmute&amp;gt; &amp;lt;alert&amp;gt;&lt;br /&gt;
| /alerts disable turret_fire&lt;br /&gt;
| Enables, disables, mutes, or unmutes the given  [[alerts|alert]] type. Available alerts: entity_destroyed, entity_under_attack, not_enough_construction_robots, no_material_for_construction, not_enough_repair packs, turret_fire, custom, no_storage, train_out_of_fuel, fluid_mixing.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /clear&lt;br /&gt;
| /clear&lt;br /&gt;
| Clears the console.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /color &amp;lt;color&amp;gt;&lt;br /&gt;
| /color 20 255 255&lt;br /&gt;
| Changes your color. Can either be one of the pre-defined colors or [[:Wikipedia:RGB_color_space|RGB value]] in the format of “# # #”. Available colors: default, red, green, blue, orange, yellow, pink, purple, white, black, gray, brown, cyan, acid.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /evolution&lt;br /&gt;
| /evolution&lt;br /&gt;
| Prints info about the alien evolution factor.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /help [command]&lt;br /&gt;
| /help&lt;br /&gt;
| Prints a list of available commands, the optional argument can specify the command that should be described.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /h [command]&lt;br /&gt;
| /h&lt;br /&gt;
| Same as /help.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /mute-programmable-speaker &amp;lt;mute/unmute&amp;gt; &amp;lt;local/everyone&amp;gt;&lt;br /&gt;
| /mute-programmable-speaker mute local&lt;br /&gt;
| Mutes or unmutes the global sounds created by the Programmable Speaker. Use “local” to mute just the local client. Admins can use “everyone” to mute the sounds for everyone on the server.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /perf-avg-frames &amp;lt;number&amp;gt;&lt;br /&gt;
| /perf-avg-frames 100&lt;br /&gt;
| Number of ticks/updates used to average performance counters. Default is 100. Value of 5-10 is recommended for fast convergence, but numbers will jitter more rapidly.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /permissions&lt;br /&gt;
| /permissions&lt;br /&gt;
| Opens the permissions GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /permissions &amp;lt;action&amp;gt; &amp;lt;parameters&amp;gt;&lt;br /&gt;
| /permissions add-player DeveloperGroup kovarex&lt;br /&gt;
| Available actions are add-player &amp;lt;group&amp;gt; &amp;lt;player&amp;gt;, create-group &amp;lt;name&amp;gt;, delete-group &amp;lt;group&amp;gt;, edit-group &amp;lt;group&amp;gt; &amp;lt;input_action&amp;gt; &amp;lt;true/false&amp;gt;, get-player-group &amp;lt;player&amp;gt;, remove-player &amp;lt;group&amp;gt; &amp;lt;player&amp;gt;, rename-group &amp;lt;group&amp;gt; &amp;lt;new_name&amp;gt; and reset&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /reset-tips&lt;br /&gt;
| /reset-tips&lt;br /&gt;
| Resets the state of the tips and tricks as if the game was just started for the first time.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /screenshot [x resolution] [y resolution] [zoom]&lt;br /&gt;
| /screenshot&lt;br /&gt;
| Takes a screenshot with the GUI hidden, centered on the player. It is saved in the &amp;quot;script-output&amp;quot; subfolder of your [[User data directory]].  Resolution is optional and defaults to the current window size. Zoom is optional and defaults to 1.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /seed&lt;br /&gt;
| /seed&lt;br /&gt;
| Prints the starting map seed.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /time&lt;br /&gt;
| /time&lt;br /&gt;
| Prints info about how old the map is.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| Toggles logging all input actions performed by the game. This value isn’t persisted between game restarts and only affects your local game in multiplayer sessions.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| Used to investigate [[Desynchronization#Using_heavy_mode_command|desyncs]]. Will slow down the game and make multiplayer unplayable.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unlock-shortcut-bar&lt;br /&gt;
| /unlock-shortcut-bar&lt;br /&gt;
| Unlocks all [[shortcut bar]] items, including blueprint string import, copy &amp;amp; paste, deconstruction and upgrade planner.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unlock-tips&lt;br /&gt;
| /unlock-tips&lt;br /&gt;
| Unlocks all tips and tricks entries.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /version&lt;br /&gt;
| /version&lt;br /&gt;
| Prints the current game version.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Multiplayer commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;message&amp;gt;&lt;br /&gt;
| Hello team!&lt;br /&gt;
| Console input that does not start with {{keybinding|/}} is shown as a chat message to your team.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /admin&lt;br /&gt;
| /admin&lt;br /&gt;
| Opens the player management GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /admins&lt;br /&gt;
| /admins&lt;br /&gt;
| Prints a list of game admins.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ban &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /ban xTROLLx Throwing grenades in base&lt;br /&gt;
| Bans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /bans&lt;br /&gt;
| /bans&lt;br /&gt;
| Prints a list of banned players.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /banlist &amp;lt;add/remove/get/clear&amp;gt; &amp;lt;player&amp;gt;&lt;br /&gt;
| /banlist get&lt;br /&gt;
| Adds or removes a player from the banlist. Same as /ban or /unban.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /config &amp;lt;get/set&amp;gt; &amp;lt;option&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
| /config set password hunter2&lt;br /&gt;
| Gets or sets various multiplayer game settings. Available configs are: afk-auto-kick, allow-commands, allow-debug-settings, autosave-interval, autosave-only-on-server, ignore-player-limit-for-returning-players, max-players, max-upload-speed, only-admins-can-pause, password, require-user-verification, visibility-lan, visibility-public. The units for the options afk-auto-kick and autosave-interval are in minutes.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /delete-blueprint-library &amp;lt;player&amp;gt;&lt;br /&gt;
| /delete-blueprint-library everybody confirm&lt;br /&gt;
| Deletes the blueprint library storage for the given offline player from the save file. Enter “everybody confirm” to delete the storage of all offline players.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /demote &amp;lt;player&amp;gt;&lt;br /&gt;
| /demote AzureDiamond&lt;br /&gt;
| Demotes the player from admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /ignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /ignore Cthon98&lt;br /&gt;
| Prevents the chat from showing messages from this player. Admin messages are still shown.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ignores&lt;br /&gt;
| /ignores&lt;br /&gt;
| Prints a list of ignored players.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /kick &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /kick xTROLLx Throwing grenades in base&lt;br /&gt;
| Kicks the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mute &amp;lt;player&amp;gt;&lt;br /&gt;
| /mute Cthon98&lt;br /&gt;
| Prevents the player from saying anything in chat.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mutes&lt;br /&gt;
| /mutes&lt;br /&gt;
| All players that are muted (can’t talk in chat).&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /open &amp;lt;player&amp;gt;&lt;br /&gt;
| /open AzureDiamond&lt;br /&gt;
| Opens another player’s inventory.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /o &amp;lt;player&amp;gt;&lt;br /&gt;
| /o AzureDiamond&lt;br /&gt;
| Same as /open.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /players [online/o/count/c]&lt;br /&gt;
| /players&lt;br /&gt;
| Prints a list of players in the game. (parameter online/o, it prints only players that are online, count/c prints only count)&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /p [online/o/count/c]&lt;br /&gt;
| /p o c&lt;br /&gt;
| Same as /players.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /promote &amp;lt;player&amp;gt;&lt;br /&gt;
| /promote AzureDiamond&lt;br /&gt;
| Promotes the player to admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /purge &amp;lt;player&amp;gt;&lt;br /&gt;
| /purge Cthon98&lt;br /&gt;
| Clears all the messages from this player from the chat log.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /reply &amp;lt;message&amp;gt;&lt;br /&gt;
| /reply oh, really?&lt;br /&gt;
| Replies to the last player that whispered to you.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /r &amp;lt;message&amp;gt;&lt;br /&gt;
| /r oh, really?&lt;br /&gt;
| Same as /reply.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /server-save&lt;br /&gt;
| /server-save&lt;br /&gt;
| Saves the game on the server in a multiplayer game.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /shout &amp;lt;message&amp;gt;&lt;br /&gt;
| /shout Hello world!&lt;br /&gt;
| Sends a message to all players including other forces.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /s &amp;lt;message&amp;gt;&lt;br /&gt;
| /s Hello world!&lt;br /&gt;
| Same as /shout.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /swap-players &amp;lt;player&amp;gt; [player]&lt;br /&gt;
| /swap-players AzureDiamond&lt;br /&gt;
| Swaps your character with the given player’s character, or if two players are given swaps the two player characters.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unban &amp;lt;player&amp;gt;&lt;br /&gt;
| /unban xTROLLx&lt;br /&gt;
| Unbans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /unignore Cthon98&lt;br /&gt;
| Allows the chat to show messages from this player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unmute &amp;lt;player&amp;gt;&lt;br /&gt;
| /unmute Cthon98&lt;br /&gt;
| Allows the player to talk in chat again.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /whisper &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /whisper AzureDiamond that&#039;s what I see&lt;br /&gt;
| Sends a message to the specified player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /w &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /w AzureDiamond that&#039;s what I see&lt;br /&gt;
| Same as /whisper.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /whitelist &amp;lt;add/remove/get/clear&amp;gt; [player]&lt;br /&gt;
| /whitelist get&lt;br /&gt;
| Adds or removes a player from the whitelist, where only whitelisted players can join the game. Enter nothing for “player” when using “get” to print a list of all whitelisted players. An empty whitelist disables the whitelist functionality allowing anyone to join.&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scripting and cheat commands ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| /cheat &amp;lt;all&amp;gt;&lt;br /&gt;
| Researches all technologies and enables cheat mode. Using the &#039;&#039;&#039;all&#039;&#039;&#039; option also gives the player some additional items.&lt;br /&gt;
|-&lt;br /&gt;
| /command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command (if allowed).&lt;br /&gt;
|-&lt;br /&gt;
| /c &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command (if allowed).&lt;br /&gt;
|-&lt;br /&gt;
| /editor&lt;br /&gt;
| Toggles the map editor.&lt;br /&gt;
|-&lt;br /&gt;
| /measured-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command (if allowed) and measures time it took.&lt;br /&gt;
|-&lt;br /&gt;
| /silent-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command (if allowed) without printing it to the console.&lt;br /&gt;
|-&lt;br /&gt;
| /sc &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command (if allowed) without printing it to the console.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a very powerful feature, which also allows cheating, and as such &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;achievements will be permanently disabled for the save&amp;lt;/span&amp;gt; as soon as you use a script command.&lt;br /&gt;
&lt;br /&gt;
== Basic example scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Use it as calculator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(1234*5678)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zoom beyond normal bounds ===&lt;br /&gt;
Note that zooming too far out can cause performance hits. Be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.zoom=0.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mine faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Craft faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unlock and research all technologies ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_all_technologies()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Undo this with the command in the next section.&lt;br /&gt;
&lt;br /&gt;
=== Unresearch all technologies ===&lt;br /&gt;
This does not reset manually applied bonuses&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	tech.researched=false&lt;br /&gt;
	game.player.force.set_saved_technology_progress(tech, 0)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reset your force ===&lt;br /&gt;
This resets all data for your force, including kill and production statistics, technologies, bonuses and charting status.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.reset()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Always show rail block visualization ===&lt;br /&gt;
Permanently show the rail block visualization instead of only when holding a rail signal. Disable by replacing true with false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.game_view_settings.show_rail_block_visualisation = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set all trains to Automatic mode ===&lt;br /&gt;
Set all trains to automatic mode - for example after building them with a blueprint. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for key,ent in pairs (game.player.surface.find_entities_filtered{name=&amp;quot;locomotive&amp;quot;}) do &lt;br /&gt;
    ent.train.manual_mode = false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inventory manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Cheat mode ===&lt;br /&gt;
Allows for infinite free crafting. Disable by replacing true with false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.cheat_mode=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource tile in-game&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.amount=7500&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can refill all resources in the map with the following command. Change ore.amount to the desired value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c surface = game.player.surface&lt;br /&gt;
for _, ore in pairs(surface.find_entities_filtered({type=&amp;quot;resource&amp;quot;})) do&lt;br /&gt;
    ore.amount = 10000&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add items to the player&#039;s inventory ===&lt;br /&gt;
Replace iron-plate with the [[data.raw|internal name]] of the item desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For instance, here&#039;s a stack of the god-mode energy system interface:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;electric-energy-interface&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a powerful armor with equipment and some tools for construction:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c	local player = game.player&lt;br /&gt;
player.insert{name=&amp;quot;power-armor-mk2&amp;quot;, count = 1}&lt;br /&gt;
local p_armor = player.get_inventory(5)[1].grid&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;personal-roboport-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;night-vision-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
player.insert{name=&amp;quot;construction-robot&amp;quot;, count = 25}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Increase player inventory slots ===&lt;br /&gt;
Gives 100 additional bonus inventory slots to your entire force. Used by the [[Toolbelt (research)]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.character_inventory_slots_bonus=100&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== World manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Reveal the map around the player ===&lt;br /&gt;
&lt;br /&gt;
Reveals the map around the player, similar to a [[radar]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or from start position&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{x = -radius, y = -radius}, {x = radius, y = radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change 150 to the desired radius, higher values take longer.&lt;br /&gt;
&lt;br /&gt;
=== Hide revealed map ===&lt;br /&gt;
&lt;br /&gt;
Hides all revealed chunks, inverted map revealing.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local force = game.player.force&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  force.unchart_chunk({x = chunk.x, y = chunk.y}, surface)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reveal all generated map ===&lt;br /&gt;
&lt;br /&gt;
Revels all of the generated map to the player&#039;s team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.chart_all()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Delete chunks ===&lt;br /&gt;
If much of the map is revealed, it increases the size of the save file. The following command cancels the generation of all chunks that are currently queued for generation and removes chunks outside a 32 chunks radius around 0,0. Note that this will remove player entities if there are any on these chunks.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface;&lt;br /&gt;
game.player.force.cancel_charting(surface); &lt;br /&gt;
local chunk_radius = 32;&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  if (chunk.x &amp;lt; -chunk_radius or chunk.x &amp;gt; chunk_radius or chunk.y &amp;lt; -chunk_radius or chunk.y &amp;gt; chunk_radius) then&lt;br /&gt;
    surface.delete_chunk(chunk)&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Delete unrevealed chunks ===&lt;br /&gt;
This command deletes chunks that are not revealed by the player. Can be used after the command for [[#Hide revealed map|hiding revealed map]] to delete the chunks not covered by radar.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;/c local surface = game.player.surface&lt;br /&gt;
local force = game.player.force&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  if not force.is_chunk_charted(surface, chunk) then&lt;br /&gt;
    surface.delete_chunk(chunk)&lt;br /&gt;
  end&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
Enables eternal day.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.always_day=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change game speed ===&lt;br /&gt;
0.5 is half speed, 1 is default, 2 is double speed, etc. Minimum is 0.01. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.speed=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Freeze time ===&lt;br /&gt;
Stops the advancement of the time if you replace &amp;quot;BOOL&amp;quot; with &amp;quot;true&amp;quot; or unfreezes it if you replace it with &amp;quot;false&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.freeze_daytime=BOOL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.clear_pollution()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Completely turn off pollution ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, surface in pairs(game.surfaces) do&lt;br /&gt;
  surface.clear_pollution()&lt;br /&gt;
end&lt;br /&gt;
game.map_settings.pollution.enabled = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add a lot of pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.pollute(game.player.position, 1000000)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where speakers are, who placed them ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local speakers = game.player.surface.find_entities_filtered{force = game.player.force, type=&amp;quot;programmable-speaker&amp;quot;}&lt;br /&gt;
for key, speaker in pairs(speakers) do&lt;br /&gt;
    game.player.print(speaker.last_user.name .. &amp;quot; placed a speaker at [gps=&amp;quot; .. speaker.position.x .. &amp;quot;,&amp;quot; .. speaker.position.y .. &amp;quot;]&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable friendly fire for your force ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.friendly_fire = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 11×11 patch of resources, centered on the player character, where the ground is not water.&lt;br /&gt;
The patch it creates is perfectly square but it randomizes the amount similar to natural generation, with fewer ore at the edges and more ore in the center.&lt;br /&gt;
The default numbers result in a patch with 2500-3000 ore.&lt;br /&gt;
&lt;br /&gt;
If you want a larger patch, change &amp;quot;local size = 5&amp;quot; to a larger number.&lt;br /&gt;
A larger patch will have exponentially more ore.&lt;br /&gt;
Entering a number above 30 is not recommended.&lt;br /&gt;
&lt;br /&gt;
If you want a richer patch, change &amp;quot;local density = 10&amp;quot; to a larger number.&lt;br /&gt;
Entering a very large number shouldn&#039;t hurt anything but you probably don&#039;t need to go above 100.&lt;br /&gt;
&lt;br /&gt;
To choose which resource is spawned, change &amp;quot;stone&amp;quot; near the bottom to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, &amp;quot;coal&amp;quot;, or &amp;quot;uranium-ore&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local ore=nil&lt;br /&gt;
local size=5&lt;br /&gt;
local density=10&lt;br /&gt;
for y=-size, size do&lt;br /&gt;
	for x=-size, size do&lt;br /&gt;
		a=(size+1-math.abs(x))*10&lt;br /&gt;
		b=(size+1-math.abs(y))*10&lt;br /&gt;
		if a&amp;lt;b then&lt;br /&gt;
			ore=math.random(a*density-a*(density-8), a*density+a*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if b&amp;lt;a then&lt;br /&gt;
			ore=math.random(b*density-b*(density-8), b*density+b*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if surface.get_tile(game.player.position.x+x, game.player.position.y+y).collides_with(&amp;quot;ground-tile&amp;quot;) then&lt;br /&gt;
			surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=ore, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove resources around the player ===&lt;br /&gt;
Removes all resource patches from the ground in a 50 x 50 area around the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local size=50&lt;br /&gt;
local pos=game.player.position&lt;br /&gt;
&lt;br /&gt;
for _, e in pairs(surface.find_entities_filtered{area={{pos.x-size, pos.y-size},{pos.x+size, pos.y+size}}, type=&amp;quot;resource&amp;quot;}) &lt;br /&gt;
	do e.destroy() &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches in a 3×3 square.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for y=0,2 do&lt;br /&gt;
	for x=0,2 do&lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or randomly without any collision:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local position=nil&lt;br /&gt;
for i=1,9 do&lt;br /&gt;
	position=game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
	if position then &lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position=position})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Regenerate resources ===&lt;br /&gt;
For solid resources like iron, destroys all resource entities and creates resource entities as in the original map generation. For fluid resources like oil, sets the yield of all existing resource entities to the original amount. Regenerates resources on the entire surface.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
for _, e in pairs(surface.find_entities_filtered{type=&amp;quot;resource&amp;quot;}) do&lt;br /&gt;
  if e.prototype.infinite_resource then&lt;br /&gt;
    e.amount = e.initial_amount&lt;br /&gt;
  else&lt;br /&gt;
    e.destroy()&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
local non_infinites = {}&lt;br /&gt;
for resource, prototype in pairs(game.get_filtered_entity_prototypes{{filter=&amp;quot;type&amp;quot;, type=&amp;quot;resource&amp;quot;}}) do&lt;br /&gt;
  if not prototype.infinite_resource then&lt;br /&gt;
    table.insert(non_infinites, resource)&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
surface.regenerate_entity(non_infinites)&lt;br /&gt;
for _, e in pairs(surface.find_entities_filtered{type=&amp;quot;mining-drill&amp;quot;}) do&lt;br /&gt;
    e.update_connections()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create 10 fishes ===&lt;br /&gt;
This creates 10 fishes around of player. The player must be on the water edge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local player = game.player&lt;br /&gt;
local surface = player.surface&lt;br /&gt;
for i = 1, 10 do&lt;br /&gt;
  local position = surface.find_non_colliding_position(&#039;fish&#039;, player.position, 10, 1)&lt;br /&gt;
  if not position then return end&lt;br /&gt;
  surface.create_entity {name = &#039;fish&#039;, position = position}&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Count entities ===&lt;br /&gt;
Counts all entities whose name includes the string in local entity.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local entity=&amp;quot;belt&amp;quot;&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local count=0&lt;br /&gt;
for key, ent in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(ent.name,entity) then&lt;br /&gt;
		count=count+1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(count)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off cliff generation ===&lt;br /&gt;
Sets size to &amp;quot;none&amp;quot;. Only effective on chunks that are generated after using this command. Use [[#Remove all cliffs]] to delete existing cliffs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local mgs = game.player.surface.map_gen_settings&lt;br /&gt;
mgs.cliff_settings.cliff_elevation_0 = 1024&lt;br /&gt;
game.player.surface.map_gen_settings = mgs&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all cliffs ===&lt;br /&gt;
Removes all cliffs existing cliffs from the world. Use [[#Turn off cliff generation]] to turn off cliff generation in new chunks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, v in pairs(game.player.surface.find_entities_filtered{type=&amp;quot;cliff&amp;quot;}) do&lt;br /&gt;
  v.destroy()&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Delete all decoratives ===&lt;br /&gt;
Delete the decoratives that can be found in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.destroy_decoratives({})&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change map generation settings ===&lt;br /&gt;
This allows to change the map generation settings for new chunks; it does not alter already generated chunks. [[#Delete chunks|Deleted chunks]] are affected by the setting change because they are newly generated when they get explored again.&lt;br /&gt;
&lt;br /&gt;
To change resource generation settings, replace &amp;quot;iron-ore&amp;quot; with the [[Data.raw#resource|resource]] that should be changed and replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command. Replace &amp;quot;iron-ore&amp;quot; with &amp;quot;enemy-base&amp;quot; to change the enemy base generation settings. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local resource = &amp;quot;iron-ore&amp;quot;&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.autoplace_controls[resource].size = &amp;quot;very-high&amp;quot;&lt;br /&gt;
mgs.autoplace_controls[resource].frequency = &amp;quot;very-high&amp;quot;&lt;br /&gt;
mgs.autoplace_controls[resource].richness = &amp;quot;very-high&amp;quot;&lt;br /&gt;
surface.map_gen_settings = mgs&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change water generation settings, replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.water = &amp;quot;very-high&amp;quot; --[[ size]]&lt;br /&gt;
mgs.terrain_segmentation  = &amp;quot;very-high&amp;quot; --[[ frequency]]&lt;br /&gt;
surface.map_gen_settings = mgs &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enemy/evolution scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Set evolution factor ===&lt;br /&gt;
Ranges from 0 (new game) to 1.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].evolution_factor=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_evolution.time_factor=0&lt;br /&gt;
/c game.map_settings.enemy_evolution.pollution_factor=game.map_settings.enemy_evolution.pollution_factor*2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;2&amp;quot; at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.&lt;br /&gt;
&lt;br /&gt;
=== Kill all biters on the &amp;quot;enemy&amp;quot; force ===&lt;br /&gt;
Note that this will kill only mobile units, spawners will not be killed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all enemies ===&lt;br /&gt;
This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the generated world, so any unexplored parts of the map which still need to be generated will still have enemies. You can [[#Prevent biters being on newly generated chunks|prevent biters being on newly generated chunks]] if desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all nearby enemies ===&lt;br /&gt;
&lt;br /&gt;
This will kill all biters, bases and worms in a configurable radius. The default, 250 tiles, is about two zoomed-out screen widths on full HD. After destruction, it shows how many objects were destroyed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local pp = game.player.position&lt;br /&gt;
local cnt = 0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;, radius=250, position=pp })) do&lt;br /&gt;
	cnt = cnt+1&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
 end	&lt;br /&gt;
game.player.print(cnt)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable peaceful mode ===&lt;br /&gt;
Enabling peaceful mode prevents biter attacks until provoked. Substitute true for false to disable. Already existing biters are not affected by this command so attacks could continue for a while after activating peaceful mode.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.peaceful_mode = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable biter expansion ===&lt;br /&gt;
Biter expansion allows biters to create new nests, it is enabled by default. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_expansion.enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Prevent biters being on newly generated chunks ===&lt;br /&gt;
On newly generated chunks no biters will be present, however all current biters will remain unaffected. Equivalent of setting the Enemy Base Size to None under the Terrain settings during map generation but achieved mid game by [[#Change map generation settings|changing map generation settings]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.autoplace_controls[&amp;quot;enemy-base&amp;quot;].size = &amp;quot;none&amp;quot;&lt;br /&gt;
surface.map_gen_settings = mgs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Player character scripts ==&lt;br /&gt;
Commands concerning the player directly.&lt;br /&gt;
=== Get player position ===&lt;br /&gt;
Prints coordinates of your current position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.position.x .. &amp;quot;, &amp;quot; .. game.player.position.y)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Teleport player ===&lt;br /&gt;
Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.teleport({X, Y})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To teleport to the world&#039;s origin, use 0,0.&lt;br /&gt;
&lt;br /&gt;
=== Enable god mode ===&lt;br /&gt;
God mode removes your player character allowing you to fly over obstacles and take no damage.&lt;br /&gt;
&lt;br /&gt;
Disassociate your controls from the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.character=nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, hover the mouse over the useless player and destroy it by typing:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.destroy()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To undo, spawn a player character. This will spawn a new player at the spawn point of the world, and connect your controls to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.create_character()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable long reach ===&lt;br /&gt;
Enables long reach, which allows the player to build and interact with entities at a greater distance. The default reach is 10.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local reach = 10000&lt;br /&gt;
game.player.force.character_build_distance_bonus = reach&lt;br /&gt;
game.player.force.character_reach_distance_bonus = reach&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Find player corpses ===&lt;br /&gt;
Pings player corpses on the map.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local found_corpses = game.player.surface.find_entities_filtered{type=&amp;quot;character-corpse&amp;quot;}&lt;br /&gt;
for _,corpse in pairs(found_corpses) do&lt;br /&gt;
    local player = game.get_player(corpse.character_corpse_player_index)&lt;br /&gt;
    local name = player and player.name or &amp;quot;????&amp;quot;&lt;br /&gt;
    game.player.print(name .. &amp;quot; --&amp;gt; [gps=&amp;quot; .. corpse.position.x .. &amp;quot;,&amp;quot; .. corpse.position.y .. &amp;quot;]&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Enable Research Queue ===&lt;br /&gt;
Enable the research queue for the player&#039;s current team. Can be done after the game has started if it was forgotten during the map&#039;s setup.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_queue_enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.laboratory_speed_modifier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
1 is normal speed, 2 is double speed 3 is triple etc.&lt;br /&gt;
&lt;br /&gt;
=== Research specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=true&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unresearch specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;electric-energy-distribution-1&#039;, 0)&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;steel-processing&#039;, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling specific recipes ===&lt;br /&gt;
The internal recipe/item names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;electric-energy-interface&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;rocket-silo&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes.loader.enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;fast-loader&amp;quot;].enabled = true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;express-loader&amp;quot;].enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable all recipes ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name, recipe in pairs(game.player.force.recipes) do recipe.enabled = true end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modding tools ==&lt;br /&gt;
A list of the internal names of most things in the vanilla game can also be found on [[data.raw]].&lt;br /&gt;
&lt;br /&gt;
=== Access a mod&#039;s data ===&lt;br /&gt;
If the first word of the command is __mod-name__ it will run in the context of the mod with the same name. For instance, this command prints the data from Resource Spawner Overhaul:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c __rso-mod__ game.player.print(serpent.dump(global))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Print to console which tile are you have under the player position ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.surface.get_tile(game.player.position).name)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all researched technologies to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	if tech.researched then&lt;br /&gt;
    list[#list+1] = tech.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;techs.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all enabled recipes to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, recipe in pairs(game.player.force.recipes) do &lt;br /&gt;
	if recipe.enabled then&lt;br /&gt;
    list[#list+1] = recipe.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;recipes.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write mod list to file ===&lt;br /&gt;
Write all currently active mods and their version to the file script-output/mods.txt in the [[user data directory]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.write_file(&amp;quot;mods.txt&amp;quot;, serpent.block(game.active_mods))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reload technologies ===&lt;br /&gt;
Reload technologies from its prototypes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.reset_technologies()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Command line parameters]]&lt;br /&gt;
* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Prototype/Sound&amp;diff=186595</id>
		<title>Prototype/Sound</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Prototype/Sound&amp;diff=186595"/>
		<updated>2021-07-20T11:45:31Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Optional properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Prototype parent}}&lt;br /&gt;
Specifies a sound that can be used with https://lua-api.factorio.com/latest/Concepts.html#SoundPath during runtime.&lt;br /&gt;
&lt;br /&gt;
{{Prototype TOC|sound}}&lt;br /&gt;
&lt;br /&gt;
== Mandatory properties ==&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|type|[[Types/string|string]]}}&lt;br /&gt;
Must be &amp;quot;sound&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|name|[[Types/string|string]]}}&lt;br /&gt;
Name of the sound. Must be unique. Used as a https://lua-api.factorio.com/latest/Concepts.html#SoundPath.&lt;br /&gt;
&lt;br /&gt;
== Optional properties ==&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|category|[[Types/string|string]]|&amp;quot;game-effect&amp;quot;|optional=true}}&lt;br /&gt;
One of &amp;quot;game-effect&amp;quot;, &amp;quot;gui-effect&amp;quot;, &amp;quot;ambient&amp;quot;, &amp;quot;environment&amp;quot;, &amp;quot;walking&amp;quot;, &amp;quot;alert&amp;quot; and &amp;quot;wind&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|aggregation|[[Types/table|table]]|optional=true}}&lt;br /&gt;
Table with the following members:&lt;br /&gt;
* max_count - [[Types/uint32|uint32]] - Mandatory.&lt;br /&gt;
* progress_threshold - [[Types/float|float]] - Optional. - Default: 1.0 - If count already playing is true, this will determine maximum progress when instance is counted toward playing sounds.&lt;br /&gt;
* remove - [[Types/bool|bool]] - Mandatory.&lt;br /&gt;
* count_already_playing - [[Types/bool|bool]] - Optional. - Default: false - If true already playing sounds are taken into account when checking maxCount.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|allow_random_repeat|[[Types/bool|bool]]|false|optional=true}}&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|audible_distance_modifier|[[Types/double|double]]|1.0|optional=true}}&lt;br /&gt;
&lt;br /&gt;
Set to 9999999 for global sound.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|variations|[[Types/table|table]] (array) of [[Types/table|table]]s|optional=true}}&lt;br /&gt;
Array of tables with the following members:&lt;br /&gt;
* filename - [[Types/FileName|FileName]] - Mandatory.&lt;br /&gt;
* volume - [[Types/float|float]] - Optional. - Default: 1.0&lt;br /&gt;
* preload - [[Types/bool|bool]] - Optional.&lt;br /&gt;
* speed - [[Types/float|float]] - Optional. - Default: 1.0 - Speed must be &amp;gt;= 1 / 64. This sets both min and max speed.&lt;br /&gt;
* min_speed - [[Types/float|float]] - Optional. Not loaded if speed is present. - Default: 1.0 - Speed must be &amp;gt;= 1 / 64.&lt;br /&gt;
* max_speed - [[Types/float|float]] - Mandatory if min_speed is present, otherwise not loaded. - Default: 1.0 - Must be &amp;gt;= min_speed.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|filename|[[Types/FileName|FileName]]|optional=true}}&lt;br /&gt;
Mandatory if &amp;lt;code&amp;gt;variations&amp;lt;/code&amp;gt; is not given.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|volume|[[Types/float|float]]|1.0|optional=true}}&lt;br /&gt;
Only loaded if &amp;lt;code&amp;gt;variations&amp;lt;/code&amp;gt; is not given.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|preload|[[Types/bool|bool]]|optional=true}}&lt;br /&gt;
Only loaded if &amp;lt;code&amp;gt;variations&amp;lt;/code&amp;gt; is not given.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|speed|[[Types/float|float]]|1.0|optional=true}}&lt;br /&gt;
Only loaded if &amp;lt;code&amp;gt;variations&amp;lt;/code&amp;gt; is not given. Speed must be &amp;gt;= 1 / 64. This sets both min and max speed.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|min_speed|[[Types/float|float]]|1.0|optional=true}}&lt;br /&gt;
Only loaded if &amp;lt;code&amp;gt;variations&amp;lt;/code&amp;gt; is not given. Not loaded if speed is present. Speed must be &amp;gt;= 1 / 64.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|max_speed|[[Types/float|float]]|1.0|optional=true}}&lt;br /&gt;
Only loaded if &amp;lt;code&amp;gt;variations&amp;lt;/code&amp;gt; is not given. Mandatory if min_speed is present, otherwise not loaded. Must be &amp;gt;= min_speed.&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Types/Sound&amp;diff=186594</id>
		<title>Types/Sound</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Types/Sound&amp;diff=186594"/>
		<updated>2021-07-20T09:47:13Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Basics==&lt;br /&gt;
This type is either a table with the properties listed in [[#Optional properties]], or an array of tables with the following members:&lt;br /&gt;
* filename - [[Types/FileName]] - Mandatory.&lt;br /&gt;
* volume - [[Types/float]] - Optional. - Default: 1.0&lt;br /&gt;
* preload - [[Types/bool]] - Optional.&lt;br /&gt;
* speed - [[Types/float]] - Optional. - Default: 1.0 - Speed must be &amp;gt;= 1 / 64. This sets both min and max speed.&lt;br /&gt;
* min_speed - [[Types/float]] - Optional. Not loaded if speed is present. - Default: 1.0 - Speed must be &amp;gt;= 1 / 64.&lt;br /&gt;
* max_speed - [[Types/float]] - Mandatory if min_speed is present, otherwise not loaded. - Default: 1.0 - Must be &amp;gt;= min_speed.&lt;br /&gt;
&lt;br /&gt;
== Optional properties ==&lt;br /&gt;
=== aggregation ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/table]]&lt;br /&gt;
&lt;br /&gt;
Table with the following members:&lt;br /&gt;
* max_count - [[Types/uint32]] - Mandatory.&lt;br /&gt;
* progress_threshold - [[Types/float]] - Optional. - Default: 1.0 - If count already playing is true, this will determine maximum progress when instance is counted toward playing sounds.&lt;br /&gt;
* remove - [[Types/bool]] - Mandatory.&lt;br /&gt;
* count_already_playing - [[Types/bool]] - Optional. - Default: false - If true already playing sounds are taken into account when checking maxCount.&lt;br /&gt;
&lt;br /&gt;
=== allow_random_repeat ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/bool]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: false&lt;br /&gt;
&lt;br /&gt;
=== audible_distance_modifier ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 1.0&lt;br /&gt;
Modifies how far a sound can be heard. Can only be 1 or lower, has to be a positive number.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== variations ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/table]] (array) of [[Types/table]]s&lt;br /&gt;
&lt;br /&gt;
Array of tables with the following members:&lt;br /&gt;
* filename - [[Types/FileName]] - Mandatory.&lt;br /&gt;
* volume - [[Types/float]] - Optional. - Default: 1.0&lt;br /&gt;
* preload - [[Types/bool]] - Optional.&lt;br /&gt;
* speed - [[Types/float]] - Optional. - Default: 1.0 - Speed must be &amp;gt;= 1 / 64. This sets both min and max speed.&lt;br /&gt;
* min_speed - [[Types/float]] - Optional. Not loaded if speed is present. - Default: 1.0 - Speed must be &amp;gt;= 1 / 64.&lt;br /&gt;
* max_speed - [[Types/float]] - Mandatory if max_speed is present, otherwise not loaded. - Default: 1.0 - Must be &amp;gt;= min_speed.&lt;br /&gt;
&lt;br /&gt;
=== filename ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/FileName]]&lt;br /&gt;
&lt;br /&gt;
Mandatory if &amp;lt;code&amp;gt;variations&amp;lt;/code&amp;gt; is not given.&lt;br /&gt;
&lt;br /&gt;
=== volume ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/float]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 1.0&lt;br /&gt;
&lt;br /&gt;
Only loaded if &amp;lt;code&amp;gt;variations&amp;lt;/code&amp;gt; is not given.&lt;br /&gt;
&lt;br /&gt;
=== preload ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/bool]]&lt;br /&gt;
&lt;br /&gt;
Only loaded if &amp;lt;code&amp;gt;variations&amp;lt;/code&amp;gt; is not given.&lt;br /&gt;
&lt;br /&gt;
=== speed ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/float]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 1.0&lt;br /&gt;
&lt;br /&gt;
Only loaded if &amp;lt;code&amp;gt;variations&amp;lt;/code&amp;gt; is not given. Speed must be &amp;gt;= 1 / 64. This sets both min and max speed.&lt;br /&gt;
&lt;br /&gt;
=== min_speed ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/float]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 1.0&lt;br /&gt;
&lt;br /&gt;
Only loaded if &amp;lt;code&amp;gt;variations&amp;lt;/code&amp;gt; is not given. Not loaded if speed is present. Speed must be &amp;gt;= 1 / 64.&lt;br /&gt;
&lt;br /&gt;
=== max_speed ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/float]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 1.0&lt;br /&gt;
&lt;br /&gt;
Only loaded if &amp;lt;code&amp;gt;variations&amp;lt;/code&amp;gt; is not given. Mandatory if min_speed is present, otherwise not loaded. Must be &amp;gt;= min_speed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
    {&lt;br /&gt;
      filename = &amp;quot;__base__/sound/ambient/world-ambience-3.ogg&amp;quot;,&lt;br /&gt;
      volume = 1.2&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
{{Prototype property type usage|{{FULLPAGENAME}}}}&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Mod_settings&amp;diff=185418</id>
		<title>Tutorial:Mod settings</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Mod_settings&amp;diff=185418"/>
		<updated>2021-04-05T13:03:19Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Creation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
This tutorial aims to explain how to create and use mod settings. Basic knowledge of modding is assumed, so you should have at least understood [[Tutorial:Modding tutorial/Gangsir|Gangsir&#039;s modding tutorial]].&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Each mod can specify settings that users can change. The values of these settings can be accessed from inside the data stage or the control stage depending on their [[#The_setting_type_property|setting_type]] and allow to conditionally create or modify prototypes and to add configuration options to control scripts. They were added in version 0.15 to allow modders to easily create a graphical interface for their configuration options, instead of relying on text files that had to be edited manually by the users.&lt;br /&gt;
&lt;br /&gt;
== Location ==&lt;br /&gt;
&lt;br /&gt;
Mod settings are defined in the [http://lua-api.factorio.com/latest/Data-Lifecycle.html settings stage]. This stage is loaded before the data stage. There are three files in which settings can be defined:&lt;br /&gt;
* settings.lua&lt;br /&gt;
* settings-updates.lua&lt;br /&gt;
* settings-final-fixes.lua&lt;br /&gt;
&lt;br /&gt;
First the settings.lua file is called for each mod, in the order of their dependencies and then in the [[:Wikipedia:natural sort order|natural sort order]]. After settings.lua has been called for all mods, the settings-updates.lua file is called for each mod &amp;lt;sup&amp;gt;(in the same order)&amp;lt;/sup&amp;gt; and finally the settings-final-fixes.lua file is called for each mod &amp;lt;sup&amp;gt;(in the same order)&amp;lt;/sup&amp;gt;. These 3 different phases of the settings stage allow to change settings of other mods without needing to rely on dependencies to load last. The settings are all defined in the same stage and their user defined values are not available, therefore mods cannot conditionally create settings depending on the values of other mod settings. Since the settings stage gets loaded first, there is also no prototype data or [http://lua-api.factorio.com/latest/LuaRemote.html remote interface] available.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;mod-settings.dat&amp;quot; file stored in the [[Application_directory#User_Data_directory|mods folder]] for the game contains the local players settings between game sessions similar to the player-data.json file.&lt;br /&gt;
&lt;br /&gt;
== Creation ==&lt;br /&gt;
&lt;br /&gt;
Mod settings are defined and modified by using the data table. This works [[Tutorial:Modding_tutorial/Gangsir#Prototype_creation|the same way as other prototypes]]. An example would be:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- settings.lua&lt;br /&gt;
data:extend({&lt;br /&gt;
    {&lt;br /&gt;
        type = &amp;quot;bool-setting&amp;quot;,&lt;br /&gt;
        name = &amp;quot;my-mod-test-setting&amp;quot;,&lt;br /&gt;
        setting_type = &amp;quot;runtime-global&amp;quot;,&lt;br /&gt;
        default_value = true&lt;br /&gt;
    }&lt;br /&gt;
})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, the setting has multiple properties. Each setting supports the following standard prototype properties:&lt;br /&gt;
* name ([http://lua-api.factorio.com/latest/Builtin-Types.html#string string], required)&lt;br /&gt;
* type (string, required)&lt;br /&gt;
* localised_name ([http://lua-api.factorio.com/latest/Concepts.html#LocalisedString localised string], optional)&lt;br /&gt;
* localised_description (localised string, optional)&lt;br /&gt;
* [[Types/Order|order]] (string, optional)&lt;br /&gt;
&lt;br /&gt;
In addition to the standard properties, mod settings also contain:&lt;br /&gt;
&lt;br /&gt;
* hidden ([[Types/bool|boolean]], optional)&lt;br /&gt;
* setting_type (string, required)&lt;br /&gt;
&lt;br /&gt;
=== The name property ===&lt;br /&gt;
&lt;br /&gt;
The name of the settings prototype should be unique to avoid mod conflicts since the mod settings are global across all mods. Because of that it is recommened to prefix mod settings with your mod name, &amp;quot;my-mod&amp;quot; in this example.&lt;br /&gt;
&lt;br /&gt;
=== The type property ===&lt;br /&gt;
&lt;br /&gt;
There are four types of mod settings:&lt;br /&gt;
&lt;br /&gt;
* bool-setting - a true/false checkbox&lt;br /&gt;
* int-setting - a signed 64 bit integer textfield (or selection dropdown)&lt;br /&gt;
* double-setting - a double precision floating point textfield (or selection dropdown)&lt;br /&gt;
* string-setting - a string textfield (or selection dropdown)&lt;br /&gt;
&lt;br /&gt;
Depending on the type, the prototype also allows or requires additional properties:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;factorio-list&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;bool-setting&#039;&#039;&#039;:&lt;br /&gt;
** default_value ([http://lua-api.factorio.com/latest/Builtin-Types.html#boolean bool], required) - Defines the default value of the setting, in this case whether the checkbox is checked or not.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;int-setting&#039;&#039;&#039;:&lt;br /&gt;
** default_value ([http://lua-api.factorio.com/latest/Builtin-Types.html#int int], required) - Defines the default value of the setting.&lt;br /&gt;
** minimum_value (int, optional) - Defines the lowest possible number.&lt;br /&gt;
** maximum_value (int, optional) - Defines the highest possible number.&lt;br /&gt;
** allowed_values (array(int), optional) - Makes it possible to force the player to choose between the defined numbers, creates a dropdown instead of a texfield.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;double-setting&#039;&#039;&#039;:&lt;br /&gt;
** default_value ([http://lua-api.factorio.com/latest/Builtin-Types.html#double double], required) - Defines the default value of the setting.&lt;br /&gt;
** minimum_value (double, optional) - Defines the lowest possible number.&lt;br /&gt;
** maximum_value (double, optional) - Defines the highest possible number.&lt;br /&gt;
** allowed_values (array(double), optional) - Makes it possible to force the player to choose between the defined numbers, creates a dropdown instead of a textfield.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;string-setting&#039;&#039;&#039;:&lt;br /&gt;
** default_value (string, required) - Defines the default value of the setting.&lt;br /&gt;
** allow_blank (boolean, optional) - Defaults to false, defines whether it&#039;s possible for the user to set the textfield to empty and apply the setting.&lt;br /&gt;
** allowed_values (array(string), optional) - Makes it possible to force the player to choose between the defined strings, creates a dropdown instead of a textfield. The strings inside the array can be localized (translated), see below.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The order property ===&lt;br /&gt;
&lt;br /&gt;
The order property can be used to change how the mod settings are ordered in the settings gui. Mod settings are sorted&lt;br /&gt;
* first by mod&lt;br /&gt;
* then by the setting &amp;quot;order&amp;quot; string&lt;br /&gt;
* then finally by the setting name.&lt;br /&gt;
&lt;br /&gt;
For more info on how to use the order string, see [[Types/Order]].&lt;br /&gt;
&lt;br /&gt;
=== The hidden property ===&lt;br /&gt;
&lt;br /&gt;
The hidden property can be used to hide mod settings from GUIs, so that they cannot be seen or changed by players. However, other mods can still access hidden settings.[https://forums.factorio.com/83316]&lt;br /&gt;
&lt;br /&gt;
=== The setting_type property ===&lt;br /&gt;
[[File:Mod_settings_gui.png|right|300px|thumb|The mod settings gui. Can be reached from the main menu -&amp;gt; Options -&amp;gt; Mod settings.]]&lt;br /&gt;
There are the overall kinds of settings:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;startup&#039;&#039;&#039;: This kind of setting is available in the prototype stage, and can not be changed runtime. They have to be  set to the same values for all players on a server.&lt;br /&gt;
* &#039;&#039;&#039;runtime-global&#039;&#039;&#039;: This kind of setting is global to an entire save game and can be changed runtime. On servers, only admins can change these settings.&lt;br /&gt;
* &#039;&#039;&#039;runtime-per-user&#039;&#039;&#039;: This kind of setting is only available runtime in the control.lua stage and each player has their own instance of this setting. When a player joins a server their local setting of &amp;quot;keep mod settings per save&amp;quot; determines if the local settings they have set are synced to the loaded save or if the save&#039;s settings are used.&lt;br /&gt;
&lt;br /&gt;
This &amp;quot;setting_type&amp;quot; also determines in which tab the setting is showed in the mod settings menu.&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
The locale for mod settings works like any other locale in the game. The names of the groups for the setting name and description (tooltip) are &amp;quot;mod-setting-name&amp;quot; and &amp;quot;mod-setting-description&amp;quot;. The dropdown items of a string setting can be localized in the &amp;quot;string-mod-setting&amp;quot; group, but the game falls back to just showing the name of the dropdown item if no localization is found. An example for mod setting localization that would be set within &amp;quot;locale/en/locale.cfg&amp;quot;, is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[mod-setting-name]&lt;br /&gt;
my-mod-test-setting=Localized test setting name&lt;br /&gt;
&lt;br /&gt;
[mod-setting-description]&lt;br /&gt;
my-mod-test-setting=Localized test setting description&lt;br /&gt;
&lt;br /&gt;
[string-mod-setting]&lt;br /&gt;
#&amp;lt;setting-name&amp;gt;-&amp;lt;dropdown-item-name&amp;gt;=&amp;lt;translated item&amp;gt;&lt;br /&gt;
my-mod-string-test-setting-item-1=Item 1 localized string&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
=== Reading settings ===&lt;br /&gt;
When accessing any mod setting, you will have to specifically access the &#039;&#039;value&#039;&#039; of the setting. The data type of the value depends on the type of the setting. For string settings that use a selection of allowed values, the value of the setting is one of the original string values defined in the prototype, the localization is ignored. See also: [http://lua-api.factorio.com/latest/Concepts.html#ModSetting ModSetting concept].&lt;br /&gt;
&lt;br /&gt;
In the prototype stage you can access settings of the setting_type &amp;quot;startup&amp;quot; using the [http://lua-api.factorio.com/latest/LuaSettings.html settings table]. Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--in settings.lua:&lt;br /&gt;
data:extend({&lt;br /&gt;
    {&lt;br /&gt;
        type = &amp;quot;int-setting&amp;quot;,&lt;br /&gt;
        name = &amp;quot;my-mod-stone-wall-stack-size&amp;quot;,&lt;br /&gt;
        setting_type = &amp;quot;startup&amp;quot;,&lt;br /&gt;
        minimum_value = 1,&lt;br /&gt;
        default_value = 100&lt;br /&gt;
    }&lt;br /&gt;
})&lt;br /&gt;
&lt;br /&gt;
--in data.lua:&lt;br /&gt;
data.raw.item[&amp;quot;stone-wall&amp;quot;].stack_size = settings.startup[&amp;quot;my-mod-stone-wall-stack-size&amp;quot;].value&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;plainlinks&amp;quot;&amp;gt;&lt;br /&gt;
In the control stage, the settings of the setting_type &amp;quot;runtime-global&amp;quot; can be accessed using &amp;lt;code&amp;gt;settings.global[&amp;quot;setting-name&amp;quot;]&amp;lt;/code&amp;gt;. Settings of the setting_type &amp;quot;runtime-per-user&amp;quot; are accessed using &amp;lt;code&amp;gt;settings.get_player_settings([http://lua-api.factorio.com/latest/Concepts.html#PlayerSpecification &amp;amp;lt;PlayerSpecification&amp;amp;gt;])[&amp;quot;setting-name&amp;quot;]&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;game.players[[http://lua-api.factorio.com/latest/Concepts.html#PlayerSpecification &amp;amp;lt;PlayerSpecification&amp;amp;gt;]].mod_settings[&amp;quot;setting-name&amp;quot;]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--in settings.lua:&lt;br /&gt;
data:extend({&lt;br /&gt;
    {&lt;br /&gt;
        type = &amp;quot;string-setting&amp;quot;,&lt;br /&gt;
        name = &amp;quot;my-mod-always-difficult&amp;quot;,&lt;br /&gt;
        setting_type = &amp;quot;runtime-global&amp;quot;,&lt;br /&gt;
        default_value = &amp;quot;yes&amp;quot;,&lt;br /&gt;
        allowed_values = {&amp;quot;yes&amp;quot;, &amp;quot;no&amp;quot;}&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        type = &amp;quot;bool-setting&amp;quot;,&lt;br /&gt;
        name = &amp;quot;my-mod-kill-player-on-entity-built&amp;quot;,&lt;br /&gt;
        setting_type = &amp;quot;runtime-per-user&amp;quot;,&lt;br /&gt;
        default_value = false&lt;br /&gt;
    }&lt;br /&gt;
})&lt;br /&gt;
&lt;br /&gt;
--in control.lua:&lt;br /&gt;
script.on_init(function()&lt;br /&gt;
    if settings.global[&amp;quot;my-mod-always-difficult&amp;quot;].value == &amp;quot;yes&amp;quot; then&lt;br /&gt;
        game.difficulty_settings.recipe_difficulty = 1&lt;br /&gt;
        game.difficulty_settings.technology_difficulty = 1&lt;br /&gt;
        game.difficulty_settings.technology_price_multiplier = 4&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
script.on_event(defines.events.on_built_entity, function(event)&lt;br /&gt;
    local setting_value = settings.get_player_settings(event.player_index)[&amp;quot;my-mod-kill-player-on-entity-built&amp;quot;].value&lt;br /&gt;
    if setting_value then&lt;br /&gt;
        game.players[event.player_index].die()&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Writing to settings ===&lt;br /&gt;
It is possible for mods to write to their own runtime (global or per player) mod settings. This is done by writing a new [https://lua-api.factorio.com/latest/Concepts.html#ModSetting ModSetting] table to the setting.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--in settings.lua:&lt;br /&gt;
data:extend({&lt;br /&gt;
    {&lt;br /&gt;
        type = &amp;quot;bool-setting&amp;quot;,&lt;br /&gt;
        name = &amp;quot;my-mod-ever-crafted-item&amp;quot;,&lt;br /&gt;
        setting_type = &amp;quot;runtime-per-user&amp;quot;,&lt;br /&gt;
        default_value = false&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        type = &amp;quot;string-setting&amp;quot;,&lt;br /&gt;
        name = &amp;quot;my-mod-always-difficult&amp;quot;,&lt;br /&gt;
        setting_type = &amp;quot;runtime-global&amp;quot;,&lt;br /&gt;
        default_value = &amp;quot;yes&amp;quot;,&lt;br /&gt;
        allowed_values = {&amp;quot;yes&amp;quot;, &amp;quot;no&amp;quot;}&lt;br /&gt;
    }&lt;br /&gt;
})&lt;br /&gt;
&lt;br /&gt;
--in control.lua:&lt;br /&gt;
script.on_event(defines.events.on_player_crafted_item, function(event)&lt;br /&gt;
    settings.get_player_settings(event.player_index)[&amp;quot;my-mod-ever-crafted-item&amp;quot;] = {value = true}&lt;br /&gt;
    -- We just allowed ourselves to check whether the player ever crafted an item in other game saves.&lt;br /&gt;
    -- Note that this only works if the player does not mess with the setting, and if their &amp;quot;keep mod settings per save&amp;quot; setting is off.&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
script.on_event(on_rocket_launched, function()&lt;br /&gt;
    settings.global[&amp;quot;my-mod-always-difficult&amp;quot;] = {value = &amp;quot;yes&amp;quot;}&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
&lt;br /&gt;
* Do not conditionally &#039;require(...)&#039; things depending on mod settings: This breaks the CRC checks and people will get errors trying to use your mod in multiplayer. &#039;require(...)&#039; everything and then conditionally add the values to data.raw using the settings.&lt;br /&gt;
* You should cache the settings table inside the event you use it in. Accessing it is relatively expensive (about as expensive as accessing game.*prototypes[...]), so when accessing it mutliple times within the same event, you should set a local variable to it (within the event) to improve performance.&lt;br /&gt;
** If you want to cache startup/and runtime settings outside of events, you will have to makes sure that the local variable of settings of the setting_type &amp;quot;runtime-global&amp;quot; are updated in the &amp;lt;code&amp;gt;on_runtime_mod_setting_changed&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* If you want to detect whether a certain mod is installed in the settings stage, you can use &amp;lt;code&amp;gt;if mods[&amp;quot;another-mods-name&amp;quot;] then&amp;lt;/code&amp;gt;, just like in the data stage.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://forums.factorio.com/viewtopic.php?p=207275 Forum post documenting mod settings]&lt;br /&gt;
* [https://forums.factorio.com/viewtopic.php?p=305644#p305644 per_user is not a valid property and has no effects!]&lt;br /&gt;
* [http://lua-api.factorio.com/latest/LuaSettings.html Lua api documentation on the settings table]&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Data.raw&amp;diff=183469</id>
		<title>Talk:Data.raw</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Data.raw&amp;diff=183469"/>
		<updated>2020-11-24T13:22:22Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;nowiki&amp;gt;[[ linked-container ]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What is the [[ ]] here?&lt;br /&gt;
--[[User:Darkfrei|Darkfrei]] ([[User talk:Darkfrei|talk]]) 13:22, 24 November 2020 (UTC)&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Data.raw&amp;diff=183468</id>
		<title>Talk:Data.raw</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Data.raw&amp;diff=183468"/>
		<updated>2020-11-24T13:22:00Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[ linked-container ]]&lt;br /&gt;
&lt;br /&gt;
What is the [[ ]] here?&lt;br /&gt;
--[[User:Darkfrei|Darkfrei]] ([[User talk:Darkfrei|talk]]) 13:22, 24 November 2020 (UTC)&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Data.raw&amp;diff=183467</id>
		<title>Talk:Data.raw</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Data.raw&amp;diff=183467"/>
		<updated>2020-11-24T13:21:53Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[ linked-container ]]&lt;br /&gt;
&lt;br /&gt;
What is the [[ ]] here?&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Data.raw&amp;diff=183466</id>
		<title>Talk:Data.raw</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Data.raw&amp;diff=183466"/>
		<updated>2020-11-24T13:21:43Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: Created page with &amp;quot;linked-container  What is the   here?&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[linked-container]]&lt;br /&gt;
&lt;br /&gt;
What is the [[ ]] here?&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Tutorial:Mod_settings&amp;diff=182676</id>
		<title>Tutorial:Mod settings</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Tutorial:Mod_settings&amp;diff=182676"/>
		<updated>2020-09-26T13:40:52Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
This tutorial aims to explain how to create and use mod settings. Basic knowledge of modding is assumed, so you should have at least understood [[Tutorial:Modding tutorial/Gangsir|Gangsir&#039;s modding tutorial]].&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Each mod can specify settings that users can change. The values of these settings can be accessed from inside the data stage or the control stage depending on their [[#The_setting_type_property|setting_type]] and allow to conditionally create or modify prototypes and to add configuration options to control scripts. They were added in version 0.15 to allow modders to easily create a graphical interface for their configuration options, instead of relying on text files that had to be edited manually by the users.&lt;br /&gt;
&lt;br /&gt;
== Location ==&lt;br /&gt;
&lt;br /&gt;
Mod settings are defined in the [http://lua-api.factorio.com/latest/Data-Lifecycle.html settings stage]. This stage is loaded before the data stage. There are three files in which settings can be defined:&lt;br /&gt;
* settings.lua&lt;br /&gt;
* settings-updates.lua&lt;br /&gt;
* settings-final-fixes.lua&lt;br /&gt;
&lt;br /&gt;
First the settings.lua file is called for each mod, in the order of their dependencies and then in the [[:Wikipedia:natural sort order|natural sort order]]. After settings.lua has been called for all mods, the settings-updates.lua file is called for each mod &amp;lt;sup&amp;gt;(in the same order)&amp;lt;/sup&amp;gt; and finally the settings-final-fixes.lua file is called for each mod &amp;lt;sup&amp;gt;(in the same order)&amp;lt;/sup&amp;gt;. These 3 different phases of the settings stage allow to change settings of other mods without needing to rely on dependencies to load last. The settings are all defined in the same stage and their user defined values are not available, therefore mods cannot conditionally create settings depending on the values of other mod settings. Since the settings stage gets loaded first, there is also no prototype data or [http://lua-api.factorio.com/latest/LuaRemote.html remote interface] available.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;mod-settings.dat&amp;quot; file stored in the [[Application_directory#User_Data_directory|mods folder]] for the game contains the local players settings between game sessions similar to the player-data.json file.&lt;br /&gt;
&lt;br /&gt;
== Creation ==&lt;br /&gt;
&lt;br /&gt;
Mod settings are defined and modified by using the data table. This works [[Tutorial:Modding_tutorial/Gangsir#Prototype_creation|the same way as other prototypes]]. An example would be:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
data:extend({&lt;br /&gt;
    {&lt;br /&gt;
        type = &amp;quot;bool-setting&amp;quot;,&lt;br /&gt;
        name = &amp;quot;my-mod-test-setting&amp;quot;,&lt;br /&gt;
        setting_type = &amp;quot;runtime-global&amp;quot;,&lt;br /&gt;
        default_value = true&lt;br /&gt;
    }&lt;br /&gt;
})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, the setting has multiple properties. Each setting supports the following standard prototype properties:&lt;br /&gt;
* name ([http://lua-api.factorio.com/latest/Builtin-Types.html#string string], required)&lt;br /&gt;
* type (string, required)&lt;br /&gt;
* localised_name ([http://lua-api.factorio.com/latest/Concepts.html#LocalisedString localised string], optional)&lt;br /&gt;
* localised_description (localised string, optional)&lt;br /&gt;
* [[Types/Order|order]] (string, optional)&lt;br /&gt;
&lt;br /&gt;
In addition to the standard properties, mod settings also contain:&lt;br /&gt;
&lt;br /&gt;
* hidden ([[Types/bool|boolean]], optional)&lt;br /&gt;
* setting_type (string, required)&lt;br /&gt;
&lt;br /&gt;
=== The name property ===&lt;br /&gt;
&lt;br /&gt;
The name of the settings prototype should be unique to avoid mod conflicts since the mod settings are global across all mods. Because of that it is recommened to prefix mod settings with your mod name, &amp;quot;my-mod&amp;quot; in this example.&lt;br /&gt;
&lt;br /&gt;
=== The type property ===&lt;br /&gt;
&lt;br /&gt;
There are four types of mod settings:&lt;br /&gt;
&lt;br /&gt;
* bool-setting - a true/false checkbox&lt;br /&gt;
* int-setting - a signed 64 bit integer textfield (or selection dropdown)&lt;br /&gt;
* double-setting - a double precision floating point textfield (or selection dropdown)&lt;br /&gt;
* string-setting - a string textfield (or selection dropdown)&lt;br /&gt;
&lt;br /&gt;
Depending on the type, the prototype also allows or requires additional properties:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;factorio-list&amp;quot;&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;bool-setting&#039;&#039;&#039;:&lt;br /&gt;
** default_value ([http://lua-api.factorio.com/latest/Builtin-Types.html#boolean bool], required) - Defines the default value of the setting, in this case whether the checkbox is checked or not.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;int-setting&#039;&#039;&#039;:&lt;br /&gt;
** default_value ([http://lua-api.factorio.com/latest/Builtin-Types.html#int int], required) - Defines the default value of the setting.&lt;br /&gt;
** minimum_value (int, optional) - Defines the lowest possible number.&lt;br /&gt;
** maximum_value (int, optional) - Defines the highest possible number.&lt;br /&gt;
** allowed_values (array(int), optional) - Makes it possible to force the player to choose between the defined numbers, creates a dropdown instead of a texfield.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;double-setting&#039;&#039;&#039;:&lt;br /&gt;
** default_value ([http://lua-api.factorio.com/latest/Builtin-Types.html#double double], required) - Defines the default value of the setting.&lt;br /&gt;
** minimum_value (double, optional) - Defines the lowest possible number.&lt;br /&gt;
** maximum_value (double, optional) - Defines the highest possible number.&lt;br /&gt;
** allowed_values (array(double), optional) - Makes it possible to force the player to choose between the defined numbers, creates a dropdown instead of a textfield.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;string-setting&#039;&#039;&#039;:&lt;br /&gt;
** default_value (string, required) - Defines the default value of the setting.&lt;br /&gt;
** allow_blank (boolean, optional) - Defaults to false, defines whether it&#039;s possible for the user to set the textfield to empty and apply the setting.&lt;br /&gt;
** allowed_values (array(string), optional) - Makes it possible to force the player to choose between the defined strings, creates a dropdown instead of a textfield. The strings inside the array can be localized (translated), see below.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== The order property ===&lt;br /&gt;
&lt;br /&gt;
The order property can be used to change how the mod settings are ordered in the settings gui. Mod settings are sorted&lt;br /&gt;
* first by mod&lt;br /&gt;
* then by the setting &amp;quot;order&amp;quot; string&lt;br /&gt;
* then finally by the setting name.&lt;br /&gt;
&lt;br /&gt;
For more info on how to use the order string, see [[Types/Order]].&lt;br /&gt;
&lt;br /&gt;
=== The hidden property ===&lt;br /&gt;
&lt;br /&gt;
The hidden property can be used to hide mod settings from GUIs, so that they cannot be seen or changed by players. However, other mods can still access hidden settings.[https://forums.factorio.com/83316]&lt;br /&gt;
&lt;br /&gt;
=== The setting_type property ===&lt;br /&gt;
[[File:Mod_settings_gui.png|right|300px|thumb|The mod settings gui. Can be reached from the main menu -&amp;gt; Options -&amp;gt; Mod settings.]]&lt;br /&gt;
There are the overall kinds of settings:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;startup&#039;&#039;&#039;: This kind of setting is available in the prototype stage, and can not be changed runtime. They have to be  set to the same values for all players on a server.&lt;br /&gt;
* &#039;&#039;&#039;runtime-global&#039;&#039;&#039;: This kind of setting is global to an entire save game and can be changed runtime. On servers, only admins can change these settings.&lt;br /&gt;
* &#039;&#039;&#039;runtime-per-user&#039;&#039;&#039;: This kind of setting is only available runtime in the control.lua stage and each player has their own instance of this setting. When a player joins a server their local setting of &amp;quot;keep mod settings per save&amp;quot; determines if the local settings they have set are synced to the loaded save or if the save&#039;s settings are used.&lt;br /&gt;
&lt;br /&gt;
This &amp;quot;setting_type&amp;quot; also determines in which tab the setting is showed in the mod settings menu.&lt;br /&gt;
&lt;br /&gt;
=== Locale ===&lt;br /&gt;
The locale for mod settings works like any other locale in the game. The names of the groups for the setting name and description (tooltip) are &amp;quot;mod-setting-name&amp;quot; and &amp;quot;mod-setting-description&amp;quot;. The dropdown items of a string setting can be localized in the &amp;quot;string-mod-setting&amp;quot; group, but the game falls back to just showing the name of the dropdown item if no localization is found. An example for mod setting localization that would be set within &amp;quot;locale/en/locale.cfg&amp;quot;, is:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[mod-setting-name]&lt;br /&gt;
my-mod-test-setting=Localized test setting name&lt;br /&gt;
&lt;br /&gt;
[mod-setting-description]&lt;br /&gt;
my-mod-test-setting=Localized test setting description&lt;br /&gt;
&lt;br /&gt;
[string-mod-setting]&lt;br /&gt;
#&amp;lt;setting-name&amp;gt;-&amp;lt;dropdown-item-name&amp;gt;=&amp;lt;translated item&amp;gt;&lt;br /&gt;
my-mod-string-test-setting-item-1=Item 1 localized string&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Usage ==&lt;br /&gt;
=== Reading settings ===&lt;br /&gt;
When accessing any mod setting, you will have to specifically access the &#039;&#039;value&#039;&#039; of the setting. The data type of the value depends on the type of the setting. For string settings that use a selection of allowed values, the value of the setting is one of the original string values defined in the prototype, the localization is ignored. See also: [http://lua-api.factorio.com/latest/Concepts.html#ModSetting ModSetting concept].&lt;br /&gt;
&lt;br /&gt;
In the prototype stage you can access settings of the setting_type &amp;quot;startup&amp;quot; using the [http://lua-api.factorio.com/latest/LuaSettings.html settings table]. Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--in settings.lua:&lt;br /&gt;
data:extend({&lt;br /&gt;
    {&lt;br /&gt;
        type = &amp;quot;int-setting&amp;quot;,&lt;br /&gt;
        name = &amp;quot;my-mod-stone-wall-stack-size&amp;quot;,&lt;br /&gt;
        setting_type = &amp;quot;startup&amp;quot;,&lt;br /&gt;
        minimum_value = 1,&lt;br /&gt;
        default_value = 100&lt;br /&gt;
    }&lt;br /&gt;
})&lt;br /&gt;
&lt;br /&gt;
--in data.lua:&lt;br /&gt;
data.raw.item[&amp;quot;stone-wall&amp;quot;].stack_size = settings.startup[&amp;quot;my-mod-stone-wall-stack-size&amp;quot;].value&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Variable [[Types/CollisionMask|collision layer]] for mod compatibility:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--	in settings.lua&lt;br /&gt;
data:extend({&lt;br /&gt;
	{&lt;br /&gt;
		type = &amp;quot;string-setting&amp;quot;,&lt;br /&gt;
		name = &amp;quot;mymod-collision-layer&amp;quot;,&lt;br /&gt;
		setting_type = &amp;quot;startup&amp;quot;,&lt;br /&gt;
		default_value = &amp;quot;layer-11&amp;quot;,&lt;br /&gt;
		allowed_values = {&amp;quot;layer-11&amp;quot;, &amp;quot;layer-12&amp;quot;, &amp;quot;layer-13&amp;quot;, &amp;quot;layer-14&amp;quot;, &amp;quot;layer-15&amp;quot;}&lt;br /&gt;
	}&lt;br /&gt;
})&lt;br /&gt;
&lt;br /&gt;
--	in data.lua&lt;br /&gt;
local collision_layer = settings.startup[&amp;quot;mymod-collision-layer&amp;quot;].value&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;plainlinks&amp;quot;&amp;gt;&lt;br /&gt;
In the control stage, the settings of the setting_type &amp;quot;runtime-global&amp;quot; can be accessed using &amp;lt;code&amp;gt;settings.global[&amp;quot;setting-name&amp;quot;]&amp;lt;/code&amp;gt;. Settings of the setting_type &amp;quot;runtime-per-user&amp;quot; are accessed using &amp;lt;code&amp;gt;settings.get_player_settings(game.get_player([http://lua-api.factorio.com/latest/Concepts.html#PlayerSpecification &amp;amp;lt;PlayerSpecification&amp;amp;gt;]))[&amp;quot;setting-name&amp;quot;]&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;game.players[[http://lua-api.factorio.com/latest/Concepts.html#PlayerSpecification &amp;amp;lt;PlayerSpecification&amp;amp;gt;]].mod_settings[&amp;quot;setting-name&amp;quot;]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--in settings.lua:&lt;br /&gt;
data:extend({&lt;br /&gt;
    {&lt;br /&gt;
        type = &amp;quot;string-setting&amp;quot;,&lt;br /&gt;
        name = &amp;quot;my-mod-always-difficult&amp;quot;,&lt;br /&gt;
        setting_type = &amp;quot;runtime-global&amp;quot;,&lt;br /&gt;
        default_value = &amp;quot;yes&amp;quot;,&lt;br /&gt;
        allowed_values = {&amp;quot;yes&amp;quot;, &amp;quot;no&amp;quot;}&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        type = &amp;quot;bool-setting&amp;quot;,&lt;br /&gt;
        name = &amp;quot;my-mod-kill-player-on-entity-built&amp;quot;,&lt;br /&gt;
        setting_type = &amp;quot;runtime-per-user&amp;quot;,&lt;br /&gt;
        default_value = false&lt;br /&gt;
    }&lt;br /&gt;
})&lt;br /&gt;
&lt;br /&gt;
--in control.lua:&lt;br /&gt;
script.on_init(function()&lt;br /&gt;
    if settings.global[&amp;quot;my-mod-always-difficult&amp;quot;].value == &amp;quot;yes&amp;quot; then&lt;br /&gt;
        game.difficulty_settings.recipe_difficulty = 1&lt;br /&gt;
        game.difficulty_settings.technology_difficulty = 1&lt;br /&gt;
        game.difficulty_settings.technology_price_multiplier = 4&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
script.on_event(defines.events.on_built_entity, function(event)&lt;br /&gt;
    local setting_value = settings.get_player_settings(game.get_player(event.player_index))[&amp;quot;my-mod-kill-player-on-entity-built&amp;quot;].value&lt;br /&gt;
    if setting_value then&lt;br /&gt;
        game.players[event.player_index].die()&lt;br /&gt;
    end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Writing to settings ===&lt;br /&gt;
It is possible for mods to write to their own runtime (global or per player) mod settings. This is done by writing a new [https://lua-api.factorio.com/latest/Concepts.html#ModSetting ModSetting] table to the setting.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--in settings.lua:&lt;br /&gt;
data:extend({&lt;br /&gt;
    {&lt;br /&gt;
        type = &amp;quot;bool-setting&amp;quot;,&lt;br /&gt;
        name = &amp;quot;my-mod-ever-crafted-item&amp;quot;,&lt;br /&gt;
        setting_type = &amp;quot;runtime-per-user&amp;quot;,&lt;br /&gt;
        default_value = false&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        type = &amp;quot;string-setting&amp;quot;,&lt;br /&gt;
        name = &amp;quot;my-mod-always-difficult&amp;quot;,&lt;br /&gt;
        setting_type = &amp;quot;runtime-global&amp;quot;,&lt;br /&gt;
        default_value = &amp;quot;yes&amp;quot;,&lt;br /&gt;
        allowed_values = {&amp;quot;yes&amp;quot;, &amp;quot;no&amp;quot;}&lt;br /&gt;
    }&lt;br /&gt;
})&lt;br /&gt;
&lt;br /&gt;
--in control.lua:&lt;br /&gt;
script.on_event(defines.events.on_player_crafted_item, function(event)&lt;br /&gt;
    settings.get_player_settings(game.get_player(event.player_index))[&amp;quot;my-mod-ever-crafted-item&amp;quot;] = {value = true}&lt;br /&gt;
    -- We just allowed ourselves to check whether the player ever crafted an item in other game saves.&lt;br /&gt;
    -- Note that this only works if the player does not mess with the setting, and if their &amp;quot;keep mod settings per save&amp;quot; setting is off.&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
script.on_event(on_rocket_launched, function()&lt;br /&gt;
    settings.global[&amp;quot;my-mod-always-difficult&amp;quot;] = {value = &amp;quot;yes&amp;quot;}&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tips ===&lt;br /&gt;
&lt;br /&gt;
* Do not conditionally &#039;require(...)&#039; things depending on mod settings: This breaks the CRC checks and people will get errors trying to use your mod in multiplayer. &#039;require(...)&#039; everything and then conditionally add the values to data.raw using the settings.&lt;br /&gt;
* You should cache the settings table inside the event you use it in. Accessing it is relatively expensive (about as expensive as accessing game.*prototypes[...]), so when accessing it mutliple times within the same event, you should set a local variable to it (within the event) to improve performance.&lt;br /&gt;
** If you want to cache startup/and runtime settings outside of events, you will have to makes sure that the local variable of settings of the setting_type &amp;quot;runtime-global&amp;quot; are updated in the &amp;lt;code&amp;gt;on_runtime_mod_setting_changed&amp;lt;/code&amp;gt; event.&lt;br /&gt;
* If you want to detect whether a certain mod is installed in the settings stage, you can use &amp;lt;code&amp;gt;if mods[&amp;quot;another-mods-name&amp;quot;] then&amp;lt;/code&amp;gt;, just like in the data stage.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [https://forums.factorio.com/viewtopic.php?p=207275 Forum post documenting mod settings]&lt;br /&gt;
* [https://forums.factorio.com/viewtopic.php?p=305644#p305644 per_user is not a valid property and has no effects!]&lt;br /&gt;
* [http://lua-api.factorio.com/latest/LuaSettings.html Lua api documentation on the settings table]&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Types/FluidProductPrototype&amp;diff=182565</id>
		<title>Types/FluidProductPrototype</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Types/FluidProductPrototype&amp;diff=182565"/>
		<updated>2020-09-21T15:36:29Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* amount */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A fluid product definition for a [[Prototype/Recipe]]. Its loading is triggered by the &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; of a [[Types/ProductPrototype]] being &amp;quot;fluid&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Mandatory properties ==&lt;br /&gt;
&lt;br /&gt;
=== name ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/string]]&lt;br /&gt;
&lt;br /&gt;
The name of a [[Prototype/Fluid]].&lt;br /&gt;
&lt;br /&gt;
== Optional properties ==&lt;br /&gt;
&lt;br /&gt;
=== probability ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 1&lt;br /&gt;
&lt;br /&gt;
Value between 0 and 1, 0 for 0% chance and 1 for 100% chance.&lt;br /&gt;
&lt;br /&gt;
=== amount ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
Cannot be &amp;lt; 0.&lt;br /&gt;
&lt;br /&gt;
=== amount_min ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/MaterialAmountType]]&lt;br /&gt;
&lt;br /&gt;
Mandatory if &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt; is not specified.&lt;br /&gt;
&lt;br /&gt;
May not be &amp;lt; 0.&lt;br /&gt;
&lt;br /&gt;
=== amount_max ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/MaterialAmountType]]&lt;br /&gt;
&lt;br /&gt;
Mandatory if &amp;lt;code&amp;gt;amount&amp;lt;/code&amp;gt; is not specified.&lt;br /&gt;
&lt;br /&gt;
If set to a number that is less than &amp;lt;code&amp;gt;amount_min&amp;lt;/code&amp;gt;, the game will use &amp;lt;code&amp;gt;amount_min&amp;lt;/code&amp;gt; internally.&lt;br /&gt;
&lt;br /&gt;
=== temperature ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
Sets the temperature of the fluid product.&lt;br /&gt;
&lt;br /&gt;
=== catalyst_amount ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 0&lt;br /&gt;
&lt;br /&gt;
Amount that should not be affected by productivity modules (not yielded from bonus production) and should not be included in the fluid production statistics.&lt;br /&gt;
&lt;br /&gt;
=== fluidbox_index ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/uint32]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 0 (no specific fluidbox)&lt;br /&gt;
&lt;br /&gt;
Used to specify which fluidbox this product should use on the machine. It will only use this one fluidbox.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Types/ProductPrototype]]&lt;br /&gt;
* [[Types/ItemProductPrototype]]&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Prototype/Recipe&amp;diff=182564</id>
		<title>Prototype/Recipe</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Prototype/Recipe&amp;diff=182564"/>
		<updated>2020-09-21T15:34:41Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Prototype parent|PrototypeBase}}&lt;br /&gt;
A recipe. It can be a crafting recipe, a smelting recipe, or a custom type of recipe (see [[Prototype/RecipeCategory]]).&lt;br /&gt;
&lt;br /&gt;
{{Prototype TOC|recipe}}&lt;br /&gt;
&lt;br /&gt;
== General properties ==&lt;br /&gt;
Inherits all properties from [[PrototypeBase]].&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|category|[[Types/string|string]]|&amp;quot;crafting&amp;quot;|optional=true}}&lt;br /&gt;
Optional. The category of this recipe. The built-in categories can be found [[Data.raw#recipe-category|here]]. See also [[Prototype/RecipeCategory]].&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|subgroup|[[Types/string|string]]||optional=true}}&lt;br /&gt;
Optional. The subgroup of this recipe. If not specified, defaults to the subgroup of the product if there is only 1, or main_product if multiple products exist. If multiple products exist and no main_product is specified, the subgroup is required.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|icons, icon,  icon_size (IconSpecification)|[[Types/IconSpecification|IconSpecification]]|optional=true}}&lt;br /&gt;
An icon is mandatory for recipe with more than 1 product and no main_product. Otherwise defaults to the icon of main_product/1 product.&lt;br /&gt;
&lt;br /&gt;
If given, it overwrites the icon of the main_product/1 product.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|crafting_machine_tint|[[Types/table|table]] of [[Types/Color|Color]]|optional=true}}&lt;br /&gt;
Optional. Used by crafting machine &amp;lt;code&amp;gt;[[Prototype/CraftingMachine#working_visualisations|working_visualisations]]&amp;lt;/code&amp;gt; to tint certain layers with the recipe color. [[Types/WorkingVisualisation#apply_recipe_tint|apply_recipe_tint]] on the working visualisation determines which of the 4 colors is used for that layer (if any).&lt;br /&gt;
&lt;br /&gt;
Format:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;crafting_machine_tint = { primary = {r=0,g=0,b=0,a=0}, secondary = {r=0,g=0,b=0,a=0}, tertiary = {r=0,g=0,b=0,a=0}, quaternary = {r=0,g=0,b=0,a=0}}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each key/value pair is optional and defaults to the above value.&lt;br /&gt;
&lt;br /&gt;
== Recipe data ==&lt;br /&gt;
&amp;lt;!-- &lt;br /&gt;
Anchor and property for the TOC at the top --&amp;gt;&amp;lt;span id=&amp;quot;normal&amp;quot;&amp;gt;{{#subobject:normal&lt;br /&gt;
 |Prototype property name=normal&lt;br /&gt;
 |Prototype property type=[[Prototype/Recipe#Recipe_data|Recipe data]] or [[Types/bool|bool]]&lt;br /&gt;
 |Prototype property optional=true&lt;br /&gt;
 |Prototype property pagename={{FULLPAGENAME}}&lt;br /&gt;
}}&amp;lt;/span&amp;gt;&amp;lt;!-- &lt;br /&gt;
Anchor and property for the TOC at the top --&amp;gt;&amp;lt;span id=&amp;quot;expensive&amp;quot;&amp;gt;{{#subobject:expensive&lt;br /&gt;
 |Prototype property name=expensive&lt;br /&gt;
 |Prototype property type=[[Prototype/Recipe#Recipe_data|Recipe data]] or [[Types/bool|bool]]&lt;br /&gt;
 |Prototype property optional=true&lt;br /&gt;
 |Prototype property pagename={{FULLPAGENAME}}&lt;br /&gt;
}}&amp;lt;/span&amp;gt;&amp;lt;!-- &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
If the recipe does not have a difficulty, this is located directly in the prototype. Otherwise, if the &amp;quot;&#039;&#039;&#039;normal&#039;&#039;&#039;&amp;quot; or &amp;quot;&#039;&#039;&#039;expensive&#039;&#039;&#039;&amp;quot; property exists, the recipe has difficulty. Then, the recipe data has to be specified for each difficulty instead of directly in the prototype. If at least one difficulty has recipe data defined, the other difficulty can be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;. This will disable the recipe for the difficulty, same as setting it &amp;lt;code&amp;gt;enabled = false&amp;lt;/code&amp;gt;. If it is enabled (by technologies etc), it will use the data from the other difficulty. Not setting a difficulty, e.g. &amp;lt;code&amp;gt;normal = nil&amp;lt;/code&amp;gt;, is possible and gives that difficulty the exact same properties as the difficulty that is defined. See below for examples.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|ingredients|[[Types/table|table]] of [[Types/IngredientPrototype|IngredientPrototype]]}}&lt;br /&gt;
A table containing ingredient names and counts. Can also contain information about fluid temperature and catalyst amounts.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
ingredients = {{&amp;quot;iron-stick&amp;quot;, 2}, {&amp;quot;iron-plate&amp;quot;, 3}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The same with full format:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
ingredients = {{type = &amp;quot;item&amp;quot;, name = &amp;quot;iron-stick&amp;quot;, amount = 2}, {type = &amp;quot;item&amp;quot;, name = &amp;quot;iron-plate&amp;quot;, amount = 3}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For fluids, the full format always has to be used:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
ingredients = {{type=&amp;quot;fluid&amp;quot;, name=&amp;quot;water&amp;quot;, amount=50}, {type=&amp;quot;fluid&amp;quot;, name=&amp;quot;crude-oil&amp;quot;, amount=100}}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Maximal ingredient amount is 65535. The catalyst amounts are automatically calculated from the recipe, or can be set manually.[https://factorio.com/blog/post/fff-256]&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|result|[[Types/string|string]]|optional=true}}&lt;br /&gt;
Can be replaced with the results parameter. The item created by this recipe. Must be the name of an item, such as &amp;quot;iron-gear-wheel&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|result_count|[[Types/uint32|uint32]]|1|optional=true}}&lt;br /&gt;
Optional. The number of items created by this recipe.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|results|[[Types/table|table]] of [[Types/ProductPrototype|ProductPrototype]]|optional=true}}&lt;br /&gt;
A table containing result names and counts. Can also contain information about fluid temperature and catalyst amounts. The catalyst amounts are automatically calculated from the recipe, or can be set manually.[https://factorio.com/blog/post/fff-256]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
results=&lt;br /&gt;
    {&lt;br /&gt;
      {type=&amp;quot;fluid&amp;quot;, name=&amp;quot;heavy-oil&amp;quot;, amount=3},&lt;br /&gt;
      {type=&amp;quot;fluid&amp;quot;, name=&amp;quot;light-oil&amp;quot;, amount=3},&lt;br /&gt;
      {type=&amp;quot;fluid&amp;quot;, name=&amp;quot;petroleum-gas&amp;quot;, amount=4}&lt;br /&gt;
    },&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
results = &lt;br /&gt;
    {&lt;br /&gt;
      {type = &amp;quot;item&amp;quot;, name = &amp;quot;iron-nuggets&amp;quot;, amount = 9},&lt;br /&gt;
      {type = &amp;quot;item&amp;quot;, name = &amp;quot;gold-nuggets&amp;quot;, amount = 1}&lt;br /&gt;
     },&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
results = &lt;br /&gt;
    {&lt;br /&gt;
      {type = &amp;quot;fluid&amp;quot;, name = &amp;quot;steam&amp;quot;, amount = 1, temperature = 165}&lt;br /&gt;
     },&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|energy_required|[[Types/double|double]]|0.5|optional=true}}&lt;br /&gt;
Optional. The amount of time it takes to make this recipe.&lt;br /&gt;
&lt;br /&gt;
This is the number of seconds it takes to craft at crafting speed 1.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|emissions_multiplier|[[Types/double|double]]|1.0|optional=true}}&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|requester_paste_multiplier|[[Types/uint32|uint32]]|30|optional=true}}&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|overload_multiplier|[[Types/uint32|uint32]]|0|optional=true}}&lt;br /&gt;
Used to determine how many extra items are put into an assembling machine before it&#039;s considered &amp;quot;full enough&amp;quot;. See [[Inserters#Insertion_limits]].&lt;br /&gt;
&lt;br /&gt;
If set to 0, it instead uses the following formula: 1.166 / (energy_required / the assembler&#039;s crafting_speed), rounded up, and clamped between 2 and 100.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|enabled|[[Types/bool|bool]]|true|optional=true}}&lt;br /&gt;
Optional. This can be false to disable the recipe at the start of the game, or &amp;quot;true&amp;quot; to leave it enabled.&lt;br /&gt;
&lt;br /&gt;
If your recipe is unlocked by a technology, you should set this to &amp;quot;false&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|hidden|[[Types/bool|bool]]|false|optional=true}}&lt;br /&gt;
Optional. Hides the recipe from crafting menus.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|hide_from_stats|[[Types/bool|bool]]|false|optional=true}}&lt;br /&gt;
Optional. Hides the recipe from flow stats (item/fluid production statistics).&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|hide_from_player_crafting|[[Types/bool|bool]]|false|optional=true}}&lt;br /&gt;
Optional. Hides the recipe from the player&#039;s crafting screen. The recipe will still show up for selection in machines.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|allow_decomposition|[[Types/bool|bool]]|true|optional=true}}&lt;br /&gt;
Optional. Whether this recipe is allowed to be broken down for the recipe tooltip &amp;quot;Total raw&amp;quot; calculations.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|allow_as_intermediate|[[Types/bool|bool]]|true|optional=true}}&lt;br /&gt;
Optional. Whether the recipe can be used as an intermediate recipe in hand-crafting.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|allow_intermediates|[[Types/bool|bool]]|true|optional=true}}&lt;br /&gt;
Optional. Whether the recipe is allowed to use intermediate recipes when hand-crafting.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|always_show_made_in|[[Types/bool|bool]]|false|optional=true}}&lt;br /&gt;
Optional. Whether the &amp;quot;Made in: {Machine}&amp;quot; part of the tool-tip should always be present, not only when the recipe can not be hand-crafted.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|show_amount_in_title|[[Types/bool|bool]]|true|optional=true}}&lt;br /&gt;
Optional. Whether the recipe name should have the product amount in front of it, e.g. &amp;quot;2 [[transport belt]]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|always_show_products|[[Types/bool|bool]]|false|optional=true}}&lt;br /&gt;
Optional. Whether the products are always shown in the recipe tool-tip.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|unlock_results|[[Types/bool|bool]]|true|optional=true}}&lt;br /&gt;
Optional. Whether enabling this recipe unlocks its item products to show in selection lists (item filter, logistic request etc.).&lt;br /&gt;
&lt;br /&gt;
{{Prototype property|main_product|[[Types/string|string]]|optional=true}}&lt;br /&gt;
Optional.&lt;br /&gt;
&lt;br /&gt;
For recipes with more than one product: This defines of which result the icon, subgroup and name is used. If it is not set and the recipe has more than 1 result the recipe will use the recipe-name and recipe-description locale and its own subgroup and icon.&lt;br /&gt;
&lt;br /&gt;
For recipes with 1 result: The recipe uses the icon, subgroup and name of the result by default. If set this property is set to an empty string, the recipe will use the properties of the recipe instead of the result.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;iron-plate&amp;quot; ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
  {&lt;br /&gt;
    type = &amp;quot;recipe&amp;quot;,&lt;br /&gt;
    name = &amp;quot;iron-plate&amp;quot;,&lt;br /&gt;
    category = &amp;quot;smelting&amp;quot;,&lt;br /&gt;
    energy_required = 3.5,&lt;br /&gt;
    ingredients = {{&amp;quot;iron-ore&amp;quot;, 1}},&lt;br /&gt;
    result = &amp;quot;iron-plate&amp;quot;&lt;br /&gt;
  }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;coal-liquefaction&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;{&lt;br /&gt;
  type = &amp;quot;recipe&amp;quot;,&lt;br /&gt;
  name = &amp;quot;coal-liquefaction&amp;quot;,&lt;br /&gt;
  category = &amp;quot;oil-processing&amp;quot;,&lt;br /&gt;
  subgroup = &amp;quot;fluid-recipes&amp;quot;,&lt;br /&gt;
  order = &amp;quot;a[oil-processing]-c[coal-liquefaction]&amp;quot;,&lt;br /&gt;
  enabled = false,&lt;br /&gt;
  energy_required = 5,&lt;br /&gt;
  icon = &amp;quot;__base__/graphics/icons/fluid/coal-liquefaction.png&amp;quot;,&lt;br /&gt;
  icon_size = 32,&lt;br /&gt;
  ingredients =&lt;br /&gt;
  {&lt;br /&gt;
    {type=&amp;quot;item&amp;quot;, name=&amp;quot;coal&amp;quot;, amount=10},&lt;br /&gt;
    {type=&amp;quot;fluid&amp;quot;, name=&amp;quot;heavy-oil&amp;quot;, amount=25},&lt;br /&gt;
    {type=&amp;quot;fluid&amp;quot;, name=&amp;quot;steam&amp;quot;, amount=50}&lt;br /&gt;
  },&lt;br /&gt;
  results=&lt;br /&gt;
  {&lt;br /&gt;
    {type=&amp;quot;fluid&amp;quot;, name=&amp;quot;heavy-oil&amp;quot;, amount=35},&lt;br /&gt;
    {type=&amp;quot;fluid&amp;quot;, name=&amp;quot;light-oil&amp;quot;, amount=15},&lt;br /&gt;
    {type=&amp;quot;fluid&amp;quot;, name=&amp;quot;petroleum-gas&amp;quot;, amount=20}&lt;br /&gt;
  },&lt;br /&gt;
  allow_decomposition = false&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;iron-gear-wheel&amp;quot; — recipe with difficulty ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;  {&lt;br /&gt;
    type = &amp;quot;recipe&amp;quot;,&lt;br /&gt;
    name = &amp;quot;iron-gear-wheel&amp;quot;,&lt;br /&gt;
    normal =&lt;br /&gt;
    {&lt;br /&gt;
      ingredients = {{&amp;quot;iron-plate&amp;quot;, 2}},&lt;br /&gt;
      result = &amp;quot;iron-gear-wheel&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    expensive =&lt;br /&gt;
    {&lt;br /&gt;
      ingredients = {{&amp;quot;iron-plate&amp;quot;, 4}},&lt;br /&gt;
      result = &amp;quot;iron-gear-wheel&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modified so that it cannot be crafted in normal mode, unless unlocked via command/research ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;  {&lt;br /&gt;
    type = &amp;quot;recipe&amp;quot;,&lt;br /&gt;
    name = &amp;quot;iron-gear-wheel&amp;quot;,&lt;br /&gt;
    normal = false,&lt;br /&gt;
    expensive =&lt;br /&gt;
    {&lt;br /&gt;
      ingredients = {{&amp;quot;iron-plate&amp;quot;, 4}},&lt;br /&gt;
      result = &amp;quot;iron-gear-wheel&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  },&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Modified so that the expensive recipe is always used, even in normal mode ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;  {&lt;br /&gt;
    type = &amp;quot;recipe&amp;quot;,&lt;br /&gt;
    name = &amp;quot;iron-gear-wheel&amp;quot;,&lt;br /&gt;
    normal = nil, --this line can be omitted&lt;br /&gt;
    expensive =&lt;br /&gt;
    {&lt;br /&gt;
      ingredients = {{&amp;quot;iron-plate&amp;quot;, 4}},&lt;br /&gt;
      result = &amp;quot;iron-gear-wheel&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  },&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Prototype/Item&amp;diff=182372</id>
		<title>Talk:Prototype/Item</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Prototype/Item&amp;diff=182372"/>
		<updated>2020-09-13T16:49:53Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: Created page with &amp;quot;wire_count, what is it? --~~~~&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;wire_count, what is it? --[[User:Darkfrei|Darkfrei]] ([[User talk:Darkfrei|talk]]) 16:49, 13 September 2020 (UTC)&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Types/Energy&amp;diff=181464</id>
		<title>Talk:Types/Energy</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Types/Energy&amp;diff=181464"/>
		<updated>2020-08-15T11:31:02Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: Created page with &amp;quot;But input_flow_limit = &amp;quot;300W&amp;quot; is power, not energy! ~~~~&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;But input_flow_limit = &amp;quot;300W&amp;quot; is power, not energy! [[User:Darkfrei|Darkfrei]] ([[User talk:Darkfrei|talk]]) 11:31, 15 August 2020 (UTC)&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=179965</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=179965"/>
		<updated>2020-05-27T11:57:27Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Reset your force */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
The &#039;&#039;&#039;console&#039;&#039;&#039; is Factorio&#039;s in-game command-line interface. See [[command line parameters]] for the command line interface of the Factorio executable.&lt;br /&gt;
&lt;br /&gt;
The in-game console can be used for:&lt;br /&gt;
&lt;br /&gt;
* Chatting with other players&lt;br /&gt;
* Occasional status updates&lt;br /&gt;
* Running commands / scripts / cheats&lt;br /&gt;
&lt;br /&gt;
There are three types of commands:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[#Normal commands|Normal]]&#039;&#039;&#039; - Display information about the game and customize your experience.&lt;br /&gt;
* &#039;&#039;&#039;[[#Multiplayer commands|Multiplayer]]&#039;&#039;&#039; - Message filtering, banning users, etc.&lt;br /&gt;
* &#039;&#039;&#039;[[#Scripting and cheat commands|Scripting/Cheating]]&#039;&#039;&#039; - Run small Lua scripts (but they &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;disable achievements for the save game&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Using the console ===&lt;br /&gt;
The console display can be toggled with the {{keybinding|/}} (slash) or {{keybinding|~}} (tilde) keys.&lt;br /&gt;
&lt;br /&gt;
You can customize the keys via &#039;&#039;&#039;Options Menu → Keyboard → Toggle Lua console&#039;&#039;&#039;.&lt;br /&gt;
When the console is open, you&#039;ll see a blinking cursor at the bottom of the screen; type your message or command and hit &#039;&#039;&#039;Return&#039;&#039;&#039; to send it (this will also close the console).&lt;br /&gt;
Documentation about message and command prefixes can be found further down this page.&lt;br /&gt;
&lt;br /&gt;
The console supports [[rich text]] tags. These tags are useful for sharing blueprints, marking map locations in chat or adding icons to map markers and train stations. Ctrl + Alt-clicking the map or ground will automatically insert a GPS tag and post it into the console. Shift-clicking most things with the console open will insert a tag for that thing into the console.&lt;br /&gt;
&lt;br /&gt;
When the console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages).&lt;br /&gt;
Note that by default, all executed commands are made visible to all users. You can set the fade-out time via &#039;&#039;&#039;Options Menu → Other Settings → Message Delay&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you want to immediately hide the console, open the console and then press &#039;&#039;&#039;Escape&#039;&#039;&#039; key (or press &#039;&#039;&#039;Return&#039;&#039;&#039; without entering any message/command).&lt;br /&gt;
This not only closes the console, but it also hides all the recent messages/commands.&lt;br /&gt;
The console can be cleared with the &#039;&#039;&#039;/clear&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;uarr;}} and {{keybinding|&amp;amp;darr;}} keys to scroll through the console history. The {{keybinding|Tab}} key will auto-complete commands and player names.&lt;br /&gt;
&lt;br /&gt;
== Normal commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| /alerts &amp;lt;enable/disable/mute/unmute&amp;gt; &amp;lt;alert&amp;gt;&lt;br /&gt;
| /alerts disable turret_fire&lt;br /&gt;
| Enables, disables, mutes, or unmutes the given  [[alerts|alert]] type. Available alerts: entity_destroyed, entity_under_attack, not_enough_construction_robots, no_material_for_construction, not_enough_repair packs, turret_fire, custom, no_storage, train_out_of_fuel, fluid_mixing.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /clear&lt;br /&gt;
| /clear&lt;br /&gt;
| Clears the console.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /color &amp;lt;color&amp;gt;&lt;br /&gt;
| /color 20 255 255 100&lt;br /&gt;
| Changes your color. Can either be one of the pre-defined colors or [[:Wikipedia:RGBA_color_space|RGBA value]] in the format of “# # # #”. Available colors: default, red, green, blue, orange, yellow, pink, purple, white, black, gray, brown, cyan, acid.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /evolution&lt;br /&gt;
| /evolution&lt;br /&gt;
| Prints info about the alien evolution factor.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /help [command]&lt;br /&gt;
| /help&lt;br /&gt;
| Prints a list of available commands, the optional argument can specify the command that should be described.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /h [command]&lt;br /&gt;
| /h&lt;br /&gt;
| Same as /help.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /mute-programmable-speaker &amp;lt;mute/unmute&amp;gt; &amp;lt;local/everyone&amp;gt;&lt;br /&gt;
| /mute-programmable-speaker mute local&lt;br /&gt;
| Mutes or unmutes the global sounds created by the Programmable Speaker. Use “local” to mute just the local client. Admins can use “everyone” to mute the sounds for everyone on the server.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /perf-avg-frames &amp;lt;number&amp;gt;&lt;br /&gt;
| /perf-avg-frames 100&lt;br /&gt;
| Number of ticks/updates used to average performance counters. Default is 100. Value of 5-10 is recommended for fast convergence, but numbers will jitter more rapidly.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /permissions&lt;br /&gt;
| /permissions&lt;br /&gt;
| Opens the permissions GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /screenshot [x resolution] [y resolution] [zoom]&lt;br /&gt;
| /screenshot&lt;br /&gt;
| Takes a screenshot with the GUI hidden, centered on the player. It is saved in the &amp;quot;script-output&amp;quot; subfolder of your [[User data directory]].  Resolution is optional and defaults to the current window size. Zoom is optional and defaults to 1.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /seed&lt;br /&gt;
| /seed&lt;br /&gt;
| Prints the starting map seed.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /time&lt;br /&gt;
| /time&lt;br /&gt;
| Prints info about how old the map is.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| Toggles logging all input actions performed by the game. This value isn’t persisted between game restarts and only affects your local game in multiplayer sessions.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| Used to investigate [[Desynchronization#Using_heavy_mode_command|desyncs]]. Will slow down the game and make multiplayer unplayable.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| Toggles if the rockets sent button is shown in the upper left corner of the screen.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unlock-shortcut-bar&lt;br /&gt;
| /unlock-shortcut-bar&lt;br /&gt;
| Unlocks all shortcut bar items.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /version&lt;br /&gt;
| /version&lt;br /&gt;
| Prints the current game version.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Multiplayer commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;message&amp;gt;&lt;br /&gt;
| Hello team!&lt;br /&gt;
| Console input that does not start with {{keybinding|/}} is shown as a chat message to your team.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /admin&lt;br /&gt;
| /admin&lt;br /&gt;
| Opens the player management GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /admins&lt;br /&gt;
| /admins&lt;br /&gt;
| Prints a list of game admins.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ban &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /ban xTROLLx Throwing grenades in base&lt;br /&gt;
| Bans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /banlist &amp;lt;add/remove/get/clear&amp;gt; &amp;lt;player&amp;gt;&lt;br /&gt;
| /banlist get&lt;br /&gt;
| Adds or removes a player from the banlist. Same as /ban or /unban.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /config &amp;lt;get/set&amp;gt; &amp;lt;option&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
| /config set password hunter2&lt;br /&gt;
| Gets or sets various multiplayer game settings. Available configs are: afk-auto-kick, allow-commands, allow-debug-settings, autosave-interval, autosave-only-on-server, ignore-player-limit-for-returning-players, max-players, max-upload-speed, only-admins-can-pause, password, require-user-verification, visibility-lan, visibility-public.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /delete-blueprint-library &amp;lt;player&amp;gt;&lt;br /&gt;
| /delete-blueprint-library everybody confirm&lt;br /&gt;
| Deletes the blueprint library storage for the given offline player from the save file. Enter “everybody confirm” to delete the storage of all offline players.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /demote &amp;lt;player&amp;gt;&lt;br /&gt;
| /demote AzureDiamond&lt;br /&gt;
| Demotes the player from admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /ignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /ignore Cthon98&lt;br /&gt;
| Prevents the chat from showing messages from this player. Admin messages are still shown.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ignores&lt;br /&gt;
| /ignores&lt;br /&gt;
| Prints a list of ignored players.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /kick &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /kick xTROLLx Throwing grenades in base&lt;br /&gt;
| Kicks the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mute &amp;lt;player&amp;gt;&lt;br /&gt;
| /mute Cthon98&lt;br /&gt;
| Prevents the player from saying anything in chat.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mutes&lt;br /&gt;
| /mutes&lt;br /&gt;
| All players that are muted (can’t talk in chat).&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /open &amp;lt;player&amp;gt;&lt;br /&gt;
| /open AzureDiamond&lt;br /&gt;
| Opens another player’s inventory.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /o &amp;lt;player&amp;gt;&lt;br /&gt;
| /o AzureDiamond&lt;br /&gt;
| Same as /open.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /players [online/o/count/c]&lt;br /&gt;
| /players&lt;br /&gt;
| Prints a list of players in the game. (parameter online/o, it prints only players that are online, count/c prints only count)&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /promote &amp;lt;player&amp;gt;&lt;br /&gt;
| /promote AzureDiamond&lt;br /&gt;
| Promotes the player to admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /purge &amp;lt;player&amp;gt;&lt;br /&gt;
| /purge Cthon98&lt;br /&gt;
| Clears all the messages from this player from the chat log.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /reply &amp;lt;message&amp;gt;&lt;br /&gt;
| /reply oh, really?&lt;br /&gt;
| Replies to the last player that whispered to you.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /r &amp;lt;message&amp;gt;&lt;br /&gt;
| /r oh, really?&lt;br /&gt;
| Same as /reply.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /server-save&lt;br /&gt;
| /server-save&lt;br /&gt;
| Saves the game on the server in a multiplayer game.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /shout &amp;lt;message&amp;gt;&lt;br /&gt;
| /shout Hello world!&lt;br /&gt;
| Sends a message to all players including other forces.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /s &amp;lt;message&amp;gt;&lt;br /&gt;
| /s Hello world!&lt;br /&gt;
| Same as /shout.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /swap-players &amp;lt;player&amp;gt; [player]&lt;br /&gt;
| /swap-players AzureDiamond&lt;br /&gt;
| Swaps your character with the given player’s character, or if two players are given swaps the two player characters.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unban &amp;lt;player&amp;gt;&lt;br /&gt;
| /unban xTROLLx&lt;br /&gt;
| Unbans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /unignore Cthon98&lt;br /&gt;
| Allows the chat to show messages from this player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unmute &amp;lt;player&amp;gt;&lt;br /&gt;
| /unmute Cthon98&lt;br /&gt;
| Allows the player to talk in chat again.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /whisper &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /whisper AzureDiamond that&#039;s what I see&lt;br /&gt;
| Sends a message to the specified player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /w &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /w AzureDiamond that&#039;s what I see&lt;br /&gt;
| Same as /whisper.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /whitelist &amp;lt;add/remove/get/clear&amp;gt; [player]&lt;br /&gt;
| /whitelist get&lt;br /&gt;
| Adds or removes a player from the whitelist, where only whitelisted players can join the game. Enter nothing for “player” when using “get” to print a list of all whitelisted players. An empty whitelist disables the whitelist functionality allowing anyone to join.&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scripting and cheat commands ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| /cheat &amp;lt;all&amp;gt;&lt;br /&gt;
| Researches all technologies and enables cheat mode. Using the &#039;&#039;&#039;all&#039;&#039;&#039; option also gives the player some additional items.&lt;br /&gt;
|-&lt;br /&gt;
| /command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /c &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /editor&lt;br /&gt;
| Toggles the map editor.&lt;br /&gt;
|-&lt;br /&gt;
| /measured-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command and measures time it took.&lt;br /&gt;
|-&lt;br /&gt;
| /silent-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command without printing it to the console.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a very powerful feature, which also allows cheating, and as such &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;achievements will be permanently disabled for the save&amp;lt;/span&amp;gt; as soon as you use a script command.&lt;br /&gt;
&lt;br /&gt;
== Basic example scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Use it as calculator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(1234*5678)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zoom beyond normal bounds ===&lt;br /&gt;
Note that zooming too far out can cause performance hits. Be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.zoom=0.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mine faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Craft faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unlock and research all technologies ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_all_technologies()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Undo this with the command in the next section.&lt;br /&gt;
&lt;br /&gt;
=== Unresearch all technologies ===&lt;br /&gt;
This does not reset manually applied bonuses&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	tech.researched=false&lt;br /&gt;
	game.player.force.set_saved_technology_progress(tech, 0)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reset your force ===&lt;br /&gt;
This resets all data for your force, including kill and production statistics, technologies, bonuses and charting status.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.reset()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Create new force and change your force to new one ===&lt;br /&gt;
This creates new force with specified name, than you get this new force.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force = game.create_force(&amp;quot;new_force_name&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Always show rail block visualization ===&lt;br /&gt;
Permanently show the rail block visualization instead of only when holding a rail signal. Disable by replacing true with false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.game_view_settings.show_rail_block_visualisation = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inventory manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Cheat mode ===&lt;br /&gt;
Allows for infinite free crafting. Disable by replacing true with false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.cheat_mode=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource tile in-game&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.amount=7500&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can refill all resources in the map with the following command. Change ore.amount to the desired value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c surface = game.player.surface&lt;br /&gt;
for _, ore in pairs(surface.find_entities_filtered({type=&amp;quot;resource&amp;quot;})) do&lt;br /&gt;
    ore.amount = 10000&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add items to the player&#039;s inventory ===&lt;br /&gt;
Replace iron-plate with the [[data.raw|internal name]] of the item desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For instance, here&#039;s a stack of the god-mode energy system interface:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;electric-energy-interface&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a powerful armor with equipment and some tools for construction:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c	local player = game.player&lt;br /&gt;
player.insert{name=&amp;quot;power-armor-mk2&amp;quot;, count = 1}&lt;br /&gt;
local p_armor = player.get_inventory(5)[1].grid&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;personal-roboport-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;night-vision-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
player.insert{name=&amp;quot;construction-robot&amp;quot;, count = 25}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== World manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Reveal the map around the player ===&lt;br /&gt;
&lt;br /&gt;
Reveals the map around the player, similar to a [[radar]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or from start position&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{x = -radius, y = -radius}, {x = radius, y = radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change 150 to the desired radius, higher values take longer.&lt;br /&gt;
&lt;br /&gt;
=== Hide revealed map ===&lt;br /&gt;
&lt;br /&gt;
Hides all revealed chunks, inverted map revealing.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local force = game.player.force&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  force.unchart_chunk({x = chunk.x, y = chunk.y}, surface)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reveal all generated map ===&lt;br /&gt;
&lt;br /&gt;
Revels all of the generated map to the player&#039;s team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.chart_all()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Delete chunks ===&lt;br /&gt;
If much of the map is revealed, it increases the size of the save file. The following command cancels the generation of all chunks that are currently queued for generation and removes chunks outside a 32 chunks radius around 0,0. Note that this will remove player entities if there are any on these chunks.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface;&lt;br /&gt;
game.player.force.cancel_charting(surface); &lt;br /&gt;
local chunk_radius = 32;&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  if (chunk.x &amp;lt; -chunk_radius or chunk.x &amp;gt; chunk_radius or chunk.y &amp;lt; -chunk_radius or chunk.y &amp;gt; chunk_radius) then&lt;br /&gt;
    surface.delete_chunk(chunk)&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
Enables eternal day.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.always_day=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change game speed ===&lt;br /&gt;
0.5 is half speed, 1 is default, 2 is double speed, etc. Minimum is 0.01. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.speed=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expensive (marathon) or normal mode ===&lt;br /&gt;
To change from normal to expensive mode preset (this changes the research cost and intermediate product cost):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change back to normal:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Freeze time ===&lt;br /&gt;
Stops the advancement of the time if you replace &amp;quot;BOOL&amp;quot; with &amp;quot;true&amp;quot; or unfreezes it if you replace it with &amp;quot;false&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.freeze_daytime=BOOL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.clear_pollution()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Completely turn off pollution ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, surface in pairs(game.surfaces) do&lt;br /&gt;
  surface.clear_pollution()&lt;br /&gt;
end&lt;br /&gt;
game.map_settings.pollution.enabled = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add a lot of pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.pollute(game.player.position, 1000000)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where speakers are, by who ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c speakers = game.player.surface.find_entities_filtered{force = game.player.force, type=&amp;quot;programmable-speaker&amp;quot;}&lt;br /&gt;
for key, speaker in pairs(speakers) do&lt;br /&gt;
    game.player.print(speaker.last_user.name .. &amp;quot; placed a speaker at X=&amp;quot; .. speaker.position.x .. &amp;quot;, Y=&amp;quot; .. speaker.position.y)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable friendly fire for your force ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.friendly_fire = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 11×11 patch of resources, centered on the player character, where the ground is not water.&lt;br /&gt;
The patch it creates is perfectly square but it randomizes the amount similar to natural generation, with fewer ore at the edges and more ore in the center.&lt;br /&gt;
The default numbers result in a patch with 2500-3000 ore.&lt;br /&gt;
&lt;br /&gt;
If you want a larger patch, change &amp;quot;local size = 5&amp;quot; to a larger number.&lt;br /&gt;
A larger patch will have exponentially more ore.&lt;br /&gt;
Entering a number above 30 is not recommended.&lt;br /&gt;
&lt;br /&gt;
If you want a richer patch, change &amp;quot;local density = 10&amp;quot; to a larger number.&lt;br /&gt;
Entering a very large number shouldn&#039;t hurt anything but you probably don&#039;t need to go above 100.&lt;br /&gt;
&lt;br /&gt;
To choose which resource is spawned, change &amp;quot;stone&amp;quot; near the bottom to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, &amp;quot;coal&amp;quot;, or &amp;quot;uranium-ore&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local ore=nil&lt;br /&gt;
local size=5&lt;br /&gt;
local density=10&lt;br /&gt;
for y=-size, size do&lt;br /&gt;
	for x=-size, size do&lt;br /&gt;
		a=(size+1-math.abs(x))*10&lt;br /&gt;
		b=(size+1-math.abs(y))*10&lt;br /&gt;
		if a&amp;lt;b then&lt;br /&gt;
			ore=math.random(a*density-a*(density-8), a*density+a*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if b&amp;lt;a then&lt;br /&gt;
			ore=math.random(b*density-b*(density-8), b*density+b*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if surface.get_tile(game.player.position.x+x, game.player.position.y+y).collides_with(&amp;quot;ground-tile&amp;quot;) then&lt;br /&gt;
			surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=ore, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove resources around the player ===&lt;br /&gt;
Removes all resource patches from the ground in a 50 x 50 area around the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local size=50&lt;br /&gt;
local pos=game.player.position&lt;br /&gt;
&lt;br /&gt;
for _, e in pairs(surface.find_entities_filtered{area={{pos.x-size, pos.y-size},{pos.x+size, pos.y+size}}, type=&amp;quot;resource&amp;quot;}) &lt;br /&gt;
	do e.destroy() &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches in a 3×3 square.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for y=0,2 do&lt;br /&gt;
	for x=0,2 do&lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or randomly without any collision:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local position=nil&lt;br /&gt;
for i=1,9 do&lt;br /&gt;
	position=game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
	if position then &lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position=position})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create 10 fishes ===&lt;br /&gt;
This creates 10 fishes around of player. The player must be on the water edge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local player = game.player&lt;br /&gt;
local surface = player.surface&lt;br /&gt;
for i = 1, 10 do&lt;br /&gt;
  local position = surface.find_non_colliding_position(&#039;fish&#039;, player.position, 10, 1)&lt;br /&gt;
  if not position then return end&lt;br /&gt;
  surface.create_entity {name = &#039;fish&#039;, position = position}&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Count entities ===&lt;br /&gt;
Counts all entities whose name includes the string in local entity.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local entity=&amp;quot;belt&amp;quot;&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local count=0&lt;br /&gt;
for key, ent in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(ent.name,entity) then&lt;br /&gt;
		count=count+1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(count)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emptying all pipes, underground pipes and pumps ===&lt;br /&gt;
Useful when pipes contain a fluid you dont want.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local deleted=0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(entity.name, &amp;quot;pipe&amp;quot;) or &lt;br /&gt;
		string.find(entity.name, &amp;quot;pump&amp;quot;) &lt;br /&gt;
	then&lt;br /&gt;
		for i=1,#entity.fluidbox do&lt;br /&gt;
			deleted = deleted + 1&lt;br /&gt;
			entity.fluidbox[i] = nil;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(&amp;quot;Fluids removed from &amp;quot;..deleted ..&amp;quot; entities&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off cliff generation ===&lt;br /&gt;
Sets size to &amp;quot;none&amp;quot;. Only effective on chunks that are generated after using this command. Use [[#Remove all cliffs]] to delete existing cliffs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local mgs = game.player.surface.map_gen_settings&lt;br /&gt;
mgs.cliff_settings.cliff_elevation_0 = 1024&lt;br /&gt;
game.player.surface.map_gen_settings = mgs&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all cliffs ===&lt;br /&gt;
Removes all cliffs existing cliffs from the world. Use [[#Turn off cliff generation]] to turn off cliff generation in new chunks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, v in pairs(game.player.surface.find_entities_filtered{type=&amp;quot;cliff&amp;quot;}) do&lt;br /&gt;
  v.destroy()&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Delete all decoratives ===&lt;br /&gt;
Delete the decoratives that can be found in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.destroy_decoratives({})&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change map generation settings ===&lt;br /&gt;
This allows to change the map generation settings for new chunks; it does not alter already generated chunks. [[#Delete chunks|Deleted chunks]] are affected by the setting change because they are newly generated when they get explored again.&lt;br /&gt;
&lt;br /&gt;
To change resource generation settings, replace &amp;quot;iron-ore&amp;quot; with the [[Data.raw#resource|resource]] that should be changed and replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command. Replace &amp;quot;iron-ore&amp;quot; with &amp;quot;enemy-base&amp;quot; to change the enemy base generation settings. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local resource = &amp;quot;iron-ore&amp;quot;&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.autoplace_controls[resource].size = &amp;quot;very-high&amp;quot;&lt;br /&gt;
mgs.autoplace_controls[resource].frequency = &amp;quot;very-high&amp;quot;&lt;br /&gt;
mgs.autoplace_controls[resource].richness = &amp;quot;very-high&amp;quot;&lt;br /&gt;
surface.map_gen_settings = mgs&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change water generation settings, replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.water = &amp;quot;very-high&amp;quot; --[[ size]]&lt;br /&gt;
mgs.terrain_segmentation  = &amp;quot;very-high&amp;quot; --[[ frequency]]&lt;br /&gt;
surface.map_gen_settings = mgs &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enemy/evolution scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Set evolution factor ===&lt;br /&gt;
Ranges from 0 (new game) to 1.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].evolution_factor=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_evolution.time_factor=0&lt;br /&gt;
/c game.map_settings.enemy_evolution.pollution_factor=game.map_settings.enemy_evolution.pollution_factor*2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;2&amp;quot; at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.&lt;br /&gt;
&lt;br /&gt;
=== Kill all biters on the &amp;quot;enemy&amp;quot; force ===&lt;br /&gt;
Note that this will kill only mobile units, spawners will not be killed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all enemies ===&lt;br /&gt;
This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the explored world, so any unexplored parts of the map which still need to be generated will still have enemies. You can [[#Prevent biters being on newly generated chunks|prevent biters being on newly generated chunks]] if desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all nearby enemies ===&lt;br /&gt;
&lt;br /&gt;
This will kill all biters, bases and worms in a configurable radius. The default, 250 tiles, is about two zoomed-out screen widths on full HD. After destruction, it shows how many objects were destroyed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local pp = game.player.position&lt;br /&gt;
local cnt = 0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;, radius=250, position=pp })) do&lt;br /&gt;
	cnt = cnt+1&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
 end	&lt;br /&gt;
game.player.print(cnt)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable peaceful mode ===&lt;br /&gt;
Enabling peaceful mode prevents biter attacks until provoked. Substitute true for false to disable. Already existing biters are not affected by this command so attacks could continue for a while after activating peaceful mode.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.peaceful_mode = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable biter expansion ===&lt;br /&gt;
Biter expansion allows biters to create new nests, it is enabled by default. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_expansion.enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Prevent biters being on newly generated chunks ===&lt;br /&gt;
On newly generated chunks no biters will be present, however all current biters will remain unaffected. Equivalent of setting the Enemy Base Size to None under the Terrain settings during map generation but achieved mid game by [[#Change map generation settings|changing map generation settings]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.autoplace_controls[&amp;quot;enemy-base&amp;quot;].size = &amp;quot;none&amp;quot;&lt;br /&gt;
surface.map_gen_settings = mgs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Player character scripts ==&lt;br /&gt;
Commands concerning the player directly.&lt;br /&gt;
=== Get player position ===&lt;br /&gt;
Prints coordinates of your current position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.position.x .. &amp;quot;, &amp;quot; .. game.player.position.y)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Teleport player ===&lt;br /&gt;
Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.teleport({X, Y})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To teleport to the world&#039;s origin, use 0,0.&lt;br /&gt;
&lt;br /&gt;
=== Enable god mode ===&lt;br /&gt;
God mode removes your player character allowing you to fly over obstacles and take no damage.&lt;br /&gt;
&lt;br /&gt;
Disassociate your controls from the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.character=nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, hover the mouse over the useless player and destroy it by typing:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.destroy()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To undo, spawn a player character. This will spawn a new player at the spawn point of the world, and connect your controls to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.create_character()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable long reach ===&lt;br /&gt;
Enables long reach, which allows the player to build and interact with entities at a greater distance. The default reach is 10.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local reach = 10000&lt;br /&gt;
game.player.force.character_build_distance_bonus = reach&lt;br /&gt;
game.player.force.character_reach_distance_bonus = reach&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Enable Research Queue ===&lt;br /&gt;
Enable the research queue for the players current team. Can be done after the game has started if it was forgotten during the map&#039;s setup.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_queue_enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.laboratory_speed_modifier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
1 is normal speed, 2 is double speed 3 is triple etc.&lt;br /&gt;
&lt;br /&gt;
=== Research specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=true&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unresearch specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;electric-energy-distribution-1&#039;, 0)&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;steel-processing&#039;, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling specific recipes ===&lt;br /&gt;
The internal recipe/item names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;electric-energy-interface&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;rocket-silo&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes.loader.enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;fast-loader&amp;quot;].enabled = true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;express-loader&amp;quot;].enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable all recipes ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name, recipe in pairs(game.player.force.recipes) do recipe.enabled = true end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modding tools ==&lt;br /&gt;
A list of the internal names of most things in the vanilla game can also be found on [[data.raw]].&lt;br /&gt;
&lt;br /&gt;
=== Print to console which tile are you have under the player position ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.surface.get_tile(game.player.position).name)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all researched technologies to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	if tech.researched then&lt;br /&gt;
    list[#list+1] = tech.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;techs.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all enabled recipes to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, recipe in pairs(game.player.force.recipes) do &lt;br /&gt;
	if recipe.enabled then&lt;br /&gt;
    list[#list+1] = recipe.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;recipes.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Command line parameters]]&lt;br /&gt;
* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=179478</id>
		<title>User:Darkfrei/script</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=179478"/>
		<updated>2020-05-12T18:33:10Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches randomly without collisions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
 /c local position = nil&lt;br /&gt;
 for i=1,9 do&lt;br /&gt;
   position = game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
   if position then &lt;br /&gt;
     game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position=position})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Respawn enemies ===&lt;br /&gt;
This creates one respawner every 32x32 tiles:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
 /c local surface = game.player.surface&lt;br /&gt;
 for c in surface.get_chunks() do&lt;br /&gt;
   local position = surface.find_non_colliding_position(&amp;quot;biter-spawner&amp;quot;, {x=c.x*32+16, y=c.y*32+16}, 10, 3)&lt;br /&gt;
   if position and surface.is_chunk_generated(c) then&lt;br /&gt;
     surface.create_entity{name=&amp;quot;biter-spawner&amp;quot;, position=position}&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Print all mods with versions to the log file ===&lt;br /&gt;
For data stage:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
  local mod_list = {}&lt;br /&gt;
  for i, v in pairs (mods) do&lt;br /&gt;
    table.insert (mod_list, i .. &#039;_&#039; ..v )&lt;br /&gt;
  end&lt;br /&gt;
  log (&#039;mods: &#039; .. serpent.line (mod_list))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Print collison mask ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.print (game.player.selected.prototype.name .. &#039; &#039; .. serpent.line(game.player.selected.prototype.collision_mask))&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Offshore_pump&amp;diff=178070</id>
		<title>Offshore pump</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Offshore_pump&amp;diff=178070"/>
		<updated>2020-02-28T11:49:52Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
{{:Infobox:Offshore pump}}&lt;br /&gt;
The &#039;&#039;&#039;offshore pump&#039;&#039;&#039; produces [[water]] from a lake or ocean. It must be placed on a shoreline of a body of water on the map, and connected to a [[pipe]] or [[Fluid system|other object that accepts liquids]]. It produces 1200 units of water per second. It does not require [[electric system|electricity]] or [[fuel]] to operate.&lt;br /&gt;
&lt;br /&gt;
Offshore pumps are frequently used to provide water for [[steam engine]]s, though several crafting recipes also require water. One offshore pump can generate enough water to support 20 boilers, which in turn can support 40 steam engines. For more information, see [[Power_production#Steam power|power production]].&lt;br /&gt;
&lt;br /&gt;
The water supply from an offshore pump is endless; it will not dry up the body of water it is attached to. Additionally, the size of the body of water the pump is connected to does not affect the rate of water generation. Filling in the water around the pump by using [[landfill]] will rename the pump to &amp;quot;Water well pump&amp;quot; and it will keep producing water.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
{{history|0.16.16|&lt;br /&gt;
* Changed size of offshore pump from 3x1 to 3x2 in order to prevent pump placement in overlapping positions.}}&lt;br /&gt;
&lt;br /&gt;
{{history|0.15.0|&lt;br /&gt;
* Increased water output from 60 to 1200 units per second. (Undocumented)}}&lt;br /&gt;
&lt;br /&gt;
{{history|0.12.1|&lt;br /&gt;
* Copy paste now works on pump.}}&lt;br /&gt;
&lt;br /&gt;
{{history|0.12.0|&lt;br /&gt;
* Connectable to the circuit network.}}&lt;br /&gt;
&lt;br /&gt;
{{history|0.9.2|&lt;br /&gt;
* Now specifies the liquid it will produce.}}&lt;br /&gt;
&lt;br /&gt;
{{history|0.5.1|&lt;br /&gt;
* New graphics.}}&lt;br /&gt;
&lt;br /&gt;
{{history|0.1.0|&lt;br /&gt;
* Introduced}}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Electric system]]&lt;br /&gt;
* [[Fluid system]]&lt;br /&gt;
* [[Pump]]&lt;br /&gt;
&lt;br /&gt;
{{ProductionNav}}&lt;br /&gt;
{{C|Resource extraction}}&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Raw_fish&amp;diff=178043</id>
		<title>Talk:Raw fish</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Raw_fish&amp;diff=178043"/>
		<updated>2020-02-28T08:21:32Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: Created page with &amp;quot;Rename raw fish into fish? --~~~~&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Rename raw fish into fish?&lt;br /&gt;
--[[User:Darkfrei|Darkfrei]] ([[User talk:Darkfrei|talk]]) 08:21, 28 February 2020 (UTC)&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=User:Darkfrei/Steam_Cooling&amp;diff=177562</id>
		<title>User:Darkfrei/Steam Cooling</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=User:Darkfrei/Steam_Cooling&amp;diff=177562"/>
		<updated>2020-02-16T16:51:52Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: Created page with &amp;quot;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;  local supported_types = {&amp;#039;storage-tank&amp;#039;, &amp;#039;pipe&amp;#039;}  function is_value_in_table (value, tabl)   for i, v in pairs (tabl) do     if v == value then...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
local supported_types = {&#039;storage-tank&#039;, &#039;pipe&#039;}&lt;br /&gt;
&lt;br /&gt;
function is_value_in_table (value, tabl)&lt;br /&gt;
  for i, v in pairs (tabl) do&lt;br /&gt;
    if v == value then&lt;br /&gt;
      return true&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function cool_storage_tank (entity, dt)&lt;br /&gt;
  local fluidbox = entity.fluidbox&lt;br /&gt;
  if fluidbox then&lt;br /&gt;
    for i = 1, #fluidbox do&lt;br /&gt;
      local fluid = fluidbox[i]&lt;br /&gt;
      if fluid then&lt;br /&gt;
        local name = fluid.name&lt;br /&gt;
        local temp = fluid.temperature&lt;br /&gt;
        local amount = fluid.amount&lt;br /&gt;
        local min_temp = game.fluid_prototypes[name].default_temperature&lt;br /&gt;
        local delta_temp = (0.99 ^ (dt/amount)) * (temp-min_temp)&lt;br /&gt;
        &lt;br /&gt;
        fluid.temperature = min_temp + delta_temp&lt;br /&gt;
        fluidbox[i] = fluid -- why?&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function cool_pipe (entity, dt)&lt;br /&gt;
  local fluidbox = entity.fluidbox&lt;br /&gt;
  if fluidbox then&lt;br /&gt;
    for i = 1, #fluidbox do&lt;br /&gt;
      local fluid = fluidbox[i]&lt;br /&gt;
      if fluid then&lt;br /&gt;
        local name = fluid.name&lt;br /&gt;
        local temp = fluid.temperature&lt;br /&gt;
        local amount = fluid.amount&lt;br /&gt;
        local min_temp = game.fluid_prototypes[name].default_temperature&lt;br /&gt;
        local delta_temp = (0.99 ^ (dt/amount)) * (temp-min_temp)&lt;br /&gt;
        &lt;br /&gt;
        fluid.temperature = min_temp + delta_temp&lt;br /&gt;
        fluidbox[i] = fluid -- why?&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function main_handler (handler, dt) -- dt is time in ticks&lt;br /&gt;
  -- game.print (&#039;ok: &#039;..dt)&lt;br /&gt;
  local entity = handler.entity&lt;br /&gt;
  if entity and entity.valid then&lt;br /&gt;
    if entity.type == &#039;storage-tank&#039; then&lt;br /&gt;
      cool_storage_tank (entity, dt)&lt;br /&gt;
    elseif entity.type == &#039;pipe&#039; then&lt;br /&gt;
      cool_pipe (entity, dt)&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    return true&lt;br /&gt;
  else&lt;br /&gt;
    -- must be deleted&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function on_tick () -- I love this function / darkfrei&lt;br /&gt;
  -- multiple handlers per tick&lt;br /&gt;
  local handlers_per_tick = handlers_per_tick_global_setting or 1&lt;br /&gt;
  if not global.handlers then&lt;br /&gt;
    global.handlers = {}&lt;br /&gt;
    return -- nothing to do in this tick&lt;br /&gt;
  end&lt;br /&gt;
  local id = global.next_handler_id or 1&lt;br /&gt;
  local n = 0&lt;br /&gt;
  while n &amp;lt; handlers_per_tick do&lt;br /&gt;
    local handler = global.handlers[id+n]&lt;br /&gt;
    n = n + 1&lt;br /&gt;
    if handler then&lt;br /&gt;
      -- do the function&lt;br /&gt;
      -----&lt;br /&gt;
      local max_id = #global.handlers -- how many ticks it needs to update? It&#039;s delta time!&lt;br /&gt;
      &lt;br /&gt;
      local valid = main_handler (handler, max_id/handlers_per_tick) -- returns false or nil if it was something wrong&lt;br /&gt;
      -----&lt;br /&gt;
      if not valid then&lt;br /&gt;
        &lt;br /&gt;
        if id &amp;lt; max_id then&lt;br /&gt;
          global.handlers[id] = global.handlers[max_id]&lt;br /&gt;
          global.handlers[max_id] = nil&lt;br /&gt;
        else -- id =&amp;gt; max_id; the last one&lt;br /&gt;
          global.handlers[id] = nil&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    else -- no handler, earlier was the last one&lt;br /&gt;
      global.next_handler_id = 1&lt;br /&gt;
      return&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  -- the next tick next handlers&lt;br /&gt;
  global.next_handler_id = id + n&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
script.on_event(defines.events.on_tick, on_tick)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function onBuildHandler (entity) &lt;br /&gt;
  local handler = {entity = entity}&lt;br /&gt;
  if not global.handlers then global.handlers = {} end&lt;br /&gt;
  table.insert(global.handlers, handler)&lt;br /&gt;
  game.print (#global.handlers)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
script.on_event(defines.events.on_built_entity, function(event)&lt;br /&gt;
  local entity_type = event.created_entity.type&lt;br /&gt;
  if is_value_in_table (entity_type, supported_types) then &lt;br /&gt;
    onBuildHandler (event.created_entity) &lt;br /&gt;
  end&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
script.on_event(defines.events.on_robot_built_entity, function(event)&lt;br /&gt;
  local entity_type = event.created_entity.type&lt;br /&gt;
  if is_value_in_table (entity_type, supported_types) then &lt;br /&gt;
    onBuildHandler (event.created_entity) &lt;br /&gt;
  end&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=177411</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=177411"/>
		<updated>2020-02-03T07:35:52Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Print to console which tile are you have under the player position */ How it can be? Is the &amp;quot;surface.get_tile(position)&amp;quot; right definition?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
The &#039;&#039;&#039;console&#039;&#039;&#039; is Factorio&#039;s in-game command-line interface. See [[command line parameters]] for the command line interface of the Factorio executable.&lt;br /&gt;
&lt;br /&gt;
The in-game console can be used for:&lt;br /&gt;
&lt;br /&gt;
* Chatting with other players&lt;br /&gt;
* Occasional status updates&lt;br /&gt;
* Running commands / scripts / cheats&lt;br /&gt;
&lt;br /&gt;
There are three types of commands:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[#Normal commands|Normal]]&#039;&#039;&#039; - Display information about the game and customize your experience.&lt;br /&gt;
* &#039;&#039;&#039;[[#Multiplayer commands|Multiplayer]]&#039;&#039;&#039; - Message filtering, banning users, etc.&lt;br /&gt;
* &#039;&#039;&#039;[[#Scripting and cheat commands|Scripting/Cheating]]&#039;&#039;&#039; - Run small Lua scripts (but they &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;disable achievements for the save game&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=== Using the console ===&lt;br /&gt;
The console display can be toggled with the {{keybinding|/}} (slash) or {{keybinding|~}} (tilde) keys.&lt;br /&gt;
&lt;br /&gt;
You can customize the keys via &#039;&#039;&#039;Options Menu → Keyboard → Toggle Lua console&#039;&#039;&#039;.&lt;br /&gt;
When the console is open, you&#039;ll see a blinking cursor at the bottom of the screen; type your message or command and hit &#039;&#039;&#039;Return&#039;&#039;&#039; to send it (this will also close the console).&lt;br /&gt;
Documentation about message and command prefixes can be found further down this page.&lt;br /&gt;
&lt;br /&gt;
The console supports [[rich text]] tags. These tags are useful for sharing blueprints, marking map locations in chat or adding icons to map markers and train stations. Ctrl + Alt-clicking the map or ground will automatically insert a GPS tag and post it into the console. Shift-clicking most things with the console open will insert a tag for that thing into the console.&lt;br /&gt;
&lt;br /&gt;
When the console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages).&lt;br /&gt;
Note that by default, all executed commands are made visible to all users. You can set the fade-out time via &#039;&#039;&#039;Options Menu → Other Settings → Message Delay&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you want to immediately hide the console, open the console and then press &#039;&#039;&#039;Escape&#039;&#039;&#039; key (or press &#039;&#039;&#039;Return&#039;&#039;&#039; without entering any message/command).&lt;br /&gt;
This not only closes the console, but it also hides all the recent messages/commands.&lt;br /&gt;
The console can be cleared with the &#039;&#039;&#039;/clear&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;uarr;}} and {{keybinding|&amp;amp;darr;}} keys to scroll through the console history. The {{keybinding|Tab}} key will auto-complete commands and player names.&lt;br /&gt;
&lt;br /&gt;
== Normal commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| /alerts &amp;lt;enable/disable/mute/unmute&amp;gt; &amp;lt;alert&amp;gt;&lt;br /&gt;
| /alerts disable turret_fire&lt;br /&gt;
| Enables, disables, mutes, or unmutes the given  [[alerts|alert]] type. Available alerts: entity_destroyed, entity_under_attack, not_enough_construction_robots, no_material_for_construction, not_enough_repair packs, turret_fire, custom, no_storage, train_out_of_fuel, fluid_mixing.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /clear&lt;br /&gt;
| /clear&lt;br /&gt;
| Clears the console.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /color &amp;lt;color&amp;gt;&lt;br /&gt;
| /color 20 255 255 100&lt;br /&gt;
| Changes your color. Can either be one of the pre-defined colors or [[:Wikipedia:RGBA_color_space|RGBA value]] in the format of “# # # #”. Available colors: default, red, green, blue, orange, yellow, pink, purple, white, black, gray, brown, cyan, acid.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /evolution&lt;br /&gt;
| /evolution&lt;br /&gt;
| Prints info about the alien evolution factor.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /help [command]&lt;br /&gt;
| /help&lt;br /&gt;
| Prints a list of available commands, the optional argument can specify the command that should be described.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /h [command]&lt;br /&gt;
| /h&lt;br /&gt;
| Same as /help.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /mute-programmable-speaker &amp;lt;mute/unmute&amp;gt; &amp;lt;local/everyone&amp;gt;&lt;br /&gt;
| /mute-programmable-speaker mute local&lt;br /&gt;
| Mutes or unmutes the global sounds created by the Programmable Speaker. Use “local” to mute just the local client. Admins can use “everyone” to mute the sounds for everyone on the server.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /perf-avg-frames &amp;lt;number&amp;gt;&lt;br /&gt;
| /perf-avg-frames 100&lt;br /&gt;
| Number of ticks/updates used to average performance counters. Default is 100. Value of 5-10 is recommended for fast convergence, but numbers will jitter more rapidly.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /permissions&lt;br /&gt;
| /permissions&lt;br /&gt;
| Opens the permissions GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /screenshot [x resolution] [y resolution] [zoom]&lt;br /&gt;
| /screenshot&lt;br /&gt;
| Takes a screenshot with the GUI hidden, centered on the player. It is saved in the &amp;quot;script-output&amp;quot; subfolder of your [[User data directory]].  Resolution is optional and defaults to the current window size. Zoom is optional and defaults to 1.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /seed&lt;br /&gt;
| /seed&lt;br /&gt;
| Prints the starting map seed.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /time&lt;br /&gt;
| /time&lt;br /&gt;
| Prints info about how old the map is.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| Toggles logging all input actions performed by the game. This value isn’t persisted between game restarts and only affects your local game in multiplayer sessions.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| Used to investigate [[Desynchronization#Using_heavy_mode_command|desyncs]]. Will slow down the game and make multiplayer unplayable.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| Toggles if the rockets sent button is shown in the upper left corner of the screen.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unlock-shortcut-bar&lt;br /&gt;
| /unlock-shortcut-bar&lt;br /&gt;
| Unlocks all shortcut bar items.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /version&lt;br /&gt;
| /version&lt;br /&gt;
| Prints the current game version.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Multiplayer commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;message&amp;gt;&lt;br /&gt;
| Hello team!&lt;br /&gt;
| Console input that does not start with {{keybinding|/}} is shown as a chat message to your team.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /admin&lt;br /&gt;
| /admin&lt;br /&gt;
| Opens the player management GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /admins&lt;br /&gt;
| /admins&lt;br /&gt;
| Prints a list of game admins.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ban &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /ban xTROLLx Throwing grenades in base&lt;br /&gt;
| Bans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /banlist &amp;lt;add/remove/get/clear&amp;gt; &amp;lt;player&amp;gt;&lt;br /&gt;
| /banlist get&lt;br /&gt;
| Adds or removes a player from the banlist. Same as /ban or /unban.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /config &amp;lt;get/set&amp;gt; &amp;lt;option&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
| /config set password hunter2&lt;br /&gt;
| Gets or sets various multiplayer game settings. Available configs are: afk-auto-kick, allow-commands, allow-debug-settings, autosave-interval, autosave-only-on-server, ignore-player-limit-for-returning-players, max-players, max-upload-speed, only-admins-can-pause, password, require-user-verification, visibility-lan, visibility-public.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /delete-blueprint-library &amp;lt;player&amp;gt;&lt;br /&gt;
| /delete-blueprint-library everybody confirm&lt;br /&gt;
| Deletes the blueprint library storage for the given offline player from the save file. Enter “everybody confirm” to delete the storage of all offline players.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /demote &amp;lt;player&amp;gt;&lt;br /&gt;
| /demote AzureDiamond&lt;br /&gt;
| Demotes the player from admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /ignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /ignore Cthon98&lt;br /&gt;
| Prevents the chat from showing messages from this player. Admin messages are still shown.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ignores&lt;br /&gt;
| /ignores&lt;br /&gt;
| Prints a list of ignored players.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /kick &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /kick xTROLLx Throwing grenades in base&lt;br /&gt;
| Kicks the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mute &amp;lt;player&amp;gt;&lt;br /&gt;
| /mute Cthon98&lt;br /&gt;
| Prevents the player from saying anything in chat.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mutes&lt;br /&gt;
| /mutes&lt;br /&gt;
| All players that are muted (can’t talk in chat).&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /open &amp;lt;player&amp;gt;&lt;br /&gt;
| /open AzureDiamond&lt;br /&gt;
| Opens another player’s inventory.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /o &amp;lt;player&amp;gt;&lt;br /&gt;
| /o AzureDiamond&lt;br /&gt;
| Same as /open.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /players [online/o/count/c]&lt;br /&gt;
| /players&lt;br /&gt;
| Prints a list of players in the game. (parameter online/o, it prints only players that are online, count/c prints only count)&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /promote &amp;lt;player&amp;gt;&lt;br /&gt;
| /promote AzureDiamond&lt;br /&gt;
| Promotes the player to admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /purge &amp;lt;player&amp;gt;&lt;br /&gt;
| /purge Cthon98&lt;br /&gt;
| Clears all the messages from this player from the chat log.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /reply &amp;lt;message&amp;gt;&lt;br /&gt;
| /reply oh, really?&lt;br /&gt;
| Replies to the last player that whispered to you.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /r &amp;lt;message&amp;gt;&lt;br /&gt;
| /r oh, really?&lt;br /&gt;
| Same as /reply.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /server-save&lt;br /&gt;
| /server-save&lt;br /&gt;
| Saves the game on the server in a multiplayer game.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /shout &amp;lt;message&amp;gt;&lt;br /&gt;
| /shout Hello world!&lt;br /&gt;
| Sends a message to all players including other forces.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /s &amp;lt;message&amp;gt;&lt;br /&gt;
| /s Hello world!&lt;br /&gt;
| Same as /shout.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /swap-players &amp;lt;player&amp;gt; [player]&lt;br /&gt;
| /swap-players AzureDiamond&lt;br /&gt;
| Swaps your character with the given player’s character, or if two players are given swaps the two player characters.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unban &amp;lt;player&amp;gt;&lt;br /&gt;
| /unban xTROLLx&lt;br /&gt;
| Unbans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /unignore Cthon98&lt;br /&gt;
| Allows the chat to show messages from this player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unmute &amp;lt;player&amp;gt;&lt;br /&gt;
| /unmute Cthon98&lt;br /&gt;
| Allows the player to talk in chat again.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /whisper &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /whisper AzureDiamond that&#039;s what I see&lt;br /&gt;
| Sends a message to the specified player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /w &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /w AzureDiamond that&#039;s what I see&lt;br /&gt;
| Same as /whisper.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /whitelist &amp;lt;add/remove/get/clear&amp;gt; [player]&lt;br /&gt;
| /whitelist get&lt;br /&gt;
| Adds or removes a player from the whitelist, where only whitelisted players can join the game. Enter nothing for “player” when using “get” to print a list of all whitelisted players. An empty whitelist disables the whitelist functionality allowing anyone to join.&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scripting and cheat commands ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| /cheat &amp;lt;all&amp;gt;&lt;br /&gt;
| Researches all technologies and enables cheat mode. Using the &#039;&#039;&#039;all&#039;&#039;&#039; option also gives the player some additional items.&lt;br /&gt;
|-&lt;br /&gt;
| /command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /c &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /editor&lt;br /&gt;
| Toggles the map editor.&lt;br /&gt;
|-&lt;br /&gt;
| /measured-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command and measures time it took.&lt;br /&gt;
|-&lt;br /&gt;
| /silent-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command without printing it to the console.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a very powerful feature, which also allows cheating, and as such &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;achievements will be permanently disabled for the save&amp;lt;/span&amp;gt; as soon as you use a script command.&lt;br /&gt;
&lt;br /&gt;
== Basic example scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Use it as calculator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(1234*5678)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zoom beyond normal bounds ===&lt;br /&gt;
Note that zooming too far out can cause performance hits. Be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.zoom=0.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mine faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Craft faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unlock and research all technologies ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_all_technologies()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Undo this with the command in the next section.&lt;br /&gt;
&lt;br /&gt;
=== Unresearch all technologies ===&lt;br /&gt;
This does not reset manually applied bonuses&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	tech.researched=false&lt;br /&gt;
	game.player.force.set_saved_technology_progress(tech, 0)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reset your force ===&lt;br /&gt;
This resets all data for your force, including kill and production statistics, technologies, bonuses and charting status.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.reset()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Always show rail block visualization ===&lt;br /&gt;
Permanently show the rail block visualization instead of only when holding a rail signal. Disable by replacing true with false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.game_view_settings.show_rail_block_visualisation = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inventory manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Cheat mode ===&lt;br /&gt;
Allows for infinite free crafting. Disable by replacing true with false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.cheat_mode=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource tile in-game&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.amount=7500&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can refill all resources in the map with the following command. Change ore.amount to the desired value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c surface = game.player.surface&lt;br /&gt;
for _, ore in pairs(surface.find_entities_filtered({type=&amp;quot;resource&amp;quot;})) do&lt;br /&gt;
    ore.amount = 10000&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add items to the player&#039;s inventory ===&lt;br /&gt;
Replace iron-plate with the [[data.raw|internal name]] of the item desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For instance, here&#039;s a stack of the god-mode energy system interface:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;electric-energy-interface&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a powerful armor with equipment and some tools for construction:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c	local player = game.player&lt;br /&gt;
player.insert{name=&amp;quot;power-armor-mk2&amp;quot;, count = 1}&lt;br /&gt;
local p_armor = player.get_inventory(5)[1].grid&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;personal-roboport-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;night-vision-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
player.insert{name=&amp;quot;construction-robot&amp;quot;, count = 25}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== World manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Reveal the map around the player ===&lt;br /&gt;
&lt;br /&gt;
Reveals the map around the player, similar to a [[radar]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or from start position&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{x = -radius, y = -radius}, {x = radius, y = radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change 150 to the desired radius, higher values take longer.&lt;br /&gt;
&lt;br /&gt;
=== Hide revealed map ===&lt;br /&gt;
&lt;br /&gt;
Hides all revealed chunks, inverted map revealing.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local force = game.player.force&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  force.unchart_chunk({x = chunk.x, y = chunk.y}, surface)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reveal all generated map ===&lt;br /&gt;
&lt;br /&gt;
Revels all of the generated map to the player&#039;s team.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.chart_all()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Delete chunks ===&lt;br /&gt;
If much of the map is revealed, it increases the size of the save file. The following command cancels the generation of all chunks that are currently queued for generation and removes chunks outside a 32 chunks radius around 0,0. Note that this will remove player entities if there are any on these chunks.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface;&lt;br /&gt;
game.player.force.cancel_charting(surface); &lt;br /&gt;
local chunk_radius = 32;&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  if (chunk.x &amp;lt; -chunk_radius or chunk.x &amp;gt; chunk_radius or chunk.y &amp;lt; -chunk_radius or chunk.y &amp;gt; chunk_radius) then&lt;br /&gt;
    surface.delete_chunk(chunk)&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
Enables eternal day.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.always_day=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change game speed ===&lt;br /&gt;
0.5 is half speed, 1 is default, 2 is double speed, etc. Minimum is 0.01. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.speed=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expensive (marathon) or normal mode ===&lt;br /&gt;
To change from normal to expensive mode preset (this changes the research cost and intermediate product cost):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change back to normal:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Freeze time ===&lt;br /&gt;
Stops the advancement of the time if you replace &amp;quot;BOOL&amp;quot; with &amp;quot;true&amp;quot; or unfreezes it if you replace it with &amp;quot;false&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.freeze_daytime=BOOL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.clear_pollution()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Completely turn off pollution ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, surface in pairs(game.surfaces) do&lt;br /&gt;
  surface.clear_pollution()&lt;br /&gt;
end&lt;br /&gt;
game.map_settings.pollution.enabled = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add a lot of pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.pollute(game.player.position, 1000000)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where speakers are, by who ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c speakers = game.player.surface.find_entities_filtered{force = game.player.force, type=&amp;quot;programmable-speaker&amp;quot;}&lt;br /&gt;
for key, speaker in pairs(speakers) do&lt;br /&gt;
    game.player.print(speaker.last_user.name .. &amp;quot; placed a speaker at X=&amp;quot; .. speaker.position.x .. &amp;quot;, Y=&amp;quot; .. speaker.position.y)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable friendly fire for your force ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.friendly_fire = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 11×11 patch of resources, centered on the player character, where the ground is not water.&lt;br /&gt;
The patch it creates is perfectly square but it randomizes the amount similar to natural generation, with fewer ore at the edges and more ore in the center.&lt;br /&gt;
The default numbers result in a patch with 2500-3000 ore.&lt;br /&gt;
&lt;br /&gt;
If you want a larger patch, change &amp;quot;local size = 5&amp;quot; to a larger number.&lt;br /&gt;
A larger patch will have exponentially more ore.&lt;br /&gt;
Entering a number above 30 is not recommended.&lt;br /&gt;
&lt;br /&gt;
If you want a richer patch, change &amp;quot;local density = 10&amp;quot; to a larger number.&lt;br /&gt;
Entering a very large number shouldn&#039;t hurt anything but you probably don&#039;t need to go above 100.&lt;br /&gt;
&lt;br /&gt;
To choose which resource is spawned, change &amp;quot;stone&amp;quot; near the bottom to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, &amp;quot;coal&amp;quot;, or &amp;quot;uranium-ore&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local ore=nil&lt;br /&gt;
local size=5&lt;br /&gt;
local density=10&lt;br /&gt;
for y=-size, size do&lt;br /&gt;
	for x=-size, size do&lt;br /&gt;
		a=(size+1-math.abs(x))*10&lt;br /&gt;
		b=(size+1-math.abs(y))*10&lt;br /&gt;
		if a&amp;lt;b then&lt;br /&gt;
			ore=math.random(a*density-a*(density-8), a*density+a*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if b&amp;lt;a then&lt;br /&gt;
			ore=math.random(b*density-b*(density-8), b*density+b*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if surface.get_tile(game.player.position.x+x, game.player.position.y+y).collides_with(&amp;quot;ground-tile&amp;quot;) then&lt;br /&gt;
			surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=ore, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove resources around the player ===&lt;br /&gt;
Removes all resource patches from the ground in a 50 x 50 area around the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local size=50&lt;br /&gt;
local pos=game.player.position&lt;br /&gt;
&lt;br /&gt;
for _, e in pairs(surface.find_entities_filtered{area={{pos.x-size, pos.y-size},{pos.x+size, pos.y+size}}, type=&amp;quot;resource&amp;quot;}) &lt;br /&gt;
	do e.destroy() &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches in a 3×3 square.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for y=0,2 do&lt;br /&gt;
	for x=0,2 do&lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or randomly without any collision:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local position=nil&lt;br /&gt;
for i=1,9 do&lt;br /&gt;
	position=game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
	if position then &lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position=position})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create 10 fishes ===&lt;br /&gt;
This creates 10 fishes around of player. The player must be on the water edge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local player = game.player&lt;br /&gt;
local surface = player.surface&lt;br /&gt;
for i = 1, 10 do&lt;br /&gt;
  local position = surface.find_non_colliding_position(&#039;fish&#039;, player.position, 10, 1)&lt;br /&gt;
  if not position then return end&lt;br /&gt;
  surface.create_entity {name = &#039;fish&#039;, position = position}&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Count entities ===&lt;br /&gt;
Counts all entities whose name includes the string in local entity.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local entity=&amp;quot;belt&amp;quot;&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local count=0&lt;br /&gt;
for key, ent in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(ent.name,entity) then&lt;br /&gt;
		count=count+1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(count)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emptying all pipes, underground pipes and pumps ===&lt;br /&gt;
Useful when pipes contain a fluid you dont want.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local deleted=0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(entity.name, &amp;quot;pipe&amp;quot;) or &lt;br /&gt;
		string.find(entity.name, &amp;quot;pump&amp;quot;) &lt;br /&gt;
	then&lt;br /&gt;
		for i=1,#entity.fluidbox do&lt;br /&gt;
			deleted = deleted + 1&lt;br /&gt;
			entity.fluidbox[i] = nil;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(&amp;quot;Fluids removed from &amp;quot;..deleted ..&amp;quot; entities&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off cliff generation ===&lt;br /&gt;
Sets size to &amp;quot;none&amp;quot;. Only effective on chunks that are generated after using this command. Use [[#Remove all cliffs]] to delete existing cliffs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local mgs = game.player.surface.map_gen_settings&lt;br /&gt;
mgs.cliff_settings.cliff_elevation_0 = 1024&lt;br /&gt;
game.player.surface.map_gen_settings = mgs&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all cliffs ===&lt;br /&gt;
Removes all cliffs existing cliffs from the world. Use [[#Turn off cliff generation]] to turn off cliff generation in new chunks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, v in pairs(game.player.surface.find_entities_filtered{type=&amp;quot;cliff&amp;quot;}) do&lt;br /&gt;
  v.destroy()&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Delete all decoratives ===&lt;br /&gt;
Delete the decoratives that can be found in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.destroy_decoratives({})&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change map generation settings ===&lt;br /&gt;
This allows to change the map generation settings for new chunks; it does not alter already generated chunks. [[#Delete chunks|Deleted chunks]] are affected by the setting change because they are newly generated when they get explored again.&lt;br /&gt;
&lt;br /&gt;
To change resource generation settings, replace &amp;quot;iron-ore&amp;quot; with the [[Data.raw#resource|resource]] that should be changed and replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command. Replace &amp;quot;iron-ore&amp;quot; with &amp;quot;enemy-base&amp;quot; to change the enemy base generation settings. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local resource = &amp;quot;iron-ore&amp;quot;&lt;br /&gt;
local autoplace = surface.map_gen_settings.autoplace_controls&lt;br /&gt;
autoplace[resource].size = &amp;quot;very-high&amp;quot;&lt;br /&gt;
autoplace[resource].frequency = &amp;quot;very-high&amp;quot;&lt;br /&gt;
autoplace[resource].richness = &amp;quot;very-high&amp;quot;&lt;br /&gt;
surface.map_gen_settings.autoplace_controls = autoplace&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change water generation settings, replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.water = &amp;quot;very-high&amp;quot; --[[ size]]&lt;br /&gt;
mgs.terrain_segmentation  = &amp;quot;very-high&amp;quot; --[[ frequency]]&lt;br /&gt;
surface.map_gen_settings = mgs &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enemy/evolution scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Set evolution factor ===&lt;br /&gt;
Ranges from 0 (new game) to 1.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].evolution_factor=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_evolution.time_factor=0&lt;br /&gt;
/c game.map_settings.enemy_evolution.pollution_factor=game.map_settings.enemy_evolution.pollution_factor*2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;2&amp;quot; at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.&lt;br /&gt;
&lt;br /&gt;
=== Kill all biters on the &amp;quot;enemy&amp;quot; force ===&lt;br /&gt;
Note that this will kill only mobile units, spawners will not be killed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all enemies ===&lt;br /&gt;
This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the explored world, so any unexplored parts of the map which still need to be generated will still have enemies. You can [[#Prevent biters being on newly generated chunks|prevent biters being on newly generated chunks]] if desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all nearby enemies ===&lt;br /&gt;
&lt;br /&gt;
This will kill all biters, bases and worms in a configurable radius. The default, 250 tiles, is about two zoomed-out screen widths on full HD. After destruction, it shows how many objects were destroyed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local pp = game.player.position&lt;br /&gt;
local cnt = 0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;, radius=250, position=pp })) do&lt;br /&gt;
	cnt = cnt+1&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
 end	&lt;br /&gt;
game.player.print(cnt)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable peaceful mode ===&lt;br /&gt;
Enabling peaceful mode prevents biter attacks until provoked. Substitute true for false to disable. Already existing biters are not affected by this command so attacks could continue for a while after activating peaceful mode.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.peaceful_mode = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable biter expansion ===&lt;br /&gt;
Biter expansion allows biters to create new nests, it is enabled by default. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_expansion.enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Prevent biters being on newly generated chunks ===&lt;br /&gt;
On newly generated chunks no biters will be present, however all current biters will remain unaffected. Equivalent of setting the Enemy Base Size to None under the Terrain settings during map generation but achieved mid game by [[#Change map generation settings|changing map generation settings]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.autoplace_controls[&amp;quot;enemy-base&amp;quot;].size = &amp;quot;none&amp;quot;&lt;br /&gt;
surface.map_gen_settings = mgs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Player character scripts ==&lt;br /&gt;
Commands concerning the player directly.&lt;br /&gt;
=== Get player position ===&lt;br /&gt;
Prints coordinates of your current position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.position.x .. &amp;quot;, &amp;quot; .. game.player.position.y)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Teleport player ===&lt;br /&gt;
Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.teleport({X, Y})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To teleport to the world&#039;s origin, use 0,0.&lt;br /&gt;
&lt;br /&gt;
=== Enable god mode ===&lt;br /&gt;
God mode removes your player character allowing you to fly over obstacles and take no damage.&lt;br /&gt;
&lt;br /&gt;
Disassociate your controls from the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.character=nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, hover the mouse over the useless player and destroy it by typing:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.destroy()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To undo, spawn a player character. This will spawn a new player at the spawn point of the world, and connect your controls to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.create_character()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable long reach ===&lt;br /&gt;
Enables long reach, which allows the player to build and interact with entities at a greater distance. The default reach is 10.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local reach = 10000&lt;br /&gt;
game.player.force.character_build_distance_bonus = reach&lt;br /&gt;
game.player.force.character_reach_distance_bonus = reach&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Enable Research Queue ===&lt;br /&gt;
Enable the research queue for the players current team. Can be done after the game has started if it was forgotten during the map&#039;s setup.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_queue_enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.laboratory_speed_modifier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
1 is normal speed, 2 is double speed 3 is triple etc.&lt;br /&gt;
&lt;br /&gt;
=== Research specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=true&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unresearch specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;electric-energy-distribution-1&#039;, 0)&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;steel-processing&#039;, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling specific recipes ===&lt;br /&gt;
The internal recipe/item names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;electric-energy-interface&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;rocket-silo&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes.loader.enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;fast-loader&amp;quot;].enabled = true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;express-loader&amp;quot;].enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable all recipes ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name, recipe in pairs(game.player.force.recipes) do recipe.enabled = true end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modding tools ==&lt;br /&gt;
A list of the internal names of most things in the vanilla game can also be found on [[data.raw]].&lt;br /&gt;
&lt;br /&gt;
=== Print to console which tile are you have under the player position ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.surface.get_tile(game.player.position).name)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all researched technologies to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	if tech.researched then&lt;br /&gt;
    list[#list+1] = tech.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;techs.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all enabled recipes to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, recipe in pairs(game.player.force.recipes) do &lt;br /&gt;
	if recipe.enabled then&lt;br /&gt;
    list[#list+1] = recipe.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;recipes.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Command line parameters]]&lt;br /&gt;
* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Types/EnergySource&amp;diff=176762</id>
		<title>Types/EnergySource</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Types/EnergySource&amp;diff=176762"/>
		<updated>2019-11-05T21:13:59Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Void energy source */ Where are examples?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Basics ==&lt;br /&gt;
Specifies the way the entity gets its energy.&lt;br /&gt;
=== type ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/string]]&lt;br /&gt;
&lt;br /&gt;
Mandatory. Only valid values are &amp;quot;electric&amp;quot;, &amp;quot;burner&amp;quot;, &amp;quot;heat&amp;quot;, &amp;quot;fluid&amp;quot; or &amp;quot;void&amp;quot;, it specifies the type of the energy source to be used.&lt;br /&gt;
&lt;br /&gt;
=== emissions_per_minute ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 0&lt;br /&gt;
&lt;br /&gt;
Optional. Preferred over using &amp;lt;code&amp;gt;emissions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;emissions_per_second_per_watt&amp;lt;/code&amp;gt;. The pollution an entity emits per minute at full energy consumption. &amp;lt;code&amp;gt;emissions_per_minute&amp;lt;/code&amp;gt; is exactly the value that is shown in the entity tooltip.&lt;br /&gt;
&lt;br /&gt;
=== emissions_per_second_per_watt ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 0&lt;br /&gt;
&lt;br /&gt;
Optional. Does the same thing as &amp;lt;code&amp;gt;emissions_per_minute&amp;lt;/code&amp;gt; but will be removed at some point.&lt;br /&gt;
&lt;br /&gt;
=== emissions ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 0&lt;br /&gt;
&lt;br /&gt;
Optional. Does the same thing as &amp;lt;code&amp;gt;emissions_per_second_per_watt&amp;lt;/code&amp;gt; but will be removed at some point.&lt;br /&gt;
&lt;br /&gt;
=== render_no_power_icon ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/bool]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: true&lt;br /&gt;
&lt;br /&gt;
Optional. Whether to render the [[File:Electricity-icon-red.png|50px]] icon on the entity if it is low on power. Also applies to [[File:Fuel-icon-red.png|50px]] when using a burner energy source.&lt;br /&gt;
&lt;br /&gt;
=== render_no_network_icon ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/bool]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: true&lt;br /&gt;
&lt;br /&gt;
Optional. Whether to render the [[File:Electricity-icon-unplugged.png|50px]] icon on the entity if it is not connected to a electric network.&lt;br /&gt;
&lt;br /&gt;
== Electric energy source ==&lt;br /&gt;
=== buffer_capacity ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Energy]]&lt;br /&gt;
&lt;br /&gt;
Optional. How much power the entity holds.&lt;br /&gt;
=== usage_priority ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/ElectricUsagePriority]]&lt;br /&gt;
&lt;br /&gt;
Mandatory.&lt;br /&gt;
=== input_flow_limit ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Energy]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: max double&lt;br /&gt;
&lt;br /&gt;
Optional. How fast the energy can flow into the entity. 0 means 0.&lt;br /&gt;
=== output_flow_limit ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Energy]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: max double&lt;br /&gt;
&lt;br /&gt;
Optional. How fast the energy can flow out of the entity. 0 means 0.&lt;br /&gt;
&lt;br /&gt;
=== drain ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Energy]]&lt;br /&gt;
&lt;br /&gt;
Optional.&lt;br /&gt;
&lt;br /&gt;
== Burner ==&lt;br /&gt;
=== fuel_inventory_size ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/ItemStackIndex]]&lt;br /&gt;
&lt;br /&gt;
Mandatory.&lt;br /&gt;
&lt;br /&gt;
=== burnt_inventory_size ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/ItemStackIndex]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 0&lt;br /&gt;
&lt;br /&gt;
Optional.&lt;br /&gt;
&lt;br /&gt;
=== smoke ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/table]] of [[Types/SmokeSource]]&lt;br /&gt;
&lt;br /&gt;
Optional. Array of 1 or more smoke sources.&lt;br /&gt;
&lt;br /&gt;
=== light_flicker ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/LightFlickeringDefinition]]&lt;br /&gt;
&lt;br /&gt;
Optional.&lt;br /&gt;
&lt;br /&gt;
=== effectivity ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 1&lt;br /&gt;
&lt;br /&gt;
Optional. 1 means 100% effectivity. Must be greater than 0. Multiplier of the energy output.&lt;br /&gt;
&lt;br /&gt;
=== fuel_category ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/string]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: &amp;quot;chemical&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Optional. The energy source can be used with fuel from this [[Prototype/FuelCategory|fuel category]]. For a list on built-in categories, see [[Data.raw#fuel-category]].&lt;br /&gt;
&lt;br /&gt;
=== fuel_categories ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/table]] of [[Types/string]]&lt;br /&gt;
&lt;br /&gt;
Optional. Same as above, only one of them can exist. For a list on built-in categories, see [[Data.raw#fuel-category]].&lt;br /&gt;
&lt;br /&gt;
== Heat energy source ==&lt;br /&gt;
=== max_temperature ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
Mandatory. max_temperature must be &amp;gt;= default_temperature.&lt;br /&gt;
&lt;br /&gt;
=== default_temperature ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 15&lt;br /&gt;
&lt;br /&gt;
Optional.&lt;br /&gt;
&lt;br /&gt;
=== specific_heat ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Energy]]&lt;br /&gt;
&lt;br /&gt;
Mandatory.&lt;br /&gt;
&lt;br /&gt;
=== max_transfer ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Energy]]&lt;br /&gt;
&lt;br /&gt;
Mandatory.&lt;br /&gt;
&lt;br /&gt;
=== min_temperature_gradient ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 1&lt;br /&gt;
&lt;br /&gt;
Optional.&lt;br /&gt;
&lt;br /&gt;
=== min_working_temperature ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 15&lt;br /&gt;
&lt;br /&gt;
Optional. min_working_temperature must be &amp;gt;= default_temperature. min_working_temperature must be &amp;lt;= max_temperature.&lt;br /&gt;
&lt;br /&gt;
=== minimum_glow_temperature ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/float]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 1&lt;br /&gt;
&lt;br /&gt;
=== pipe_covers ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Sprite4Way]]&lt;br /&gt;
&lt;br /&gt;
=== heat_pipe_covers ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Sprite4Way]]&lt;br /&gt;
&lt;br /&gt;
=== heat_picture ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Sprite4Way]]&lt;br /&gt;
&lt;br /&gt;
=== heat_glow ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Sprite4Way]]&lt;br /&gt;
&lt;br /&gt;
=== connections ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/table]] of [[Types/HeatConnection]]&lt;br /&gt;
&lt;br /&gt;
Optional. The table may only contain up to 32 connections.&lt;br /&gt;
&lt;br /&gt;
=== pipe_covers ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Sprite4Way]]&lt;br /&gt;
&lt;br /&gt;
Optional.&lt;br /&gt;
&lt;br /&gt;
== Void energy source ==&lt;br /&gt;
Void is free energy, there are no additional entries required.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
  energy_source = {type = &amp;quot;void&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Fluid energy source ==&lt;br /&gt;
=== fluid_box ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/FluidBox]]&lt;br /&gt;
&lt;br /&gt;
Mandatory.&lt;br /&gt;
All standard fluid box configurations are acceptable, but the type must be &amp;quot;input&amp;quot; or &amp;quot;input-output&amp;quot; to function correctly.&lt;br /&gt;
Scale_fluid_usage, fluid_usage_per_tick or a filter on the fluidbox must be set to be able to calculate the fluid usage of the energy source.&lt;br /&gt;
&lt;br /&gt;
=== smoke ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/table]] of [[Types/SmokeSource]]&lt;br /&gt;
&lt;br /&gt;
Optional. Array of 1 or more smoke sources.&lt;br /&gt;
&lt;br /&gt;
=== light_flicker ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/LightFlickeringDefinition]]&lt;br /&gt;
&lt;br /&gt;
Optional.&lt;br /&gt;
&lt;br /&gt;
=== effectivity ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 1&lt;br /&gt;
&lt;br /&gt;
Optional. 1 means 100% effectivity. Must be greater than 0. Multiplier of the energy output.&lt;br /&gt;
&lt;br /&gt;
=== burns_fluid ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/bool]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: false&lt;br /&gt;
&lt;br /&gt;
Optional. If set to true, the energy source will calculate power based on the fluid&#039;s fuel_value entry, else it will calculate based on fluid temperature, like [[Prototype/Generator]].&lt;br /&gt;
&lt;br /&gt;
=== scale_fluid_usage ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/bool]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: false&lt;br /&gt;
&lt;br /&gt;
Optional. If set to true, the energy source will consume as much fluid as required to produce the desired power, if set to false it will consume as much as it is allowed to, wasting any excess.&lt;br /&gt;
&lt;br /&gt;
=== fluid_usage_per_tick ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 0&lt;br /&gt;
&lt;br /&gt;
Optional. The number of fluid units the energy source uses per tick.&lt;br /&gt;
If used with scale_fluid_usage, this specifies the maximum. If this value is not set, scale_energy_usage = false and a fluid box filter is set, the game will attempt to calculate this value from the fluid box filter&#039;s fluid&#039;s fuel_value or heat_capacity and the entity&#039;s energy_usage. If burns_fluid is false, maximum_temperature will also be used.&lt;br /&gt;
&lt;br /&gt;
=== maximum_temperature ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: unlimited&lt;br /&gt;
&lt;br /&gt;
If it is specified while scale_fluid_usage = false and fluid_usage_per_tick is not specified, the game will use this value to calculate fluid_usage_per_tick.&lt;br /&gt;
&lt;br /&gt;
{{Prototype property type usage|{{FULLPAGENAME}}}}&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=176761</id>
		<title>User:Darkfrei/script</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=176761"/>
		<updated>2019-11-05T21:13:15Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Add new oil patch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches randomly without collisions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
 /c local position = nil&lt;br /&gt;
 for i=1,9 do&lt;br /&gt;
   position = game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
   if position then &lt;br /&gt;
     game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position=position})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Respawn enemies ===&lt;br /&gt;
This creates one respawner every 32x32 tiles:&lt;br /&gt;
&lt;br /&gt;
 /c local surface = game.player.surface&lt;br /&gt;
 for c in surface.get_chunks() do&lt;br /&gt;
   local position = surface.find_non_colliding_position(&amp;quot;biter-spawner&amp;quot;, {x=c.x*32+16, y=c.y*32+16}, 10, 3)&lt;br /&gt;
   if position and surface.is_chunk_generated(c) then&lt;br /&gt;
     surface.create_entity{name=&amp;quot;biter-spawner&amp;quot;, position=position}&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Print all mods with versions to the log file ===&lt;br /&gt;
For data stage:&lt;br /&gt;
  local mod_list = {}&lt;br /&gt;
  for i, v in pairs (mods) do&lt;br /&gt;
    table.insert (mod_list, i .. &#039;_&#039; ..v )&lt;br /&gt;
  end&lt;br /&gt;
  log (&#039;mods: &#039; .. serpent.line (mod_list))&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=176588</id>
		<title>User:Darkfrei/script</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=176588"/>
		<updated>2019-10-14T18:58:49Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Print all mods with versions to the log file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches randomly without collisions:&lt;br /&gt;
&lt;br /&gt;
 /c local position = nil&lt;br /&gt;
 for i=1,9 do&lt;br /&gt;
   position = game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
   if position then &lt;br /&gt;
     game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position=position})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
=== Respawn enemies ===&lt;br /&gt;
This creates one respawner every 32x32 tiles:&lt;br /&gt;
&lt;br /&gt;
 /c local surface = game.player.surface&lt;br /&gt;
 for c in surface.get_chunks() do&lt;br /&gt;
   local position = surface.find_non_colliding_position(&amp;quot;biter-spawner&amp;quot;, {x=c.x*32+16, y=c.y*32+16}, 10, 3)&lt;br /&gt;
   if position and surface.is_chunk_generated(c) then&lt;br /&gt;
     surface.create_entity{name=&amp;quot;biter-spawner&amp;quot;, position=position}&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Print all mods with versions to the log file ===&lt;br /&gt;
For data stage:&lt;br /&gt;
  local mod_list = {}&lt;br /&gt;
  for i, v in pairs (mods) do&lt;br /&gt;
    table.insert (mod_list, i .. &#039;_&#039; ..v )&lt;br /&gt;
  end&lt;br /&gt;
  log (&#039;mods: &#039; .. serpent.line (mod_list))&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=176587</id>
		<title>User:Darkfrei/script</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=176587"/>
		<updated>2019-10-14T18:58:27Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches randomly without collisions:&lt;br /&gt;
&lt;br /&gt;
 /c local position = nil&lt;br /&gt;
 for i=1,9 do&lt;br /&gt;
   position = game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
   if position then &lt;br /&gt;
     game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position=position})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
=== Respawn enemies ===&lt;br /&gt;
This creates one respawner every 32x32 tiles:&lt;br /&gt;
&lt;br /&gt;
 /c local surface = game.player.surface&lt;br /&gt;
 for c in surface.get_chunks() do&lt;br /&gt;
   local position = surface.find_non_colliding_position(&amp;quot;biter-spawner&amp;quot;, {x=c.x*32+16, y=c.y*32+16}, 10, 3)&lt;br /&gt;
   if position and surface.is_chunk_generated(c) then&lt;br /&gt;
     surface.create_entity{name=&amp;quot;biter-spawner&amp;quot;, position=position}&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Print all mods with versions to the log file ===&lt;br /&gt;
  local mod_list = {}&lt;br /&gt;
  for i, v in pairs (mods) do&lt;br /&gt;
    table.insert (mod_list, i .. &#039;_&#039; ..v )&lt;br /&gt;
  end&lt;br /&gt;
  log (&#039;mods: &#039; .. serpent.line (mod_list))&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=176586</id>
		<title>User:Darkfrei/script</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=176586"/>
		<updated>2019-10-14T18:58:01Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches randomly without collisions:&lt;br /&gt;
&lt;br /&gt;
 /c local position = nil&lt;br /&gt;
 for i=1,9 do&lt;br /&gt;
   position = game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
   if position then &lt;br /&gt;
     game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position=position})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
=== Respawn enemies ===&lt;br /&gt;
This creates one respawner every 32x32 tiles:&lt;br /&gt;
&lt;br /&gt;
 /c local surface = game.player.surface&lt;br /&gt;
 for c in surface.get_chunks() do&lt;br /&gt;
   local position = surface.find_non_colliding_position(&amp;quot;biter-spawner&amp;quot;, {x=c.x*32+16, y=c.y*32+16}, 10, 3)&lt;br /&gt;
   if position and surface.is_chunk_generated(c) then&lt;br /&gt;
     surface.create_entity{name=&amp;quot;biter-spawner&amp;quot;, position=position}&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Print all mods with versions to the log file ===&lt;br /&gt;
local mod_list = {}&lt;br /&gt;
for i, v in pairs (mods) do&lt;br /&gt;
  table.insert (mod_list, i .. &#039;_&#039; ..v )&lt;br /&gt;
end&lt;br /&gt;
log (&#039;mods: &#039; .. serpent.line (mod_list))&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=176585</id>
		<title>User:Darkfrei/script</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=176585"/>
		<updated>2019-10-14T18:57:39Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Respawn enemies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches randomly without collisions:&lt;br /&gt;
&lt;br /&gt;
 /c local position = nil&lt;br /&gt;
 for i=1,9 do&lt;br /&gt;
   position = game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
   if position then &lt;br /&gt;
     game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position=position})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
=== Respawn enemies ===&lt;br /&gt;
This creates one respawner every 32x32 tiles:&lt;br /&gt;
&lt;br /&gt;
 /c local surface = game.player.surface&lt;br /&gt;
 for c in surface.get_chunks() do&lt;br /&gt;
   local position = surface.find_non_colliding_position(&amp;quot;biter-spawner&amp;quot;, {x=c.x*32+16, y=c.y*32+16}, 10, 3)&lt;br /&gt;
   if position and surface.is_chunk_generated(c) then&lt;br /&gt;
     surface.create_entity{name=&amp;quot;biter-spawner&amp;quot;, position=position}&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Print all mods with versions to the log file ===&lt;br /&gt;
&lt;br /&gt;
local mod_list = {}&lt;br /&gt;
for i, v in pairs (mods) do&lt;br /&gt;
  table.insert (mod_list, i .. &#039;_&#039; ..v )&lt;br /&gt;
end&lt;br /&gt;
log (&#039;mods: &#039; .. serpent.line (mod_list))&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Sulfuric_acid&amp;diff=176577</id>
		<title>Talk:Sulfuric acid</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Sulfuric_acid&amp;diff=176577"/>
		<updated>2019-10-12T15:44:37Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: Created page with &amp;quot;Consumed by: &amp;quot;Processing unit&amp;quot;, &amp;quot;Battery&amp;quot;, &amp;quot;Fill sulfuric acid barrel&amp;quot;, but not by mining drills? --~~~~&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Consumed by: &amp;quot;Processing unit&amp;quot;, &amp;quot;Battery&amp;quot;, &amp;quot;Fill sulfuric acid barrel&amp;quot;, but not by mining drills? --[[User:Darkfrei|Darkfrei]] ([[User talk:Darkfrei|talk]]) 15:44, 12 October 2019 (UTC)&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Multiplayer&amp;diff=176488</id>
		<title>Talk:Multiplayer</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Multiplayer&amp;diff=176488"/>
		<updated>2019-10-06T19:12:43Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Why has muliplayer a own page with both the installation and describing the multiplayer? My suggestion is to create a multiplayer headless set-up guide in the installation guide.[https://wiki.factorio.com/index.php?title=Install_guide]. What do you think? &amp;lt;small&amp;gt;&amp;lt;span class=&amp;quot;autosigned&amp;quot;&amp;gt;—&amp;amp;nbsp;Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Hayertjez|Hayertjez]] ([[User talk:Hayertjez|talk]] • [[Special:Contributions/Hayertjez|contribs]]) &amp;lt;/span&amp;gt;&amp;lt;/small&amp;gt;&amp;lt;!-- Template:Unsigned --&amp;gt;&lt;br /&gt;
:Hello, [[User:Gangsir|Gangsir]] and I think that the installation guide should be solely for installing the game. People who&#039;ll be looking for a guide to set up a multiplayer server, will most likely look on the multiplayer page. I do however encourage you to write your headless set-up guide on this page, if it describes the progress of getting it done better than what is currently on the page. [[User:TheWombatGuru|TheWombatGuru]] ([[User talk:TheWombatGuru|talk]]) - &amp;lt;b&amp;gt;Factorio wiki administrator&amp;lt;/b&amp;gt; 11:46, 13 October 2016 (UTC)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Can we have the https://wiki.factorio.com/Forces for more information about it? There is a lot of diplomacy, roles, permissions etc. inside. --[[User:Darkfrei|Darkfrei]] ([[User talk:Darkfrei|talk]]) 19:12, 6 October 2019 (UTC)&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Prototype/Vehicle&amp;diff=176313</id>
		<title>Talk:Prototype/Vehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Prototype/Vehicle&amp;diff=176313"/>
		<updated>2019-09-23T16:23:00Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;energy_per_hit_point - what is it? --[[User:Darkfrei|Darkfrei]] ([[User talk:Darkfrei|talk]]) 20:23, 16 September 2019 (UTC)&lt;br /&gt;
: It is now documented. -- [[User:Bilka|Bilka]] ([[User talk:Bilka|talk]]) - &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Admin&amp;lt;/span&amp;gt; 11:56, 23 September 2019 (UTC)&lt;br /&gt;
:: Thanks! --[[User:Darkfrei|Darkfrei]] ([[User talk:Darkfrei|talk]]) 16:23, 23 September 2019 (UTC)&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Chests&amp;diff=176247</id>
		<title>Talk:Chests</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Chests&amp;diff=176247"/>
		<updated>2019-09-20T10:18:43Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Where is the infinity chest? --[[User:Darkfrei|Darkfrei]] ([[User talk:Darkfrei|talk]]) 08:36, 20 September 2019 (UTC)&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Chests&amp;diff=176246</id>
		<title>Talk:Chests</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Chests&amp;diff=176246"/>
		<updated>2019-09-20T08:36:12Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: Created page with &amp;quot;Wherever infinity chest? --~~~~&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Wherever infinity chest? --[[User:Darkfrei|Darkfrei]] ([[User talk:Darkfrei|talk]]) 08:36, 20 September 2019 (UTC)&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Prototype/Vehicle&amp;diff=176211</id>
		<title>Talk:Prototype/Vehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Prototype/Vehicle&amp;diff=176211"/>
		<updated>2019-09-16T20:23:19Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;energy_per_hit_point - what is it? --[[User:Darkfrei|Darkfrei]] ([[User talk:Darkfrei|talk]]) 20:23, 16 September 2019 (UTC)&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Prototype/Vehicle&amp;diff=176210</id>
		<title>Talk:Prototype/Vehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Prototype/Vehicle&amp;diff=176210"/>
		<updated>2019-09-16T20:23:07Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: Created page with &amp;quot;energy_per_hit_point - what is it?&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;energy_per_hit_point - what is it?&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Fuel&amp;diff=173643</id>
		<title>Fuel</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Fuel&amp;diff=173643"/>
		<updated>2019-05-31T18:21:13Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
&#039;&#039;&#039;Fuel&#039;&#039;&#039; can be inserted into [[burner devices]] and burned to power them. Different types of fuel provide different amounts of energy, measured in megajoules (MJ).&lt;br /&gt;
&lt;br /&gt;
== Types ==&lt;br /&gt;
&lt;br /&gt;
This is a list of all items usable as fuel in burner devices, ordered by fuel value:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Item !! Fuel value !! Fuel value per raw total !! Fuel value&amp;lt;br&amp;gt;per stack !! Vehicle&amp;lt;br&amp;gt;acceleration !! Vehicle&amp;lt;br&amp;gt;top speed !! Train max speed&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|Wood}} || 2 MJ || 2 MJ per raw wood || 200 MJ || 100% || 100% || 259.2 km/h (72 m/s)&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|Coal}} || 4 MJ || 4 MJ per coal || 200 MJ || 100% || 100% || 259.2 km/h (72 m/s)&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|Solid fuel}} || 12 MJ || 0.96 MJ per unit of [[crude oil]]&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; || 600 MJ || 120% || 105% || 272.2 km/h (~75.6 m/s)&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|Rocket fuel}} || 100 MJ || 0.8 MJ per unit of [[crude oil]]&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; || 1 GJ || 180% || 115% || 298.1 km/h (83 m/s)&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|Nuclear fuel}} || 1.21 GJ || 9.68 MJ per unit of [[crude oil]]&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&amp;lt;br/&amp;gt;1.21 GJ per [[Uranium-235]] || 1.21 GJ || 250% || 115% || 298.1 km/h (83 m/s)&lt;br /&gt;
|-&lt;br /&gt;
| {{imagelink|Uranium fuel cell}} || 8 GJ&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; || 507 MJ per [[uranium ore]]&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt; || 400 GJ || Unusable || Unusable|| Unusable&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sup&amp;gt;(1)&amp;lt;/sup&amp;gt; For the purposes of in-game speed display, the game assumes 1 tile = 1 meter. I.e., a train on basic fuel travels at 72 &#039;&#039;&#039;tiles&#039;&#039;&#039; per second at full speed, and so on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sup&amp;gt;(2)&amp;lt;/sup&amp;gt; This assumes the crude oil is processed completely into solid fuel using [[advanced oil processing]] and [[heavy oil cracking]] as intermediate steps, but not [[light oil cracking]]. More efficient methods are possible.  In practice, the [[petroleum gas]] is more likely to be used for something other than solid fuel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sup&amp;gt;(3)&amp;lt;/sup&amp;gt; This fuel type can only be used in a [[nuclear reactor]]. Unlike other fuel types, it cannot be placed into standard burners.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;sup&amp;gt;(4)&amp;lt;/sup&amp;gt; Assuming that all U-238 is enriched, all used up cells are reprocessed, and there is no reactor neighbor bonus.&lt;br /&gt;
&lt;br /&gt;
== Consumption ==&lt;br /&gt;
&lt;br /&gt;
The following formula can be used to find how long a fuel will last in a device:&lt;br /&gt;
&amp;lt;code&amp;gt;Burn time (s) = Fuel value (MJ) ÷ Energy consumption (MW)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Trivia ==&lt;br /&gt;
&lt;br /&gt;
* Though the top speeds given by solid fuel, rocket fuel and nuclear fuel are presented as +5%, +15% and +15% respectively, this seems to only be true for trains. The top speeds for cars and tanks are instead approximately +9.5%, +34% and +58% respectively when these fuels are used.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
{{history|0.15.0|&lt;br /&gt;
* Fuel type affects vehicle acceleration and top speed.}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Burner devices]]&lt;br /&gt;
** {{Imagelink|Burner inserter}} {{Imagelink|Burner mining drill}} {{Imagelink|Boiler}} {{Imagelink|Stone furnace}} {{Imagelink|Steel furnace}} {{Imagelink|Locomotive}} {{Imagelink|Car}} {{Imagelink|Tank}} &lt;br /&gt;
* [[Electric system]]&lt;br /&gt;
* [https://www.reddit.com/r/factorio/comments/67xgge/nuclear_ratios/ Nuclear Ratios]&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=173419</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=173419"/>
		<updated>2019-05-18T12:55:23Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Reveal the map around the player */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Overview ==&lt;br /&gt;
The &#039;&#039;&#039;Console&#039;&#039;&#039; is Factorio&#039;s command-line interface.&lt;br /&gt;
&lt;br /&gt;
The in-game console is used for:&lt;br /&gt;
&lt;br /&gt;
* Chatting with other players&lt;br /&gt;
* Running commands / scripts / cheats&lt;br /&gt;
* Occasional status updates&lt;br /&gt;
&lt;br /&gt;
There are three types of commands:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[#Normal commands|Normal]]&#039;&#039;&#039; - Display information about the game and customize your experience.&lt;br /&gt;
* &#039;&#039;&#039;[[#Multiplayer commands|Multiplayer]]&#039;&#039;&#039; - Message filtering, banning users, etc.&lt;br /&gt;
* &#039;&#039;&#039;[[#Scripting and cheat commands|Scripting/Cheating]]&#039;&#039;&#039; - Run small Lua scripts (but they &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;disable achievements for the save game&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== Using the console ===&lt;br /&gt;
The console display can be toggled with the {{keybinding|/}} (slash) or {{keybinding|~}} (tilde) keys.&lt;br /&gt;
&lt;br /&gt;
You can customize the keys via &#039;&#039;&#039;Options Menu → Keyboard → Toggle Lua console&#039;&#039;&#039;.&lt;br /&gt;
When the console is open, you&#039;ll see a blinking cursor at the bottom of the screen; type your message or command and hit &#039;&#039;&#039;Return&#039;&#039;&#039; to send it (this will also close the console).&lt;br /&gt;
Documentation about message and command prefixes can be found further down this page.&lt;br /&gt;
&lt;br /&gt;
The console supports [[rich text]] tags. These tags are useful for sharing blueprints, marking map locations in chat or adding icons to map markers and train stations. Ctrl+alt clicking the map or ground will automatically insert a gps tag and post it into the console. Shift clicking most things with the console open will insert a tag for that thing into chat. &lt;br /&gt;
&lt;br /&gt;
When console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages).&lt;br /&gt;
Note that by default, all executed commands are made visible to all users. You can set the fade out time via &#039;&#039;&#039;Options Menu → Other Settings → Message Delay&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you want to immediately hide the console, open the console and then press &#039;&#039;&#039;Escape&#039;&#039;&#039; key (or press &#039;&#039;&#039;Return&#039;&#039;&#039; without entering any message/command).&lt;br /&gt;
This not only closes the console, but it also hides all the recent messages/commands.&lt;br /&gt;
The console can be cleared with the &#039;&#039;&#039;/clear&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Note that the console can also accept raw Lua code as well as game commands.&lt;br /&gt;
&lt;br /&gt;
=== Console history ===&lt;br /&gt;
&lt;br /&gt;
The console has an inbuilt history; it&#039;s a bit like a text editor where only one line of text is displayed at a time.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;uarr;}} and {{keybinding|&amp;amp;darr;}} keys to scroll through the console history.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;larr;}} and {{keybinding|&amp;amp;rarr;}} keys to cursor through the currently displayed message or command, which you can edit (delete, insert, etc.) and resend (by pressing &#039;&#039;&#039;Return&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
The {{keybinding|Tab}} key will auto-complete commands and player ids.&lt;br /&gt;
&lt;br /&gt;
== Normal commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| /alerts &amp;lt;enable/disable/mute/unmute&amp;gt; &amp;lt;alert&amp;gt;&lt;br /&gt;
| /alerts disable turret_fire&lt;br /&gt;
| Enables, disables, mutes, or unmutes the given alert type. Available alerts: entity_destroyed, entity_under_attack, not_enough_construction_robots, no_material_for_construction, not_enough_repair packs, turret_fire, custom, no_storage.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /clear&lt;br /&gt;
| /clear&lt;br /&gt;
| Clears the console.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /color &amp;lt;color&amp;gt;&lt;br /&gt;
| /color 20 255 255 100&lt;br /&gt;
| Changes your color. Can either be one of the pre-defined colors or [[:Wikipedia:RGBA_color_space|RGBA value]] in the format of “# # # #”. Available colors: default, red, green, blue, orange, yellow, pink, purple, white, black, gray, brown, cyan, acid.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /evolution&lt;br /&gt;
| /evolution&lt;br /&gt;
| Prints info about the alien evolution factor.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /help [command]&lt;br /&gt;
| /help&lt;br /&gt;
| Prints a list of available commands, the optional argument can specify the command that should be described.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /h [command]&lt;br /&gt;
| /h&lt;br /&gt;
| Same as /help.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /mute-programmable-speaker &amp;lt;mute/unmute&amp;gt; &amp;lt;local/everyone&amp;gt;&lt;br /&gt;
| /mute-programmable-speaker mute local&lt;br /&gt;
| Mutes or unmutes the global sounds created by the Programmable Speaker. Use “local” to mute just the local client. Admins can use “everyone” to mute the sounds for everyone on the server.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /perf-avg-frames &amp;lt;number&amp;gt;&lt;br /&gt;
| /perf-avg-frames 100&lt;br /&gt;
| Number of ticks/updates used to average performance counters. Default is 100. Value of 5-10 is recommended for fast convergence, but numbers will jitter more rapidly.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /permissions&lt;br /&gt;
| /permissions&lt;br /&gt;
| Opens the permissions GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /screenshot [x resolution] [y resolution] [zoom]&lt;br /&gt;
| /screenshot&lt;br /&gt;
| Takes a screenshot with the GUI hidden, centered on the player. It is saved in the &amp;quot;script-output&amp;quot; subfolder of your [[User data directory]].  Resolution is optional and defaults to the current window size. Zoom is optional and defaults to 1.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /seed&lt;br /&gt;
| /seed&lt;br /&gt;
| Prints the starting map seed.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /time&lt;br /&gt;
| /time&lt;br /&gt;
| Prints info about how old the map is.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| Toggles logging all input actions performed by the game. This value isn’t persisted between game restarts and only affects your local game in multiplayer sessions.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| Used to investigate [[Desynchronization#Using_heavy_mode_command|desyncs]]. Will slow down the game and make multiplayer unplayable.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| Toggles if the rockets sent button is shown in the upper left corner of the screen.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unlock-shortcut-bar&lt;br /&gt;
| /unlock-shortcut-bar&lt;br /&gt;
| Unlocks all shortcut bar items.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /version&lt;br /&gt;
| /version&lt;br /&gt;
| Prints the current game version.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Multiplayer commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;message&amp;gt;&lt;br /&gt;
| Hello team!&lt;br /&gt;
| Console input that does not start with {{keybinding|/}} is shown as a chat message to your team.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /admin&lt;br /&gt;
| /admin&lt;br /&gt;
| Opens the player management GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /admins&lt;br /&gt;
| /admins&lt;br /&gt;
| Prints a list of game admins.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ban &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /ban xTROLLx Throwing grenades in base&lt;br /&gt;
| Bans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /banlist &amp;lt;add/remove/get/clear&amp;gt; &amp;lt;player&amp;gt;&lt;br /&gt;
| /banlist get&lt;br /&gt;
| Adds or removes a player from the banlist. Same as /ban or /unban.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /config &amp;lt;get/set&amp;gt; &amp;lt;option&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
| /config set password hunter2&lt;br /&gt;
| Gets or sets various multiplayer game settings. Available configs are: afk-auto-kick, allow-commands, allow-debug-settings, autosave-interval, autosave-only-on-server, ignore-player-limit-for-returning-players, max-players, max-upload-speed, only-admins-can-pause, password, require-user-verification, visibility-lan, visibility-public.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /delete-blueprint-library &amp;lt;player&amp;gt;&lt;br /&gt;
| /delete-blueprint-library everybody confirm&lt;br /&gt;
| Deletes the blueprint library storage for the given offline player from the save file. Enter “everybody confirm” to delete the storage of all offline players.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /demote &amp;lt;player&amp;gt;&lt;br /&gt;
| /demote AzureDiamond&lt;br /&gt;
| Demotes the player from admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /ignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /ignore Cthon98&lt;br /&gt;
| Prevents the chat from showing messages from this player. Admin messages are still shown.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ignores&lt;br /&gt;
| /ignores&lt;br /&gt;
| Prints a list of ignored players.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /kick &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /kick xTROLLx Throwing grenades in base&lt;br /&gt;
| Kicks the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mute &amp;lt;player&amp;gt;&lt;br /&gt;
| /mute Cthon98&lt;br /&gt;
| Prevents the player from saying anything in chat.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mutes&lt;br /&gt;
| /mutes&lt;br /&gt;
| All players that are muted (can’t talk in chat).&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /open &amp;lt;player&amp;gt;&lt;br /&gt;
| /open AzureDiamond&lt;br /&gt;
| Opens another player’s inventory.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /o &amp;lt;player&amp;gt;&lt;br /&gt;
| /o AzureDiamond&lt;br /&gt;
| Same as /open.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /players [online/o/count/c]&lt;br /&gt;
| /players&lt;br /&gt;
| Prints a list of players in the game. (parameter online/o, it prints only players that are online, count/c prints only count)&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /promote &amp;lt;player&amp;gt;&lt;br /&gt;
| /promote AzureDiamond&lt;br /&gt;
| Promotes the player to admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /purge &amp;lt;player&amp;gt;&lt;br /&gt;
| /purge Cthon98&lt;br /&gt;
| Clears all the messages from this player from the chat log.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /reply &amp;lt;message&amp;gt;&lt;br /&gt;
| /reply oh, really?&lt;br /&gt;
| Replies to the last player that whispered to you.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /r &amp;lt;message&amp;gt;&lt;br /&gt;
| /r oh, really?&lt;br /&gt;
| Same as /reply.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /server-save&lt;br /&gt;
| /server-save&lt;br /&gt;
| Saves the game on the server in a multiplayer game.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /shout &amp;lt;message&amp;gt;&lt;br /&gt;
| /shout Hello world!&lt;br /&gt;
| Sends a message to all players including other forces.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /s &amp;lt;message&amp;gt;&lt;br /&gt;
| /s Hello world!&lt;br /&gt;
| Same as /shout.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /swap-players &amp;lt;player&amp;gt; [player]&lt;br /&gt;
| /swap-players AzureDiamond&lt;br /&gt;
| Swaps your character with the given player’s character, or if two players are given swaps the two player characters.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unban &amp;lt;player&amp;gt;&lt;br /&gt;
| /unban xTROLLx&lt;br /&gt;
| Unbans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /unignore Cthon98&lt;br /&gt;
| Allows the chat to show messages from this player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unmute &amp;lt;player&amp;gt;&lt;br /&gt;
| /unmute Cthon98&lt;br /&gt;
| Allows the player to talk in chat again.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /whisper &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /whisper AzureDiamond thats what I see&lt;br /&gt;
| Sends a message to the specified player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /w &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /w AzureDiamond thats what I see&lt;br /&gt;
| Same as /whisper.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /whitelist &amp;lt;add/remove/get/clear&amp;gt; [player]&lt;br /&gt;
| /whitelist get&lt;br /&gt;
| Adds or removes a player from the whitelist, where only whitelisted players can join the game. Enter nothing for “player” when using “get” to print a list of all whitelisted players. An empty whitelist disables the whitelist functionality allowing anyone to join.&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scripting and cheat commands ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| /cheat &amp;lt;all&amp;gt;&lt;br /&gt;
| Researches all technologies and enables cheat mode. Using the &#039;&#039;&#039;all&#039;&#039;&#039; option also gives the player some additional items.&lt;br /&gt;
|-&lt;br /&gt;
| /command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /c &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /editor&lt;br /&gt;
| Toggles the map editor.&lt;br /&gt;
|-&lt;br /&gt;
| /measured-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command and measures time it took.&lt;br /&gt;
|-&lt;br /&gt;
| /silent-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command without printing it to the console.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a very powerful feature, which also allows cheating, and as such &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;achievements will be permanently disabled for the save&amp;lt;/span&amp;gt; as soon as you use a script command.&lt;br /&gt;
&lt;br /&gt;
== Basic example scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Use it as calculator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(1234*5678)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zoom beyond normal bounds ===&lt;br /&gt;
Note that zooming too far out can cause performance hits. Be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.zoom=0.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mine faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Craft faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unlock and research all technologies ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_all_technologies()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Undo this with the command in the next section.&lt;br /&gt;
&lt;br /&gt;
=== Unresearch all technologies ===&lt;br /&gt;
This does not reset manually applied bonuses&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	tech.researched=false&lt;br /&gt;
	game.player.force.set_saved_technology_progress(tech, 0)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reset your force ===&lt;br /&gt;
This resets all data for your force, including kill and production statistics, technologies, bonuses and charting status.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.reset()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Always show rail block visualization ===&lt;br /&gt;
Permanently show the rail block visualization instead of only when holding a rail signal. Disable by replacing true with false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.game_view_settings.show_rail_block_visualisation = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inventory manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Cheat mode ===&lt;br /&gt;
Allows for infinite free crafting. Disable by replacing true with false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.cheat_mode=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource tile in-game&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.amount=7500&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can refill all resources in the map with the following command. Change ore.amount to the desired value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c surface = game.player.surface&lt;br /&gt;
for _, ore in pairs(surface.find_entities_filtered({type=&amp;quot;resource&amp;quot;})) do&lt;br /&gt;
    ore.amount = 10000&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add items to the player&#039;s inventory ===&lt;br /&gt;
Replace iron-plate with the [[data.raw|internal name]] of the item desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For instance, here&#039;s a stack of the god-mode energy system interface:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;electric-energy-interface&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a powerful armor with equipment and some tools for construction:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c	local player = game.player&lt;br /&gt;
player.insert{name=&amp;quot;power-armor-mk2&amp;quot;, count = 1}&lt;br /&gt;
local p_armor = player.get_inventory(5)[1].grid&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;personal-roboport-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;night-vision-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
player.insert{name=&amp;quot;construction-robot&amp;quot;, count = 25}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== World manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Reveal the map around the player ===&lt;br /&gt;
&lt;br /&gt;
Reveals the map around the player, similar to a [[radar]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or from start position&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.chart(game.player.surface, {{x = -2000, y = -2000}, {x = 2000, y = 2000}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change 150 to the desired radius, higher values take longer.&lt;br /&gt;
&lt;br /&gt;
=== Hide revealed map ===&lt;br /&gt;
&lt;br /&gt;
Hides all revealed chunks, inverted map revealing.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local force = game.player.force&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  force.unchart_chunk({x = chunk.x, y = chunk.y}, surface)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Delete chunks ===&lt;br /&gt;
If much of the map is revealed, it increases the size of the save file. The following command cancels the generation of all chunks that are currently queued for generation and removes chunks outside a 32 chunks radius around 0,0. Note that this will remove player entities if there are any on these chunks.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface;&lt;br /&gt;
game.player.force.cancel_charting(surface); &lt;br /&gt;
local chunk_radius = 32;&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  if (chunk.x &amp;lt; -chunk_radius or chunk.x &amp;gt; chunk_radius or chunk.y &amp;lt; -chunk_radius or chunk.y &amp;gt; chunk_radius) then&lt;br /&gt;
    surface.delete_chunk(chunk)&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
Enables eternal day.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.always_day=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change game speed ===&lt;br /&gt;
0.5 is half speed, 1 is default, 2 is double speed, etc. Minimum is 0.01. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.speed=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expensive (marathon) or normal mode ===&lt;br /&gt;
To change from normal to expensive mode preset (this changes the research cost and intermediate product cost):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change back to normal:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Freeze time ===&lt;br /&gt;
Stops the advancement of the time if you replace &amp;quot;BOOL&amp;quot; with &amp;quot;true&amp;quot; or unfreezes it if you replace it with &amp;quot;false&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.freeze_daytime=BOOL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.clear_pollution()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Completely turn off pollution ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, surface in pairs(game.surfaces) do&lt;br /&gt;
  surface.clear_pollution()&lt;br /&gt;
end&lt;br /&gt;
game.map_settings.pollution.enabled = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add a lot of pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.pollute(game.player.position, 1000000)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where speakers are, by who ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c speakers = game.player.surface.find_entities_filtered{force = game.player.force, type=&amp;quot;programmable-speaker&amp;quot;}&lt;br /&gt;
for key, speaker in pairs(speakers) do&lt;br /&gt;
    game.player.print(speaker.last_user.name .. &amp;quot; placed a speaker at X=&amp;quot; .. speaker.position.x .. &amp;quot;, Y=&amp;quot; .. speaker.position.y)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable friendly fire for your force ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.friendly_fire = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 11×11 patch of resources, centered on the player character, where the ground is not water.&lt;br /&gt;
The patch it creates is perfectly square but it randomizes the amount similar to natural generation, with fewer ore at the edges and more ore in the center.&lt;br /&gt;
The default numbers result in a patch with 2500-3000 ore.&lt;br /&gt;
&lt;br /&gt;
If you want a larger patch, change &amp;quot;local size = 5&amp;quot; to a larger number.&lt;br /&gt;
A larger patch will have exponentially more ore.&lt;br /&gt;
Entering a number above 30 is not recommended.&lt;br /&gt;
&lt;br /&gt;
If you want a richer patch, change &amp;quot;local density = 10&amp;quot; to a larger number.&lt;br /&gt;
Entering a very large number shouldn&#039;t hurt anything but you probably don&#039;t need to go above 100.&lt;br /&gt;
&lt;br /&gt;
To choose which resource is spawned, change &amp;quot;stone&amp;quot; near the bottom to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, &amp;quot;coal&amp;quot;, or &amp;quot;uranium-ore&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local ore=nil&lt;br /&gt;
local size=5&lt;br /&gt;
local density=10&lt;br /&gt;
for y=-size, size do&lt;br /&gt;
	for x=-size, size do&lt;br /&gt;
		a=(size+1-math.abs(x))*10&lt;br /&gt;
		b=(size+1-math.abs(y))*10&lt;br /&gt;
		if a&amp;lt;b then&lt;br /&gt;
			ore=math.random(a*density-a*(density-8), a*density+a*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if b&amp;lt;a then&lt;br /&gt;
			ore=math.random(b*density-b*(density-8), b*density+b*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if surface.get_tile(game.player.position.x+x, game.player.position.y+y).collides_with(&amp;quot;ground-tile&amp;quot;) then&lt;br /&gt;
			surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=ore, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove resources around the player ===&lt;br /&gt;
Removes all resource patches from the ground in a 50 x 50 area around the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local size=50&lt;br /&gt;
local pos=game.player.position&lt;br /&gt;
&lt;br /&gt;
for _, e in pairs(surface.find_entities_filtered{area={{pos.x-size, pos.y-size},{pos.x+size, pos.y+size}}, type=&amp;quot;resource&amp;quot;}) &lt;br /&gt;
	do e.destroy() &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches in a 3×3 square.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for y=0,2 do&lt;br /&gt;
	for x=0,2 do&lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or randomly without any collision:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local position=nil&lt;br /&gt;
for i=1,9 do&lt;br /&gt;
	position=game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
	if position then &lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position=position})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create 10 fishes ===&lt;br /&gt;
This creates 10 fishes around of player. The player must be on the water edge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local player = game.player&lt;br /&gt;
local surface = player.surface&lt;br /&gt;
for i = 1, 10 do&lt;br /&gt;
  local position = surface.find_non_colliding_position(&#039;fish&#039;, player.position, 10, 1)&lt;br /&gt;
  if not position then return end&lt;br /&gt;
  surface.create_entity {name = &#039;fish&#039;, position = position}&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Count entities ===&lt;br /&gt;
Counts all entities whose name includes the string in local entity.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local entity=&amp;quot;belt&amp;quot;&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local count=0&lt;br /&gt;
for key, ent in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(ent.name,entity) then&lt;br /&gt;
		count=count+1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(count)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emptying all pipes, underground pipes and pumps ===&lt;br /&gt;
Useful when pipes contain a fluid you dont want.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local deleted=0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(entity.name, &amp;quot;pipe&amp;quot;) or &lt;br /&gt;
		string.find(entity.name, &amp;quot;pump&amp;quot;) &lt;br /&gt;
	then&lt;br /&gt;
		for i=1,#entity.fluidbox do&lt;br /&gt;
			deleted = deleted + 1&lt;br /&gt;
			entity.fluidbox[i] = nil;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(&amp;quot;Fluids removed from &amp;quot;..deleted ..&amp;quot; entities&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off cliff generation ===&lt;br /&gt;
Sets size to &amp;quot;none&amp;quot;. Only effective on chunks that are generated after using this command. Use [[#Remove all cliffs]] to delete existing cliffs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local mgs = game.player.surface.map_gen_settings&lt;br /&gt;
mgs.cliff_settings.cliff_elevation_0 = 1024&lt;br /&gt;
game.player.surface.map_gen_settings = mgs&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all cliffs ===&lt;br /&gt;
Removes all cliffs existing cliffs from the world. Use [[#Turn off cliff generation]] to turn off cliff generation in new chunks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, v in pairs(game.player.surface.find_entities_filtered{type=&amp;quot;cliff&amp;quot;}) do&lt;br /&gt;
  v.destroy()&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Delete all decoratives ===&lt;br /&gt;
Delete the decoratives that can be found in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
for c in surface.get_chunks() do&lt;br /&gt;
	surface.destroy_decoratives({{c.x*32, c.y*32}, {c.x*32+32, c.y*32+32}})&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change map generation settings ===&lt;br /&gt;
This allows to change the map generation settings for new chunks; it does not alter already generated chunks. [[#Delete chunks|Deleted chunks]] are affected by the setting change because they are newly generated when they get explored again.&lt;br /&gt;
&lt;br /&gt;
To change resource generation settings, replace &amp;quot;iron-ore&amp;quot; with the [[Data.raw#resource|resource]] that should be changed and replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command. Replace &amp;quot;iron-ore&amp;quot; with &amp;quot;enemy-base&amp;quot; to change the enemy base generation settings. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local resource = &amp;quot;iron-ore&amp;quot;&lt;br /&gt;
local autoplace = surface.map_gen_settings.autoplace_controls&lt;br /&gt;
autoplace[resource].size = &amp;quot;very-high&amp;quot;&lt;br /&gt;
autoplace[resource].frequency = &amp;quot;very-high&amp;quot;&lt;br /&gt;
autoplace[resource].richness = &amp;quot;very-high&amp;quot;&lt;br /&gt;
surface.map_gen_settings.autoplace_controls = autoplace&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change water generation settings, replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.water = &amp;quot;very-high&amp;quot; --[[ size]]&lt;br /&gt;
mgs.terrain_segmentation  = &amp;quot;very-high&amp;quot; --[[ frequency]]&lt;br /&gt;
surface.map_gen_settings = mgs &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enemy/evolution scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Set evolution factor ===&lt;br /&gt;
Ranges from 0 (new game) to 1.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].evolution_factor=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_evolution.time_factor=0&lt;br /&gt;
/c game.map_settings.enemy_evolution.pollution_factor=game.map_settings.enemy_evolution.pollution_factor*2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;2&amp;quot; at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.&lt;br /&gt;
&lt;br /&gt;
=== Kill all biters on the &amp;quot;enemy&amp;quot; force ===&lt;br /&gt;
Note that this will kill only mobile units, spawners will not be killed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all enemies ===&lt;br /&gt;
This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the explored world, so any unexplored parts of the map which still need to be generated will still have enemies. You can [[#Prevent biters being on newly generated chunks|prevent biters being on newly generated chunks]] if desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all nearby enemies ===&lt;br /&gt;
&lt;br /&gt;
This will kill all biters, bases and worms in a configurable radius. The default, 250 tiles, is about two zoomed-out screen widths on full HD. After destruction, it shows how many objects were destroyed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius = 250&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local pp = game.player.position&lt;br /&gt;
local cnt = 0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
    if entity.position.x &amp;gt; pp.x - radius and entity.position.x &amp;lt; pp.x + radius&lt;br /&gt;
        and entity.position.y &amp;gt; pp.y - radius and entity.position.y &amp;lt; pp.y + radius then&lt;br /&gt;
        cnt = cnt+1&lt;br /&gt;
        entity.destroy()&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(cnt)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable peaceful mode ===&lt;br /&gt;
Enabling peaceful mode prevents biter attacks until provoked. Substitute true for false to disable. Already existing biters are not affected by this command so attacks could continue for a while after activating peaceful mode.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.peaceful_mode = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable biter expansion ===&lt;br /&gt;
Biter expansion allows biters to create new nests, it is enabled by default. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_expansion.enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Prevent biters being on newly generated chunks ===&lt;br /&gt;
On newly generated chunks no biters will be present, however all current biters will remain unaffected. Equivalent of setting the Enemy Base Size to None under the Terrain settings during map generation but achieved mid game by [[#Change map generation settings|changing map generation settings]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.autoplace_controls[&amp;quot;enemy-base&amp;quot;].size = &amp;quot;none&amp;quot;&lt;br /&gt;
surface.map_gen_settings = mgs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Player character scripts ==&lt;br /&gt;
Commands concerning the player directly.&lt;br /&gt;
=== Get player position ===&lt;br /&gt;
Prints coordinates of your current position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.position.x .. &amp;quot;, &amp;quot; .. game.player.position.y)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Teleport player ===&lt;br /&gt;
Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.teleport({X, Y})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To teleport to the world&#039;s origin, use 0,0.&lt;br /&gt;
&lt;br /&gt;
=== Enable god mode ===&lt;br /&gt;
God mode removes your player character allowing you to fly over obstacles and take no damage.&lt;br /&gt;
&lt;br /&gt;
Disassociate your controls from the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.character=nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, hover the mouse over the useless player and destroy it by typing:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.destroy()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To undo, spawn a player character. This will spawn a new player at the spawn point of the world, and connect your controls to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.create_character()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable long reach ===&lt;br /&gt;
Enables long reach, which allows the player to build and interact with entities at a greater distance. The default reach is 10.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local reach = 10000&lt;br /&gt;
game.player.force.character_build_distance_bonus = reach&lt;br /&gt;
game.player.force.character_reach_distance_bonus = reach&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Enable Research Queue ===&lt;br /&gt;
Enable the research queue for the players current team. Can be done after the game has started if it was forgotten during the map&#039;s setup.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_queue_enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.laboratory_speed_modifier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
1 is normal speed, 2 is double speed 3 is triple etc.&lt;br /&gt;
&lt;br /&gt;
=== Research specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=true&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unresearch specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;electric-energy-distribution-1&#039;, 0)&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;steel-processing&#039;, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling specific recipes ===&lt;br /&gt;
The internal recipe/item names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;electric-energy-interface&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;rocket-silo&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes.loader.enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;fast-loader&amp;quot;].enabled = true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;express-loader&amp;quot;].enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable all recipes ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name, recipe in pairs(game.player.force.recipes) do recipe.enabled = true end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command line parameters ==&lt;br /&gt;
&#039;&#039;&#039;As of Game Version 0.17.5&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Command line parameters can be used to set settings in the command line before the game launches, this is useful mainly for advanced users or server hosts.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;General options:&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| -h, --help&lt;br /&gt;
| display help&lt;br /&gt;
|-&lt;br /&gt;
| --version&lt;br /&gt;
|show version information&lt;br /&gt;
|-&lt;br /&gt;
| -v, --verbose&lt;br /&gt;
|enable verbose logging&lt;br /&gt;
|-&lt;br /&gt;
| -c, --config PATH&lt;br /&gt;
|config file to use&lt;br /&gt;
|-&lt;br /&gt;
| --no-log-rotation&lt;br /&gt;
|don&#039;t rotate log file&lt;br /&gt;
|-&lt;br /&gt;
| --mod-directory PATH&lt;br /&gt;
|Mod directory to use&lt;br /&gt;
|-&lt;br /&gt;
| --check-unused-prototype-data&lt;br /&gt;
|Print a warning for all prototype values that were not accessed&lt;br /&gt;
|-&lt;br /&gt;
| --executable-path PATH&lt;br /&gt;
|Override autodetected __PATH__executable. Usually not needed except on very weird systems.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Running options:&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| -s, --map2scenario arg&lt;br /&gt;
|map to scenario conversion&lt;br /&gt;
|-&lt;br /&gt;
| -m, --scenario2map arg&lt;br /&gt;
|scenario to map conversion&lt;br /&gt;
|-&lt;br /&gt;
| --apply-update arg&lt;br /&gt;
|immediately apply update package&lt;br /&gt;
|-&lt;br /&gt;
| --create FILE&lt;br /&gt;
|create a new map&lt;br /&gt;
|-&lt;br /&gt;
| --map-gen-settings FILE&lt;br /&gt;
|Map generation settings for use with --create, --start-server-load-scenario or --generate-map-preview. See data/map-gen-settings.example.json&lt;br /&gt;
|-&lt;br /&gt;
| --map-gen-seed SEED&lt;br /&gt;
|Map generation seed for use with --create, --start-server-load-scenario or --generate-map-preview. Will override seed specified in map gen settings&lt;br /&gt;
|-&lt;br /&gt;
| --map-settings FILE&lt;br /&gt;
|Map settings for use with --create or --start-server-load-scenario. See data/base/prototypes/map-settings.lua&lt;br /&gt;
|-&lt;br /&gt;
| --preset arg&lt;br /&gt;
|Name of the map generation preset to be used.&lt;br /&gt;
|-&lt;br /&gt;
| --enable-runtime-autoplace-modification&lt;br /&gt;
|Allows changing autoplace specifications runtime in non-multiplayer non-replay enabled games for debug purposes.&lt;br /&gt;
|-&lt;br /&gt;
| --generate-map-preview PNGFILE&lt;br /&gt;
|Generate preview images of the map&lt;br /&gt;
|-&lt;br /&gt;
| --generate-tile-properties-csv CSVFILE&lt;br /&gt;
|Generate tile properties into a CSV file; can be used with --generate-map-preview&lt;br /&gt;
|-&lt;br /&gt;
| --map-preview-size SCALE&lt;br /&gt;
|Size (in pixels) of map preview (default: 1024)&lt;br /&gt;
|-&lt;br /&gt;
| --map-preview-scale SCALE&lt;br /&gt;
|Scale (meters per pixel) of map preview (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| --map-preview-offset X,Y&lt;br /&gt;
|Offset of the center of the map, in meters (default: 0,0)&lt;br /&gt;
|-&lt;br /&gt;
| --noise-outputs TAG,TAG...&lt;br /&gt;
|Indicate which variables of noise program to output&lt;br /&gt;
|-&lt;br /&gt;
| --slope-shading SHADEAMOUNT&lt;br /&gt;
|Apply elevation shading to map preview&lt;br /&gt;
|-&lt;br /&gt;
| --slope-shade-property SHADEPROP&lt;br /&gt;
|Property to apply slope shading to (default: elevation)&lt;br /&gt;
|-&lt;br /&gt;
| --report-quantities PROTOTYPE,...&lt;br /&gt;
|When generating map preview, report approximate quantities of the named entity prototypes&lt;br /&gt;
|-&lt;br /&gt;
| --threads THREADCOUNT&lt;br /&gt;
|Number of threads to use when generating map previews&lt;br /&gt;
|-&lt;br /&gt;
| --disable-migration-window&lt;br /&gt;
|Disables the gui that is shown when opening a save with migrated content&lt;br /&gt;
|-&lt;br /&gt;
| --start-server FILE&lt;br /&gt;
|start a multiplayer server&lt;br /&gt;
|-&lt;br /&gt;
| --start-server-load-scenario [MOD/]NAME&lt;br /&gt;
|start a multiplayer server and load the specified scenario. The scenario is looked for inside the given mod. If no mod is given, it is looked for in the top-level scenarios directory.&lt;br /&gt;
|-&lt;br /&gt;
| --start-server-load-latest&lt;br /&gt;
|start a multiplayer server and load the latest available save&lt;br /&gt;
|-&lt;br /&gt;
| --until-tick TICK&lt;br /&gt;
|run a save until given map tick&lt;br /&gt;
|-&lt;br /&gt;
| --benchmark FILE&lt;br /&gt;
|load save and run benchmark&lt;br /&gt;
|-&lt;br /&gt;
| --benchmark-ticks N&lt;br /&gt;
|number of ticks for benchmarking. Default is 1000 (default: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| --benchmark-verbose FILE&lt;br /&gt;
|comma seperated list of timings to ouput each tick. &amp;quot;all&amp;quot;, &amp;quot;timestamp&amp;quot; as well as all other values seen in the debug view are allowed here. An empty string disabled verbose benchmarking. (default: )&lt;br /&gt;
|-&lt;br /&gt;
| --output-perf-stats FILE&lt;br /&gt;
|path of file to which performance statistics measurements should be saved. Special tags {api}, {hw}, {time} and {tag} will be replaced.&lt;br /&gt;
|-&lt;br /&gt;
| --mp-connect ADDRESS&lt;br /&gt;
|start factorio and connect to address&lt;br /&gt;
|-&lt;br /&gt;
| --load-game FILE&lt;br /&gt;
|start Factorio and load a game in singleplayer&lt;br /&gt;
|-&lt;br /&gt;
| --benchmark-graphics FILE&lt;br /&gt;
|load save and run it with graphics for benchmark-ticks number of ticks as normal game would&lt;br /&gt;
|-&lt;br /&gt;
| --benchmark-frame FILE&lt;br /&gt;
|load save and benchmark graphics rendering of single frame (prepare + render) without updating the game&lt;br /&gt;
|-&lt;br /&gt;
| --force-opengl&lt;br /&gt;
|use OpenGL for rendering&lt;br /&gt;
|-&lt;br /&gt;
| --force-d3d&lt;br /&gt;
|use Direct3D for rendering&lt;br /&gt;
|-&lt;br /&gt;
| --debug-graphics&lt;br /&gt;
|enables debugging layer for graphics API. If DirectX is used DirectX SDK needs to be installed for this to work.&lt;br /&gt;
|-&lt;br /&gt;
| --fullscreen&lt;br /&gt;
|start game in windowed mode (saved to configuration)&lt;br /&gt;
|-&lt;br /&gt;
| --max-texture-size N&lt;br /&gt;
|maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048&lt;br /&gt;
|-&lt;br /&gt;
| --graphics-quality arg&lt;br /&gt;
|accepted values: normal, low, very-low&lt;br /&gt;
|-&lt;br /&gt;
| --video-memory-usage arg&lt;br /&gt;
|accepted values: all, high, medium, low&lt;br /&gt;
|-&lt;br /&gt;
| --force-graphics-preset arg&lt;br /&gt;
|accepted values: very-low, low, mac-with-low-ram, medium-with-low-vram, medium, high, very-high, extreme&lt;br /&gt;
|-&lt;br /&gt;
| --gfx-safe-mode&lt;br /&gt;
|resets some graphics settings to values that should work on most configurations&lt;br /&gt;
|-&lt;br /&gt;
| --low-vram&lt;br /&gt;
|sprites that are not put into sprite atlases won&#039;t be allocated as texture objects&lt;br /&gt;
|-&lt;br /&gt;
| --shader arg&lt;br /&gt;
|enable/disable shader postprocessing (saved to configuration)&lt;br /&gt;
|-&lt;br /&gt;
| --disable-audio&lt;br /&gt;
|Disable audio. Mainly for faster startup during development.&lt;br /&gt;
|-&lt;br /&gt;
| --window-size arg&lt;br /&gt;
|Desired window resolution. For example &amp;quot;1680x1050&amp;quot;. Or &amp;quot;maximized&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| --single-thread-loading&lt;br /&gt;
|Disables loading of sprites in multiple threads.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Server options:&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| --port N&lt;br /&gt;
|network port to use&lt;br /&gt;
|-&lt;br /&gt;
| --bind ADDRESS[:PORT]&lt;br /&gt;
|IP address (and optionally port) to bind to&lt;br /&gt;
|-&lt;br /&gt;
| --rcon-port N&lt;br /&gt;
|Port to use for RCON&lt;br /&gt;
|-&lt;br /&gt;
| --rcon-password PASSWORD&lt;br /&gt;
|Password for RCON&lt;br /&gt;
|-&lt;br /&gt;
| --server-settings FILE&lt;br /&gt;
|Path to file with server settings. See data/server-settings.example.json&lt;br /&gt;
|-&lt;br /&gt;
| --use-server-whitelist&lt;br /&gt;
|If the whitelist should be used.&lt;br /&gt;
|-&lt;br /&gt;
| --server-whitelist FILE&lt;br /&gt;
|Path to file with server whitelist.&lt;br /&gt;
|-&lt;br /&gt;
| --server-banlist FILE&lt;br /&gt;
|Path to file with server banlist.&lt;br /&gt;
|-&lt;br /&gt;
| --server-adminlist FILE&lt;br /&gt;
|Path to file with server adminlist.&lt;br /&gt;
|-&lt;br /&gt;
| --console-log FILE&lt;br /&gt;
|Path to file where a copy of the server&#039;s log will be stored&lt;br /&gt;
|-&lt;br /&gt;
| --server-id FILE&lt;br /&gt;
|Path where server ID will be stored or read from&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Multiplayer ===&lt;br /&gt;
&lt;br /&gt;
  --start-server SAVE&lt;br /&gt;
&lt;br /&gt;
Will start a Headless (Dedicated) server, with no GUI.&lt;br /&gt;
&lt;br /&gt;
  --mp-connect ADDRESS&lt;br /&gt;
ADDRESS is the IP:port of the remote host. Port is optional.&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101:2345&lt;br /&gt;
&lt;br /&gt;
As above, port can be specified by placing the port number after a colon in the address.&lt;br /&gt;
&lt;br /&gt;
  --map2scenario SAVE&lt;br /&gt;
Converts a save game to a User Scenario, allows saved game state to be loaded into map editor.&lt;br /&gt;
Assuming that save game name is &amp;quot;foo.zip&amp;quot;, executing &#039;./factorio --map2scenario s1&#039; will result in Factorio loading, opening the save file, and saving the scenario into the scenario folder.&lt;br /&gt;
&lt;br /&gt;
== Modding tools ==&lt;br /&gt;
A list of the internal names of most things in the vanilla game can also be found on [[data.raw]].&lt;br /&gt;
&lt;br /&gt;
=== Print to console which tile are you have under the player position ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.surface.get_tile(game.player.position.x, game.player.position.y).name)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all researched technologies to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	if tech.researched then&lt;br /&gt;
    list[#list+1] = tech.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;techs.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all enabled recipes to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, recipe in pairs(game.player.force.recipes) do &lt;br /&gt;
	if recipe.enabled then&lt;br /&gt;
    list[#list+1] = recipe.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;recipes.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=172729</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=172729"/>
		<updated>2019-04-26T16:50:27Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Overview ==&lt;br /&gt;
The &#039;&#039;&#039;Console&#039;&#039;&#039; is Factorio&#039;s command-line interface.&lt;br /&gt;
&lt;br /&gt;
The in-game console is used for:&lt;br /&gt;
&lt;br /&gt;
* Chatting with other players&lt;br /&gt;
* Running commands / scripts / cheats&lt;br /&gt;
* Occasional status updates&lt;br /&gt;
&lt;br /&gt;
There are three types of commands:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[#Normal commands|Normal]]&#039;&#039;&#039; - Display information about the game and customize your experience.&lt;br /&gt;
* &#039;&#039;&#039;[[#Multiplayer commands|Multiplayer]]&#039;&#039;&#039; - Message filtering, banning users, etc.&lt;br /&gt;
* &#039;&#039;&#039;[[#Scripting and cheat commands|Scripting/Cheating]]&#039;&#039;&#039; - Run small Lua scripts (but they &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;disable achievements for the save game&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== Using the console ===&lt;br /&gt;
The console display can be toggled with the {{keybinding|/}} (slash) or {{keybinding|~}} (tilde) keys.&lt;br /&gt;
&lt;br /&gt;
You can customize the keys via &#039;&#039;&#039;Options Menu → Keyboard → Toggle Lua console&#039;&#039;&#039;.&lt;br /&gt;
When the console is open, you&#039;ll see a blinking cursor at the bottom of the screen; type your message or command and hit &#039;&#039;&#039;Return&#039;&#039;&#039; to send it (this will also close the console).&lt;br /&gt;
Documentation about message and command prefixes can be found further down this page.&lt;br /&gt;
&lt;br /&gt;
The console supports [[rich text]] tags. These tags are useful for sharing blueprints, marking map locations in chat or adding icons to map markers and train stations. Ctrl+alt clicking the map or ground will automatically insert a gps tag and post it into the console. Shift clicking most things with the console open will insert a tag for that thing into chat. &lt;br /&gt;
&lt;br /&gt;
When console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages).&lt;br /&gt;
Note that by default, all executed commands are made visible to all users. You can set the fade out time via &#039;&#039;&#039;Options Menu → Other Settings → Message Delay&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you want to immediately hide the console, open the console and then press &#039;&#039;&#039;Escape&#039;&#039;&#039; key (or press &#039;&#039;&#039;Return&#039;&#039;&#039; without entering any message/command).&lt;br /&gt;
This not only closes the console, but it also hides all the recent messages/commands.&lt;br /&gt;
The console can be cleared with the &#039;&#039;&#039;/clear&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Note that the console can also accept raw Lua code as well as game commands.&lt;br /&gt;
&lt;br /&gt;
=== Console history ===&lt;br /&gt;
&lt;br /&gt;
The console has an inbuilt history; it&#039;s a bit like a text editor where only one line of text is displayed at a time.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;uarr;}} and {{keybinding|&amp;amp;darr;}} keys to scroll through the console history.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;larr;}} and {{keybinding|&amp;amp;rarr;}} keys to cursor through the currently displayed message or command, which you can edit (delete, insert, etc.) and resend (by pressing &#039;&#039;&#039;Return&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
The {{keybinding|Tab}} key will auto-complete commands and player ids.&lt;br /&gt;
&lt;br /&gt;
== Normal commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| /alerts &amp;lt;enable/disable/mute/unmute&amp;gt; &amp;lt;alert&amp;gt;&lt;br /&gt;
| /alerts disable turret_fire&lt;br /&gt;
| Enables, disables, mutes, or unmutes the given alert type. Available alerts: entity_destroyed, entity_under_attack, not_enough_construction_robots, no_material_for_construction, not_enough_repair packs, turret_fire, custom, no_storage.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /clear&lt;br /&gt;
| /clear&lt;br /&gt;
| Clears the console.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /color &amp;lt;color&amp;gt;&lt;br /&gt;
| /color 20 255 255 100&lt;br /&gt;
| Changes your color. Can either be one of the pre-defined colors or [[:Wikipedia:RGBA_color_space|RGBA value]] in the format of “# # # #”. Available colors: default, red, green, blue, orange, yellow, pink, purple, white, black, gray, brown, cyan, acid.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /evolution&lt;br /&gt;
| /evolution&lt;br /&gt;
| Prints info about the alien evolution factor.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /help [command]&lt;br /&gt;
| /help&lt;br /&gt;
| Prints a list of available commands, the optional argument can specify the command that should be described.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /h [command]&lt;br /&gt;
| /h&lt;br /&gt;
| Same as /help.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /mute-programmable-speaker &amp;lt;mute/unmute&amp;gt; &amp;lt;local/everyone&amp;gt;&lt;br /&gt;
| /mute-programmable-speaker mute local&lt;br /&gt;
| Mutes or unmutes the global sounds created by the Programmable Speaker. Use “local” to mute just the local client. Admins can use “everyone” to mute the sounds for everyone on the server.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /perf-avg-frames &amp;lt;number&amp;gt;&lt;br /&gt;
| /perf-avg-frames 100&lt;br /&gt;
| Number of ticks/updates used to average performance counters. Default is 100. Value of 5-10 is recommended for fast convergence, but numbers will jitter more rapidly.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /permissions&lt;br /&gt;
| /permissions&lt;br /&gt;
| Opens the permissions GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /screenshot [x resolution] [y resolution] [zoom]&lt;br /&gt;
| /screenshot&lt;br /&gt;
| Takes a screenshot with the GUI hidden, centered on the player. It is saved in the &amp;quot;script-output&amp;quot; subfolder of your [[User data directory]].  Resolution is optional and defaults to the current window size. Zoom is optional and defaults to 1.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /seed&lt;br /&gt;
| /seed&lt;br /&gt;
| Prints the starting map seed.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /time&lt;br /&gt;
| /time&lt;br /&gt;
| Prints info about how old the map is.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| Toggles logging all input actions performed by the game. This value isn’t persisted between game restarts and only affects your local game in multiplayer sessions.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| Used to investigate [[Desynchronization#Using_heavy_mode_command|desyncs]]. Will slow down the game and make multiplayer unplayable.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| Toggles if the rockets sent button is shown in the upper left corner of the screen.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unlock-shortcut-bar&lt;br /&gt;
| /unlock-shortcut-bar&lt;br /&gt;
| Unlocks all shortcut bar items.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /version&lt;br /&gt;
| /version&lt;br /&gt;
| Prints the current game version.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Multiplayer commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;message&amp;gt;&lt;br /&gt;
| Hello team!&lt;br /&gt;
| Console input that does not start with {{keybinding|/}} is shown as a chat message to your team.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /admin&lt;br /&gt;
| /admin&lt;br /&gt;
| Opens the player management GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /admins&lt;br /&gt;
| /admins&lt;br /&gt;
| Prints a list of game admins.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ban &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /ban xTROLLx Throwing grenades in base&lt;br /&gt;
| Bans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /banlist &amp;lt;add/remove/get/clear&amp;gt; &amp;lt;player&amp;gt;&lt;br /&gt;
| /banlist get&lt;br /&gt;
| Adds or removes a player from the banlist. Same as /ban or /unban.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /config &amp;lt;get/set&amp;gt; &amp;lt;option&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
| /config set password hunter2&lt;br /&gt;
| Gets or sets various multiplayer game settings. Available configs are: afk-auto-kick, allow-commands, allow-debug-settings, autosave-interval, autosave-only-on-server, ignore-player-limit-for-returning-players, max-players, max-upload-speed, only-admins-can-pause, password, require-user-verification, visibility-lan, visibility-public.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /delete-blueprint-library &amp;lt;player&amp;gt;&lt;br /&gt;
| /delete-blueprint-library everybody confirm&lt;br /&gt;
| Deletes the blueprint library storage for the given offline player from the save file. Enter “everybody confirm” to delete the storage of all offline players.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /demote &amp;lt;player&amp;gt;&lt;br /&gt;
| /demote AzureDiamond&lt;br /&gt;
| Demotes the player from admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /ignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /ignore Cthon98&lt;br /&gt;
| Prevents the chat from showing messages from this player. Admin messages are still shown.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ignores&lt;br /&gt;
| /ignores&lt;br /&gt;
| Prints a list of ignored players.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /kick &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /kick xTROLLx Throwing grenades in base&lt;br /&gt;
| Kicks the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mute &amp;lt;player&amp;gt;&lt;br /&gt;
| /mute Cthon98&lt;br /&gt;
| Prevents the player from saying anything in chat.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mutes&lt;br /&gt;
| /mutes&lt;br /&gt;
| All players that are muted (can’t talk in chat).&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /open &amp;lt;player&amp;gt;&lt;br /&gt;
| /open AzureDiamond&lt;br /&gt;
| Opens another player’s inventory.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /o &amp;lt;player&amp;gt;&lt;br /&gt;
| /o AzureDiamond&lt;br /&gt;
| Same as /open.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /players [online/o/count/c]&lt;br /&gt;
| /players&lt;br /&gt;
| Prints a list of players in the game. (parameter online/o, it prints only players that are online, count/c prints only count)&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /promote &amp;lt;player&amp;gt;&lt;br /&gt;
| /promote AzureDiamond&lt;br /&gt;
| Promotes the player to admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /purge &amp;lt;player&amp;gt;&lt;br /&gt;
| /purge Cthon98&lt;br /&gt;
| Clears all the messages from this player from the chat log.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /reply &amp;lt;message&amp;gt;&lt;br /&gt;
| /reply oh, really?&lt;br /&gt;
| Replies to the last player that whispered to you.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /r &amp;lt;message&amp;gt;&lt;br /&gt;
| /r oh, really?&lt;br /&gt;
| Same as /reply.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /server-save&lt;br /&gt;
| /server-save&lt;br /&gt;
| Saves the game on the server in a multiplayer game.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /shout &amp;lt;message&amp;gt;&lt;br /&gt;
| /shout Hello world!&lt;br /&gt;
| Sends a message to all players including other forces.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /s &amp;lt;message&amp;gt;&lt;br /&gt;
| /s Hello world!&lt;br /&gt;
| Same as /shout.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /swap-players &amp;lt;player&amp;gt; [player]&lt;br /&gt;
| /swap-players AzureDiamond&lt;br /&gt;
| Swaps your character with the given player’s character, or if two players are given swaps the two player characters.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unban &amp;lt;player&amp;gt;&lt;br /&gt;
| /unban xTROLLx&lt;br /&gt;
| Unbans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /unignore Cthon98&lt;br /&gt;
| Allows the chat to show messages from this player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unmute &amp;lt;player&amp;gt;&lt;br /&gt;
| /unmute Cthon98&lt;br /&gt;
| Allows the player to talk in chat again.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /whisper &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /whisper AzureDiamond thats what I see&lt;br /&gt;
| Sends a message to the specified player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /w &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /w AzureDiamond thats what I see&lt;br /&gt;
| Same as /whisper.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /whitelist &amp;lt;add/remove/get/clear&amp;gt; [player]&lt;br /&gt;
| /whitelist get&lt;br /&gt;
| Adds or removes a player from the whitelist, where only whitelisted players can join the game. Enter nothing for “player” when using “get” to print a list of all whitelisted players. An empty whitelist disables the whitelist functionality allowing anyone to join.&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scripting and cheat commands ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| /cheat &amp;lt;all&amp;gt;&lt;br /&gt;
| Researches all technologies and enables cheat mode. Using the &#039;&#039;&#039;all&#039;&#039;&#039; option also gives the player some additional items.&lt;br /&gt;
|-&lt;br /&gt;
| /command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /c &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /editor&lt;br /&gt;
| Toggles the map editor.&lt;br /&gt;
|-&lt;br /&gt;
| /measured-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command and measures time it took.&lt;br /&gt;
|-&lt;br /&gt;
| /silent-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command without printing it to the console.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a very powerful feature, which also allows cheating, and as such &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;achievements will be permanently disabled for the save&amp;lt;/span&amp;gt; as soon as you use a script command.&lt;br /&gt;
&lt;br /&gt;
=== Make new force and change your force to it ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c  local name = game.player.name&lt;br /&gt;
if not game.forces[name] then game.create_force(name) end&lt;br /&gt;
game.player.force = name&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Basic example scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Use it as calculator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(1234*5678)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zoom beyond normal bounds ===&lt;br /&gt;
Note that zooming too far out can cause performance hits. Be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.zoom=0.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mine faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Craft faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unlock and research all technologies ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_all_technologies()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Undo this with the command in the next section.&lt;br /&gt;
&lt;br /&gt;
=== Unresearch all technologies ===&lt;br /&gt;
This does not reset manually applied bonuses&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	tech.researched=false&lt;br /&gt;
	game.player.force.set_saved_technology_progress(tech, 0)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reset your force ===&lt;br /&gt;
This resets all data for your force, including kill and production statistics, technologies, bonuses and charting status.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.reset()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Always show rail block visualization ===&lt;br /&gt;
Permanently show the rail block visualization instead of only when holding a rail signal. Disable by replacing true with false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.game_view_settings.show_rail_block_visualisation = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inventory manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Cheat mode ===&lt;br /&gt;
Allows for infinite free crafting. Disable by replacing true with false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.cheat_mode=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource tile in-game&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.amount=7500&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can refill all resources in the map with the following command. Change ore.amount to the desired value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c surface = game.player.surface&lt;br /&gt;
for _, ore in pairs(surface.find_entities_filtered({type=&amp;quot;resource&amp;quot;})) do&lt;br /&gt;
    ore.amount = 10000&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add items to the player&#039;s inventory ===&lt;br /&gt;
Replace iron-plate with the [[data.raw|internal name]] of the item desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For instance, here&#039;s a stack of the god-mode energy system interface:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;electric-energy-interface&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a powerful armor with equipment and some tools for construction:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c	local player = game.player&lt;br /&gt;
player.insert{name=&amp;quot;power-armor-mk2&amp;quot;, count = 1}&lt;br /&gt;
local p_armor = player.get_inventory(5)[1].grid&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;personal-roboport-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;night-vision-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
player.insert{name=&amp;quot;construction-robot&amp;quot;, count = 25}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== World manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Reveal the map around the player ===&lt;br /&gt;
&lt;br /&gt;
Reveals the map around the player, similar to a [[radar]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or from start position&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces.player.chart(game.player.surface, {{x = -2000, y = -2000}, {x = 2000, y = 2000}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change 150 to the desired radius, higher values take longer.&lt;br /&gt;
&lt;br /&gt;
=== Delete chunks ===&lt;br /&gt;
If much of the map is revealed, it increases the size of the save file. The following command cancels the generation of all chunks that are currently queued for generation and removes chunks outside a 32 chunks radius around 0,0. Note that this will remove player entities if there are any on these chunks.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface;&lt;br /&gt;
game.player.force.cancel_charting(surface); &lt;br /&gt;
local chunk_radius = 32;&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  if (chunk.x &amp;lt; -chunk_radius or chunk.x &amp;gt; chunk_radius or chunk.y &amp;lt; -chunk_radius or chunk.y &amp;gt; chunk_radius) then&lt;br /&gt;
    surface.delete_chunk(chunk)&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
Enables eternal day.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.always_day=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change game speed ===&lt;br /&gt;
0.5 is half speed, 1 is default, 2 is double speed, etc. Minimum is 0.01. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.speed=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expensive (marathon) or normal mode ===&lt;br /&gt;
To change from normal to expensive mode preset (this changes the research cost and intermediate product cost):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change back to normal:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Freeze time ===&lt;br /&gt;
Stops the advancement of the time if you replace &amp;quot;BOOL&amp;quot; with &amp;quot;true&amp;quot; or unfreezes it if you replace it with &amp;quot;false&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.freeze_daytime=BOOL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.clear_pollution()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Completely turn off pollution ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, surface in pairs(game.surfaces) do&lt;br /&gt;
  surface.clear_pollution()&lt;br /&gt;
end&lt;br /&gt;
game.map_settings.pollution.enabled = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add a lot of pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.pollute(game.player.position, 1000000)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where speakers are, by who ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c speakers = game.player.surface.find_entities_filtered{force = &amp;quot;player&amp;quot;, type=&amp;quot;programmable-speaker&amp;quot;}&lt;br /&gt;
for key, speaker in pairs(speakers) do&lt;br /&gt;
    game.player.print(speaker.last_user.name .. &amp;quot; placed a speaker at X=&amp;quot; .. speaker.position.x .. &amp;quot;, Y=&amp;quot; .. speaker.position.y)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable friendly fire for your force ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.friendly_fire = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 11×11 patch of resources, centered on the player character, where the ground is not water.&lt;br /&gt;
The patch it creates is perfectly square but it randomizes the amount similar to natural generation, with fewer ore at the edges and more ore in the center.&lt;br /&gt;
The default numbers result in a patch with 2500-3000 ore.&lt;br /&gt;
&lt;br /&gt;
If you want a larger patch, change &amp;quot;local size = 5&amp;quot; to a larger number.&lt;br /&gt;
A larger patch will have exponentially more ore.&lt;br /&gt;
Entering a number above 30 is not recommended.&lt;br /&gt;
&lt;br /&gt;
If you want a richer patch, change &amp;quot;local density = 10&amp;quot; to a larger number.&lt;br /&gt;
Entering a very large number shouldn&#039;t hurt anything but you probably don&#039;t need to go above 100.&lt;br /&gt;
&lt;br /&gt;
To choose which resource is spawned, change &amp;quot;stone&amp;quot; near the bottom to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, &amp;quot;coal&amp;quot;, or &amp;quot;uranium-ore&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local ore=nil&lt;br /&gt;
local size=5&lt;br /&gt;
local density=10&lt;br /&gt;
for y=-size, size do&lt;br /&gt;
	for x=-size, size do&lt;br /&gt;
		a=(size+1-math.abs(x))*10&lt;br /&gt;
		b=(size+1-math.abs(y))*10&lt;br /&gt;
		if a&amp;lt;b then&lt;br /&gt;
			ore=math.random(a*density-a*(density-8), a*density+a*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if b&amp;lt;a then&lt;br /&gt;
			ore=math.random(b*density-b*(density-8), b*density+b*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if surface.get_tile(game.player.position.x+x, game.player.position.y+y).collides_with(&amp;quot;ground-tile&amp;quot;) then&lt;br /&gt;
			surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=ore, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove resources around the player ===&lt;br /&gt;
Removes all resource patches from the ground in a 50 x 50 area around the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local size=50&lt;br /&gt;
local pos=game.player.position&lt;br /&gt;
&lt;br /&gt;
for _, e in pairs(surface.find_entities_filtered{area={{pos.x-size, pos.y-size},{pos.x+size, pos.y+size}}, type=&amp;quot;resource&amp;quot;}) &lt;br /&gt;
	do e.destroy() &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches in a 3×3 square.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for y=0,2 do&lt;br /&gt;
	for x=0,2 do&lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or randomly without any collision:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local position=nil&lt;br /&gt;
for i=1,9 do&lt;br /&gt;
	position=game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
	if position then &lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position=position})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create 10 fishes ===&lt;br /&gt;
This creates 10 fishes around of player. The player must be on the water edge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local player = game.player&lt;br /&gt;
local surface = player.surface&lt;br /&gt;
for i = 1, 10 do&lt;br /&gt;
  local position = surface.find_non_colliding_position(&#039;fish&#039;, player.position, 10, 1)&lt;br /&gt;
  if not position then return end&lt;br /&gt;
  surface.create_entity {name = &#039;fish&#039;, position = position}&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Count entities ===&lt;br /&gt;
Counts all entities whose name includes the string in local entity.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local entity=&amp;quot;belt&amp;quot;&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local count=0&lt;br /&gt;
for key, ent in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(ent.name,entity) then&lt;br /&gt;
		count=count+1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(count)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emptying all pipes, underground pipes and pumps ===&lt;br /&gt;
Useful when pipes contain a fluid you dont want.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local deleted=0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(entity.name, &amp;quot;pipe&amp;quot;) or &lt;br /&gt;
		string.find(entity.name, &amp;quot;pump&amp;quot;) &lt;br /&gt;
	then&lt;br /&gt;
		for i=1,#entity.fluidbox do&lt;br /&gt;
			deleted = deleted + 1&lt;br /&gt;
			entity.fluidbox[i] = nil;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(&amp;quot;Fluids removed from &amp;quot;..deleted ..&amp;quot; entities&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off cliff generation ===&lt;br /&gt;
Sets size to &amp;quot;none&amp;quot;. Only effective on chunks that are generated after using this command. Use [[#Remove all cliffs]] to delete existing cliffs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local mgs = game.player.surface.map_gen_settings&lt;br /&gt;
mgs.cliff_settings.cliff_elevation_0 = 1024&lt;br /&gt;
game.player.surface.map_gen_settings = mgs&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all cliffs ===&lt;br /&gt;
Removes all cliffs existing cliffs from the world. Use [[#Turn off cliff generation]] to turn off cliff generation in new chunks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, v in pairs(game.player.surface.find_entities_filtered{type=&amp;quot;cliff&amp;quot;}) do&lt;br /&gt;
  v.destroy()&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Delete all decoratives ===&lt;br /&gt;
Delete the decoratives that can be found in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
for c in surface.get_chunks() do&lt;br /&gt;
	surface.destroy_decoratives({{c.x*32, c.y*32}, {c.x*32+32, c.y*32+32}})&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change map generation settings ===&lt;br /&gt;
This allows to change the map generation settings for new chunks; it does not alter already generated chunks. [[#Delete chunks|Deleted chunks]] are affected by the setting change because they are newly generated when they get explored again.&lt;br /&gt;
&lt;br /&gt;
To change resource generation settings, replace &amp;quot;iron-ore&amp;quot; with the [[Data.raw#resource|resource]] that should be changed and replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command. Replace &amp;quot;iron-ore&amp;quot; with &amp;quot;enemy-base&amp;quot; to change the enemy base generation settings. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local resource = &amp;quot;iron-ore&amp;quot;&lt;br /&gt;
local autoplace = surface.map_gen_settings.autoplace_controls&lt;br /&gt;
autoplace[resource].size = &amp;quot;very-high&amp;quot;&lt;br /&gt;
autoplace[resource].frequency = &amp;quot;very-high&amp;quot;&lt;br /&gt;
autoplace[resource].richness = &amp;quot;very-high&amp;quot;&lt;br /&gt;
surface.map_gen_settings.autoplace_controls = autoplace&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change water generation settings, replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.water = &amp;quot;very-high&amp;quot; --[[ size]]&lt;br /&gt;
mgs.terrain_segmentation  = &amp;quot;very-high&amp;quot; --[[ frequency]]&lt;br /&gt;
surface.map_gen_settings = mgs &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enemy/evolution scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Set evolution factor ===&lt;br /&gt;
Ranges from 0 (new game) to 1.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].evolution_factor=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_evolution.time_factor=0&lt;br /&gt;
/c game.map_settings.enemy_evolution.pollution_factor=game.map_settings.enemy_evolution.pollution_factor*2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;2&amp;quot; at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.&lt;br /&gt;
&lt;br /&gt;
=== Kill all biters on the &amp;quot;enemy&amp;quot; force ===&lt;br /&gt;
Note that this will kill only mobile units, spawners will not be killed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all enemies ===&lt;br /&gt;
This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the explored world, so any unexplored parts of the map which still need to be generated will still have enemies. You can [[#Prevent biters being on newly generated chunks|prevent biters being on newly generated chunks]] if desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all nearby enemies ===&lt;br /&gt;
&lt;br /&gt;
This will kill all biters, bases and worms in a configurable radius. The default, 250 tiles, is about two zoomed-out screen widths on full HD. After destruction, it shows how many objects were destroyed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius = 250&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local pp = game.player.position&lt;br /&gt;
local cnt = 0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
    if entity.position.x &amp;gt; pp.x - radius and entity.position.x &amp;lt; pp.x + radius&lt;br /&gt;
        and entity.position.y &amp;gt; pp.y - radius and entity.position.y &amp;lt; pp.y + radius then&lt;br /&gt;
        cnt = cnt+1&lt;br /&gt;
        entity.destroy()&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(cnt)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable peaceful mode ===&lt;br /&gt;
Enabling peaceful mode prevents biter attacks until provoked. Substitute true for false to disable. Already existing biters are not affected by this command so attacks could continue for a while after activating peaceful mode.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.peaceful_mode = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable biter expansion ===&lt;br /&gt;
Biter expansion allows biters to create new nests, it is enabled by default. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_expansion.enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Prevent biters being on newly generated chunks ===&lt;br /&gt;
On newly generated chunks no biters will be present, however all current biters will remain unaffected. Equivalent of setting the Enemy Base Size to None under the Terrain settings during map generation but achieved mid game by [[#Change map generation settings|changing map generation settings]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.autoplace_controls[&amp;quot;enemy-base&amp;quot;].size = &amp;quot;none&amp;quot;&lt;br /&gt;
surface.map_gen_settings = mgs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Player character scripts ==&lt;br /&gt;
Commands concerning the player directly.&lt;br /&gt;
=== Get player position ===&lt;br /&gt;
Prints coordinates of your current position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.position.x .. &amp;quot;, &amp;quot; .. game.player.position.y)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Teleport player ===&lt;br /&gt;
Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.teleport({X, Y})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To teleport to the world&#039;s origin, use 0,0.&lt;br /&gt;
&lt;br /&gt;
=== Enable god mode ===&lt;br /&gt;
God mode removes your player character allowing you to fly over obstacles and take no damage.&lt;br /&gt;
&lt;br /&gt;
Disassociate your controls from the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.character=nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, hover the mouse over the useless player and destroy it by typing:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.destroy()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To undo, spawn a player character. This will spawn a new player at the spawn point of the world, and connect your controls to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.create_character()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable long reach ===&lt;br /&gt;
Enables long reach, which allows the player to build and interact with entities at a greater distance. The default reach is 10.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local reach = 10000&lt;br /&gt;
game.player.force.character_build_distance_bonus = reach&lt;br /&gt;
game.player.force.character_reach_distance_bonus = reach&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Enable Research Queue ===&lt;br /&gt;
Enable the research queue for the players current team. Can be done after the game has started if it was forgotten during the map&#039;s setup.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_queue_enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.laboratory_speed_modifier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
1 is normal speed, 2 is double speed 3 is triple etc.&lt;br /&gt;
&lt;br /&gt;
=== Research specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=true&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unresearch specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;electric-energy-distribution-1&#039;, 0)&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;steel-processing&#039;, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling specific recipes ===&lt;br /&gt;
The internal recipe/item names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;electric-energy-interface&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;rocket-silo&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes.loader.enabled=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable all recipes ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name, recipe in pairs(game.player.force.recipes) do recipe.enabled = true end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command line parameters ==&lt;br /&gt;
&#039;&#039;&#039;As of Game Version 0.17.5&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Command line parameters can be used to set settings in the command line before the game launches, this is useful mainly for advanced users or server hosts.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;General options:&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| -h, --help&lt;br /&gt;
| display help&lt;br /&gt;
|-&lt;br /&gt;
| --version&lt;br /&gt;
|show version information&lt;br /&gt;
|-&lt;br /&gt;
| -v, --verbose&lt;br /&gt;
|enable verbose logging&lt;br /&gt;
|-&lt;br /&gt;
| -c, --config PATH&lt;br /&gt;
|config file to use&lt;br /&gt;
|-&lt;br /&gt;
| --no-log-rotation&lt;br /&gt;
|don&#039;t rotate log file&lt;br /&gt;
|-&lt;br /&gt;
| --mod-directory PATH&lt;br /&gt;
|Mod directory to use&lt;br /&gt;
|-&lt;br /&gt;
| --check-unused-prototype-data&lt;br /&gt;
|Print a warning for all prototype values that were not accessed&lt;br /&gt;
|-&lt;br /&gt;
| --executable-path PATH&lt;br /&gt;
|Override autodetected __PATH__executable. Usually not needed except on very weird systems.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Running options:&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| -s, --map2scenario arg&lt;br /&gt;
|map to scenario conversion&lt;br /&gt;
|-&lt;br /&gt;
| -m, --scenario2map arg&lt;br /&gt;
|scenario to map conversion&lt;br /&gt;
|-&lt;br /&gt;
| --apply-update arg&lt;br /&gt;
|immediately apply update package&lt;br /&gt;
|-&lt;br /&gt;
| --create FILE&lt;br /&gt;
|create a new map&lt;br /&gt;
|-&lt;br /&gt;
| --map-gen-settings FILE&lt;br /&gt;
|Map generation settings for use with --create, --start-server-load-scenario or --generate-map-preview. See data/map-gen-settings.example.json&lt;br /&gt;
|-&lt;br /&gt;
| --map-gen-seed SEED&lt;br /&gt;
|Map generation seed for use with --create, --start-server-load-scenario or --generate-map-preview. Will override seed specified in map gen settings&lt;br /&gt;
|-&lt;br /&gt;
| --map-settings FILE&lt;br /&gt;
|Map settings for use with --create or --start-server-load-scenario. See data/base/prototypes/map-settings.lua&lt;br /&gt;
|-&lt;br /&gt;
| --preset arg&lt;br /&gt;
|Name of the map generation preset to be used.&lt;br /&gt;
|-&lt;br /&gt;
| --enable-runtime-autoplace-modification&lt;br /&gt;
|Allows changing autoplace specifications runtime in non-multiplayer non-replay enabled games for debug purposes.&lt;br /&gt;
|-&lt;br /&gt;
| --generate-map-preview PNGFILE&lt;br /&gt;
|Generate preview images of the map&lt;br /&gt;
|-&lt;br /&gt;
| --generate-tile-properties-csv CSVFILE&lt;br /&gt;
|Generate tile properties into a CSV file; can be used with --generate-map-preview&lt;br /&gt;
|-&lt;br /&gt;
| --map-preview-size SCALE&lt;br /&gt;
|Size (in pixels) of map preview (default: 1024)&lt;br /&gt;
|-&lt;br /&gt;
| --map-preview-scale SCALE&lt;br /&gt;
|Scale (meters per pixel) of map preview (default: 1)&lt;br /&gt;
|-&lt;br /&gt;
| --map-preview-offset X,Y&lt;br /&gt;
|Offset of the center of the map, in meters (default: 0,0)&lt;br /&gt;
|-&lt;br /&gt;
| --noise-outputs TAG,TAG...&lt;br /&gt;
|Indicate which variables of noise program to output&lt;br /&gt;
|-&lt;br /&gt;
| --slope-shading SHADEAMOUNT&lt;br /&gt;
|Apply elevation shading to map preview&lt;br /&gt;
|-&lt;br /&gt;
| --slope-shade-property SHADEPROP&lt;br /&gt;
|Property to apply slope shading to (default: elevation)&lt;br /&gt;
|-&lt;br /&gt;
| --report-quantities PROTOTYPE,...&lt;br /&gt;
|When generating map preview, report approximate quantities of the named entity prototypes&lt;br /&gt;
|-&lt;br /&gt;
| --threads THREADCOUNT&lt;br /&gt;
|Number of threads to use when generating map previews&lt;br /&gt;
|-&lt;br /&gt;
| --disable-migration-window&lt;br /&gt;
|Disables the gui that is shown when opening a save with migrated content&lt;br /&gt;
|-&lt;br /&gt;
| --start-server FILE&lt;br /&gt;
|start a multiplayer server&lt;br /&gt;
|-&lt;br /&gt;
| --start-server-load-scenario [MOD/]NAME&lt;br /&gt;
|start a multiplayer server and load the specified scenario. The scenario is looked for inside the given mod. If no mod is given, it is looked for in the top-level scenarios directory.&lt;br /&gt;
|-&lt;br /&gt;
| --start-server-load-latest&lt;br /&gt;
|start a multiplayer server and load the latest available save&lt;br /&gt;
|-&lt;br /&gt;
| --until-tick TICK&lt;br /&gt;
|run a save until given map tick&lt;br /&gt;
|-&lt;br /&gt;
| --benchmark FILE&lt;br /&gt;
|load save and run benchmark&lt;br /&gt;
|-&lt;br /&gt;
| --benchmark-ticks N&lt;br /&gt;
|number of ticks for benchmarking. Default is 1000 (default: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| --benchmark-verbose FILE&lt;br /&gt;
|comma seperated list of timings to ouput each tick. &amp;quot;all&amp;quot;, &amp;quot;timestamp&amp;quot; as well as all other values seen in the debug view are allowed here. An empty string disabled verbose benchmarking. (default: )&lt;br /&gt;
|-&lt;br /&gt;
| --output-perf-stats FILE&lt;br /&gt;
|path of file to which performance statistics measurements should be saved. Special tags {api}, {hw}, {time} and {tag} will be replaced.&lt;br /&gt;
|-&lt;br /&gt;
| --mp-connect ADDRESS&lt;br /&gt;
|start factorio and connect to address&lt;br /&gt;
|-&lt;br /&gt;
| --load-game FILE&lt;br /&gt;
|start Factorio and load a game in singleplayer&lt;br /&gt;
|-&lt;br /&gt;
| --benchmark-graphics FILE&lt;br /&gt;
|load save and run it with graphics for benchmark-ticks number of ticks as normal game would&lt;br /&gt;
|-&lt;br /&gt;
| --benchmark-frame FILE&lt;br /&gt;
|load save and benchmark graphics rendering of single frame (prepare + render) without updating the game&lt;br /&gt;
|-&lt;br /&gt;
| --force-opengl&lt;br /&gt;
|use OpenGL for rendering&lt;br /&gt;
|-&lt;br /&gt;
| --force-d3d&lt;br /&gt;
|use Direct3D for rendering&lt;br /&gt;
|-&lt;br /&gt;
| --debug-graphics&lt;br /&gt;
|enables debugging layer for graphics API. If DirectX is used DirectX SDK needs to be installed for this to work.&lt;br /&gt;
|-&lt;br /&gt;
| --fullscreen&lt;br /&gt;
|start game in windowed mode (saved to configuration)&lt;br /&gt;
|-&lt;br /&gt;
| --max-texture-size N&lt;br /&gt;
|maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048&lt;br /&gt;
|-&lt;br /&gt;
| --graphics-quality arg&lt;br /&gt;
|accepted values: normal, low, very-low&lt;br /&gt;
|-&lt;br /&gt;
| --video-memory-usage arg&lt;br /&gt;
|accepted values: all, high, medium, low&lt;br /&gt;
|-&lt;br /&gt;
| --force-graphics-preset arg&lt;br /&gt;
|accepted values: very-low, low, mac-with-low-ram, medium-with-low-vram, medium, high, very-high, extreme&lt;br /&gt;
|-&lt;br /&gt;
| --gfx-safe-mode&lt;br /&gt;
|resets some graphics settings to values that should work on most configurations&lt;br /&gt;
|-&lt;br /&gt;
| --low-vram&lt;br /&gt;
|sprites that are not put into sprite atlases won&#039;t be allocated as texture objects&lt;br /&gt;
|-&lt;br /&gt;
| --shader arg&lt;br /&gt;
|enable/disable shader postprocessing (saved to configuration)&lt;br /&gt;
|-&lt;br /&gt;
| --disable-audio&lt;br /&gt;
|Disable audio. Mainly for faster startup during development.&lt;br /&gt;
|-&lt;br /&gt;
| --window-size arg&lt;br /&gt;
|Desired window resolution. For example &amp;quot;1680x1050&amp;quot;. Or &amp;quot;maximized&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| --single-thread-loading&lt;br /&gt;
|Disables loading of sprites in multiple threads.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&#039;&#039;&#039;Server options:&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| --port N&lt;br /&gt;
|network port to use&lt;br /&gt;
|-&lt;br /&gt;
| --bind ADDRESS[:PORT]&lt;br /&gt;
|IP address (and optionally port) to bind to&lt;br /&gt;
|-&lt;br /&gt;
| --rcon-port N&lt;br /&gt;
|Port to use for RCON&lt;br /&gt;
|-&lt;br /&gt;
| --rcon-password PASSWORD&lt;br /&gt;
|Password for RCON&lt;br /&gt;
|-&lt;br /&gt;
| --server-settings FILE&lt;br /&gt;
|Path to file with server settings. See data/server-settings.example.json&lt;br /&gt;
|-&lt;br /&gt;
| --use-server-whitelist&lt;br /&gt;
|If the whitelist should be used.&lt;br /&gt;
|-&lt;br /&gt;
| --server-whitelist FILE&lt;br /&gt;
|Path to file with server whitelist.&lt;br /&gt;
|-&lt;br /&gt;
| --server-banlist FILE&lt;br /&gt;
|Path to file with server banlist.&lt;br /&gt;
|-&lt;br /&gt;
| --server-adminlist FILE&lt;br /&gt;
|Path to file with server adminlist.&lt;br /&gt;
|-&lt;br /&gt;
| --console-log FILE&lt;br /&gt;
|Path to file where a copy of the server&#039;s log will be stored&lt;br /&gt;
|-&lt;br /&gt;
| --server-id FILE&lt;br /&gt;
|Path where server ID will be stored or read from&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Multiplayer ===&lt;br /&gt;
&lt;br /&gt;
  --start-server SAVE&lt;br /&gt;
&lt;br /&gt;
Will start a Headless (Dedicated) server, with no GUI.&lt;br /&gt;
&lt;br /&gt;
  --mp-connect ADDRESS&lt;br /&gt;
ADDRESS is the IP:port of the remote host. Port is optional.&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101:2345&lt;br /&gt;
&lt;br /&gt;
As above, port can be specified by placing the port number after a colon in the address.&lt;br /&gt;
&lt;br /&gt;
  --map2scenario SAVE&lt;br /&gt;
Converts a save game to a User Scenario, allows saved game state to be loaded into map editor.&lt;br /&gt;
Assuming that save game name is &amp;quot;foo.zip&amp;quot;, executing &#039;./factorio --map2scenario s1&#039; will result in Factorio loading, opening the save file, and saving the scenario into the scenario folder.&lt;br /&gt;
&lt;br /&gt;
== Modding tools ==&lt;br /&gt;
A list of the internal names of most things in the vanilla game can also be found on [[data.raw]].&lt;br /&gt;
&lt;br /&gt;
=== Print to console which tile are you have under the player position ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.surface.get_tile(game.player.position.x, game.player.position.y).name)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all researched technologies to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	if tech.researched then&lt;br /&gt;
    list[#list+1] = tech.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;techs.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all enabled recipes to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, recipe in pairs(game.player.force.recipes) do &lt;br /&gt;
	if recipe.enabled then&lt;br /&gt;
    list[#list+1] = recipe.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;recipes.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=169820</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=169820"/>
		<updated>2019-03-03T19:03:09Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Create 10 fishes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Overview ==&lt;br /&gt;
The &#039;&#039;&#039;Console&#039;&#039;&#039; is Factorio&#039;s command-line interface.&lt;br /&gt;
&lt;br /&gt;
The in-game console is used for:&lt;br /&gt;
&lt;br /&gt;
* Chatting with other players&lt;br /&gt;
* Running commands / scripts / cheats&lt;br /&gt;
* Occasional status updates&lt;br /&gt;
&lt;br /&gt;
There are three types of commands:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[#Normal commands|Normal]]&#039;&#039;&#039; - Display information about the game and customize your experience.&lt;br /&gt;
* &#039;&#039;&#039;[[#Multiplayer commands|Multiplayer]]&#039;&#039;&#039; - Message filtering, banning users, etc.&lt;br /&gt;
* &#039;&#039;&#039;[[#Scripting and cheat commands|Scripting/Cheating]]&#039;&#039;&#039; - Run small Lua scripts (but they &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;disable achievements for the save game&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== Using the console ===&lt;br /&gt;
The console display can be toggled with the {{keybinding|/}} (slash) or {{keybinding|~}} (tilde) keys.&lt;br /&gt;
&lt;br /&gt;
You can customize the keys via &#039;&#039;&#039;Options Menu → Keyboard → Toggle Lua console&#039;&#039;&#039;.&lt;br /&gt;
When the console is open, you&#039;ll see a blinking cursor at the bottom of the screen; type your message or command and hit &#039;&#039;&#039;Return&#039;&#039;&#039; to send it (this will also close the console).&lt;br /&gt;
Documentation about message and command prefixes can be found further down this page.&lt;br /&gt;
&lt;br /&gt;
When console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages).&lt;br /&gt;
Note that by default, all executed commands are made visible to all users. You can set the fade out time via &#039;&#039;&#039;Options Menu → Other Settings → Message Delay&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you want to immediately hide the console, open the console and then press &#039;&#039;&#039;Escape&#039;&#039;&#039; key (or press &#039;&#039;&#039;Return&#039;&#039;&#039; without entering any message/command).&lt;br /&gt;
This not only closes the console, but it also hides all the recent messages/commands.&lt;br /&gt;
The console can be cleared with the &#039;&#039;&#039;/clear&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Note that the console can also accept raw Lua code as well as game commands.&lt;br /&gt;
&lt;br /&gt;
=== Console history ===&lt;br /&gt;
&lt;br /&gt;
The console has an inbuilt history; it&#039;s a bit like a text editor where only one line of text is displayed at a time.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;uarr;}} and {{keybinding|&amp;amp;darr;}} keys to scroll through the console history.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;larr;}} and {{keybinding|&amp;amp;rarr;}} keys to cursor through the currently displayed message or command, which you can edit (delete, insert, etc.) and resend (by pressing &#039;&#039;&#039;Return&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
The {{keybinding|Tab}} key will auto-complete commands and player ids.&lt;br /&gt;
&lt;br /&gt;
== Normal commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| /alerts &amp;lt;enable/disable/mute/unmute&amp;gt; &amp;lt;alert&amp;gt;&lt;br /&gt;
| /alerts disable turret_fire&lt;br /&gt;
| Enables, disables, mutes, or unmutes the given alert type. Available alerts: entity_destroyed, entity_under_attack, not_enough_construction_robots, no_material_for_construction, not_enough_repair packs, turret_fire, custom, no_storage.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /clear&lt;br /&gt;
| /clear&lt;br /&gt;
| Clears the console.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /color &amp;lt;color&amp;gt;&lt;br /&gt;
| /color 20 255 255 100&lt;br /&gt;
| Changes your color. Can either be one of the pre-defined colors or [[:Wikipedia:RGBA_color_space|RGBA value]] in the format of “# # # #”. Available colors: default, red, green, blue, orange, yellow, pink, purple, white, black, gray, brown, cyan, acid.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /evolution&lt;br /&gt;
| /evolution&lt;br /&gt;
| Prints info about the alien evolution factor.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /help [command]&lt;br /&gt;
| /help&lt;br /&gt;
| Prints a list of available commands, the optional argument can specify the command that should be described.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /h [command]&lt;br /&gt;
| /h&lt;br /&gt;
| Same as /help.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /mute-programmable-speaker &amp;lt;mute/unmute&amp;gt; &amp;lt;local/everyone&amp;gt;&lt;br /&gt;
| /mute-programmable-speaker mute local&lt;br /&gt;
| Mutes or unmutes the global sounds created by the Programmable Speaker. Use “local” to mute just the local client. Admins can use “everyone” to mute the sounds for everyone on the server.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /perf-avg-frames &amp;lt;number&amp;gt;&lt;br /&gt;
| /perf-avg-frames 100&lt;br /&gt;
| Number of ticks/updates used to average performance counters. Default is 100. Value of 5-10 is recommended for fast convergence, but numbers will jitter more rapidly.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /permissions&lt;br /&gt;
| /permissions&lt;br /&gt;
| Opens the permissions GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /screenshot [x resolution] [y resolution] [zoom]&lt;br /&gt;
| /screenshot&lt;br /&gt;
| Takes a screenshot with the GUI hidden, centered on the player. It is saved in the &amp;quot;script-output&amp;quot; subfolder of your [[User data directory]].  Resolution is optional and defaults to the current window size. Zoom is optional and defaults to 1.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /seed&lt;br /&gt;
| /seed&lt;br /&gt;
| Prints the starting map seed.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /time&lt;br /&gt;
| /time&lt;br /&gt;
| Prints info about how old the map is.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| Toggles logging all input actions performed by the game. This value isn’t persisted between game restarts and only affects your local game in multiplayer sessions.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| Used to investigate desyncs. Will slow down the game and make multiplayer unplayable.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| Toggles if the rockets sent button is shown in the upper left corner of the screen.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /version&lt;br /&gt;
| /version&lt;br /&gt;
| Prints the current game version.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Multiplayer commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;message&amp;gt;&lt;br /&gt;
| Hello team!&lt;br /&gt;
| Console input that does not start with {{keybinding|/}} is shown as a chat message to your team.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /admins&lt;br /&gt;
| /admins&lt;br /&gt;
| Prints a list of game admins.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ban &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /ban xTROLLx Throwing grenades in base&lt;br /&gt;
| Bans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /banlist &amp;lt;add/remove/get/clear&amp;gt; &amp;lt;player&amp;gt;&lt;br /&gt;
| /banlist get&lt;br /&gt;
| Adds or removes a player from the banlist. Same as /ban or /unban.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /config &amp;lt;get/set&amp;gt; &amp;lt;option&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
| /config set password hunter2&lt;br /&gt;
| Gets or sets various multiplayer game settings. Available configs are: afk-auto-kick, allow-commands, allow-debug-settings, autosave-interval, autosave-only-on-server, ignore-player-limit-for-returning-players, max-players, max-upload-speed, only-admins-can-pause, password, require-user-verification, visibility-lan, visibility-public.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /delete-blueprint-library &amp;lt;player&amp;gt;&lt;br /&gt;
| /delete-blueprint-library everybody confirm&lt;br /&gt;
| Deletes the blueprint library storage for the given offline player from the save file. Enter “everybody confirm” to delete the storage of all offline players.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /demote &amp;lt;player&amp;gt;&lt;br /&gt;
| /demote AzureDiamond&lt;br /&gt;
| Demotes the player from admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /ignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /ignore Cthon98&lt;br /&gt;
| Prevents the chat from showing messages from this player. Admin messages are still shown.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ignores&lt;br /&gt;
| /ignores&lt;br /&gt;
| Prints a list of ignored players.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /kick &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /kick xTROLLx Throwing grenades in base&lt;br /&gt;
| Kicks the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mute &amp;lt;player&amp;gt;&lt;br /&gt;
| /mute Cthon98&lt;br /&gt;
| Prevents the player from saying anything in chat.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mutes&lt;br /&gt;
| /mutes&lt;br /&gt;
| All players that are muted (can’t talk in chat).&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /open &amp;lt;player&amp;gt;&lt;br /&gt;
| /open AzureDiamond&lt;br /&gt;
| Opens another player’s inventory.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /o &amp;lt;player&amp;gt;&lt;br /&gt;
| /o AzureDiamond&lt;br /&gt;
| Same as /open.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /players [online/o/count/c]&lt;br /&gt;
| /players&lt;br /&gt;
| Prints a list of players in the game. (parameter online/o, it prints only players that are online, count/c prints only count)&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /promote &amp;lt;player&amp;gt;&lt;br /&gt;
| /promote AzureDiamond&lt;br /&gt;
| Promotes the player to admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /purge &amp;lt;player&amp;gt;&lt;br /&gt;
| /purge Cthon98&lt;br /&gt;
| Clears all the messages from this player from the chat log.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /reply &amp;lt;message&amp;gt;&lt;br /&gt;
| /reply oh, really?&lt;br /&gt;
| Replies to the last player that whispered to you.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /r &amp;lt;message&amp;gt;&lt;br /&gt;
| /r oh, really?&lt;br /&gt;
| Same as /reply.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /server-save&lt;br /&gt;
| /server-save&lt;br /&gt;
| Saves the game on the server in a multiplayer game.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /shout &amp;lt;message&amp;gt;&lt;br /&gt;
| /shout Hello world!&lt;br /&gt;
| Sends a message to all players including other forces.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /s &amp;lt;message&amp;gt;&lt;br /&gt;
| /s Hello world!&lt;br /&gt;
| Same as /shout.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /swap-players &amp;lt;player&amp;gt; [player]&lt;br /&gt;
| /swap-players AzureDiamond&lt;br /&gt;
| Swaps your character with the given player’s character, or if two players are given swaps the two player characters.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unban &amp;lt;player&amp;gt;&lt;br /&gt;
| /unban xTROLLx&lt;br /&gt;
| Unbans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /unignore Cthon98&lt;br /&gt;
| Allows the chat to show messages from this player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unmute &amp;lt;player&amp;gt;&lt;br /&gt;
| /unmute Cthon98&lt;br /&gt;
| Allows the player to talk in chat again.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /whisper &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /whisper AzureDiamond thats what I see&lt;br /&gt;
| Sends a message to the specified player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /w &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /w AzureDiamond thats what I see&lt;br /&gt;
| Same as /whisper.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /whitelist &amp;lt;add/remove/get/clear&amp;gt; [player]&lt;br /&gt;
| /whitelist get&lt;br /&gt;
| Adds or removes a player from the whitelist, where only whitelisted players can join the game. Enter nothing for “player” when using “get” to print a list of all whitelisted players. An empty whitelist disables the whitelist functionality allowing anyone to join.&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scripting and cheat commands ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| /c &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /measured-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command and measures time it took.&lt;br /&gt;
|-&lt;br /&gt;
| /silent-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command without printing it to the console.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a very powerful feature, which also allows cheating, and as such &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;achievements will be permanently disabled for the save&amp;lt;/span&amp;gt; as soon as you use a script command.&lt;br /&gt;
&lt;br /&gt;
== Basic example scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Use it as calculator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(1234*5678)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zoom beyond normal bounds ===&lt;br /&gt;
Note that zooming too far out can cause performance hits. Be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.zoom=0.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mine faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Craft faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unlock and research all technologies ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_all_technologies()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Undo this with the command in the next section.&lt;br /&gt;
&lt;br /&gt;
=== Unresearch all technologies ===&lt;br /&gt;
This does not reset manually applied bonuses&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	tech.researched=false&lt;br /&gt;
	game.player.force.set_saved_technology_progress(tech, 0)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Cancel current research ===&lt;br /&gt;
Cancels the current research.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.current_research = nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reset your force ===&lt;br /&gt;
This resets all data for your force, including kill and production statistics, technologies, bonuses and charting status.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.reset()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Always show rail block visualization ===&lt;br /&gt;
Permanently show the rail block visualization instead of only when holding a rail signal. Disable by replacing true with false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.game_view_settings.show_rail_block_visualisation = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inventory manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Cheat mode ===&lt;br /&gt;
Allows for infinite free crafting. Disable by replacing true with false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.cheat_mode=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource tile in-game&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.amount=7500&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can refill all resources in the map with the following command. Change ore.amount to the desired value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c surface = game.player.surface&lt;br /&gt;
for _, ore in pairs(surface.find_entities_filtered({type=&amp;quot;resource&amp;quot;})) do&lt;br /&gt;
    ore.amount = 10000&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add items to the player&#039;s inventory ===&lt;br /&gt;
Replace iron-plate with the [[data.raw|internal name]] of the item desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For instance, here&#039;s a stack of the god-mode energy system interface:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;electric-energy-interface&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a powerful armor with equipment and some tools for construction:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c	local player = game.player&lt;br /&gt;
player.insert{name=&amp;quot;power-armor-mk2&amp;quot;, count = 1}&lt;br /&gt;
local p_armor = player.get_inventory(5)[1].grid&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;personal-roboport-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;night-vision-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
player.insert{name=&amp;quot;construction-robot&amp;quot;, count = 25}&lt;br /&gt;
player.insert{name=&amp;quot;blueprint&amp;quot;, count = 3}&lt;br /&gt;
player.insert{name=&amp;quot;deconstruction-planner&amp;quot;, count = 1}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== World manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Reveal the map around the player ===&lt;br /&gt;
&lt;br /&gt;
Reveals the map around the player, similar to a [[radar]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or from start position&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces.player.chart(game.player.surface, {{x = -2000, y = -2000}, {x = 2000, y = 2000}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change 150 to the desired radius, higher values take longer.&lt;br /&gt;
&lt;br /&gt;
=== Delete chunks ===&lt;br /&gt;
If much of the map is revealed, it increases the size of the save file. The following command cancels the generation of all chunks that are currently queued for generation and removes chunks outside a 32 chunks radius around 0,0. Note that this will remove player entities if there are any on these chunks.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface;&lt;br /&gt;
game.player.force.cancel_charting(surface); &lt;br /&gt;
local chunk_radius = 32;&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  if (chunk.x &amp;lt; -chunk_radius or chunk.x &amp;gt; chunk_radius or chunk.y &amp;lt; -chunk_radius or chunk.y &amp;gt; chunk_radius) then&lt;br /&gt;
    surface.delete_chunk(chunk)&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
Enables eternal day.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.always_day=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change game speed ===&lt;br /&gt;
0.5 is half speed, 1 is default, 2 is double speed, etc. Minimum is 0.01. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.speed=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expensive (marathon) or normal mode ===&lt;br /&gt;
To change from normal to expensive mode preset (this changes the research cost and intermediate product cost):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change back to normal:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Freeze time ===&lt;br /&gt;
Stops the advancement of the time if you replace &amp;quot;BOOL&amp;quot; with &amp;quot;true&amp;quot; or unfreezes it if you replace it with &amp;quot;false&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.freeze_daytime=BOOL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.clear_pollution()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Completely turn off pollution ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, surface in pairs(game.surfaces) do&lt;br /&gt;
  surface.clear_pollution()&lt;br /&gt;
end&lt;br /&gt;
game.map_settings.pollution.enabled = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add a lot of pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.pollute(game.player.position, 1000000)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where speakers are, by who ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c speakers = game.player.surface.find_entities_filtered{force = &amp;quot;player&amp;quot;, type=&amp;quot;programmable-speaker&amp;quot;}&lt;br /&gt;
for key, speaker in pairs(speakers) do&lt;br /&gt;
    game.player.print(speaker.last_user.name .. &amp;quot; placed a speaker at X=&amp;quot; .. speaker.position.x .. &amp;quot;, Y=&amp;quot; .. speaker.position.y)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable friendly fire for your force ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.friendly_fire = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 11×11 patch of resources, centered on the player character, where the ground is not water.&lt;br /&gt;
The patch it creates is perfectly square but it randomizes the amount similar to natural generation, with fewer ore at the edges and more ore in the center.&lt;br /&gt;
The default numbers result in a patch with 2500-3000 ore.&lt;br /&gt;
&lt;br /&gt;
If you want a larger patch, change &amp;quot;local size = 5&amp;quot; to a larger number.&lt;br /&gt;
A larger patch will have exponentially more ore.&lt;br /&gt;
Entering a number above 30 is not recommended.&lt;br /&gt;
&lt;br /&gt;
If you want a richer patch, change &amp;quot;local density = 10&amp;quot; to a larger number.&lt;br /&gt;
Entering a very large number shouldn&#039;t hurt anything but you probably don&#039;t need to go above 100.&lt;br /&gt;
&lt;br /&gt;
To choose which resource is spawned, change &amp;quot;stone&amp;quot; near the bottom to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, &amp;quot;coal&amp;quot;, or &amp;quot;uranium-ore&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local ore=nil&lt;br /&gt;
local size=5&lt;br /&gt;
local density=10&lt;br /&gt;
for y=-size, size do&lt;br /&gt;
	for x=-size, size do&lt;br /&gt;
		a=(size+1-math.abs(x))*10&lt;br /&gt;
		b=(size+1-math.abs(y))*10&lt;br /&gt;
		if a&amp;lt;b then&lt;br /&gt;
			ore=math.random(a*density-a*(density-8), a*density+a*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if b&amp;lt;a then&lt;br /&gt;
			ore=math.random(b*density-b*(density-8), b*density+b*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if surface.get_tile(game.player.position.x+x, game.player.position.y+y).collides_with(&amp;quot;ground-tile&amp;quot;) then&lt;br /&gt;
			surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=ore, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove resources around the player ===&lt;br /&gt;
Removes all resource patches from the ground in a 50 x 50 area around the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local size=50&lt;br /&gt;
local pos=game.player.position&lt;br /&gt;
&lt;br /&gt;
for _, e in pairs(surface.find_entities_filtered{area={{pos.x-size, pos.y-size},{pos.x+size, pos.y+size}}, type=&amp;quot;resource&amp;quot;}) &lt;br /&gt;
	do e.destroy() &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches in a 3×3 square.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for y=0,2 do&lt;br /&gt;
	for x=0,2 do&lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or randomly without any collision:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local position=nil&lt;br /&gt;
for i=1,9 do&lt;br /&gt;
	position=game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
	if position then &lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position=position})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create 10 fishes ===&lt;br /&gt;
This creates 10 fishes around of player. The player must be on the water edge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local player = game.player&lt;br /&gt;
local surface = player.surface&lt;br /&gt;
for i = 1, 10 do&lt;br /&gt;
  local position = surface.find_non_colliding_position(&#039;fish&#039;, player.position, 10, 1)&lt;br /&gt;
  if not position then return end&lt;br /&gt;
  surface.create_entity {name = &#039;fish&#039;, position = position}&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Count entities ===&lt;br /&gt;
Counts all entities whose name includes the string in local entity.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local entity=&amp;quot;belt&amp;quot;&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local count=0&lt;br /&gt;
for key, ent in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(ent.name,entity) then&lt;br /&gt;
		count=count+1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(count)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emptying all pipes, underground pipes and pumps ===&lt;br /&gt;
Useful when pipes contain a fluid you dont want.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local deleted=0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(entity.name, &amp;quot;pipe&amp;quot;) or &lt;br /&gt;
		string.find(entity.name, &amp;quot;pump&amp;quot;) &lt;br /&gt;
	then&lt;br /&gt;
		for i=1,#entity.fluidbox do&lt;br /&gt;
			deleted = deleted + 1&lt;br /&gt;
			entity.fluidbox[i] = nil;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(&amp;quot;Fluids removed from &amp;quot;..deleted ..&amp;quot; entities&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off cliff generation ===&lt;br /&gt;
Sets size to &amp;quot;none&amp;quot;. Only effective on chunks that are generated after using this command. Use [[#Remove all cliffs]] to delete existing cliffs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local mgs = game.player.surface.map_gen_settings&lt;br /&gt;
mgs.cliff_settings.cliff_elevation_0 = 1024&lt;br /&gt;
game.player.surface.map_gen_settings = mgs&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all cliffs ===&lt;br /&gt;
Removes all cliffs existing cliffs from the world. Use [[#Turn off cliff generation]] to turn off cliff generation in new chunks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, v in pairs(game.player.surface.find_entities_filtered{type=&amp;quot;cliff&amp;quot;}) do&lt;br /&gt;
  v.destroy()&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Delete all decoratives ===&lt;br /&gt;
Delete the decoratives that can be found in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
for c in surface.get_chunks() do&lt;br /&gt;
	surface.destroy_decoratives({{c.x*32, c.y*32}, {c.x*32+32, c.y*32+32}})&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change map generation settings ===&lt;br /&gt;
This allows to change the map generation settings for new chunks; it does not alter already generated chunks. [[#Delete chunks|Deleted chunks]] are affected by the setting change because they are newly generated when they get explored again.&lt;br /&gt;
&lt;br /&gt;
To change resource generation settings, replace &amp;quot;iron-ore&amp;quot; with the [[Data.raw#resource|resource]] that should be changed and replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command. Replace &amp;quot;iron-ore&amp;quot; with &amp;quot;enemy-base&amp;quot; to change the enemy base generation settings. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local resource = &amp;quot;iron-ore&amp;quot;&lt;br /&gt;
local autoplace = surface.map_gen_settings.autoplace_controls&lt;br /&gt;
autoplace[resource].size = &amp;quot;very-high&amp;quot;&lt;br /&gt;
autoplace[resource].frequency = &amp;quot;very-high&amp;quot;&lt;br /&gt;
autoplace[resource].richness = &amp;quot;very-high&amp;quot;&lt;br /&gt;
surface.map_gen_settings.autoplace_controls = autoplace&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change water generation settings, replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.water = &amp;quot;very-high&amp;quot; --[[ size]]&lt;br /&gt;
mgs.terrain_segmentation  = &amp;quot;very-high&amp;quot; --[[ frequency]]&lt;br /&gt;
surface.map_gen_settings = mgs &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enemy/evolution scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Set evolution factor ===&lt;br /&gt;
Ranges from 0 (new game) to 1.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].evolution_factor=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_evolution.time_factor=0&lt;br /&gt;
/c game.map_settings.enemy_evolution.pollution_factor=game.map_settings.enemy_evolution.pollution_factor*2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;2&amp;quot; at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.&lt;br /&gt;
&lt;br /&gt;
=== Kill all biters on the &amp;quot;enemy&amp;quot; force ===&lt;br /&gt;
Note that this will kill only mobile units, spawners will not be killed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all enemies ===&lt;br /&gt;
This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the explored world, so any unexplored parts of the map which still need to be generated will still have enemies. You can [[#Prevent biters being on newly generated chunks|prevent biters being on newly generated chunks]] if desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all nearby enemies ===&lt;br /&gt;
&lt;br /&gt;
This will kill all biters, bases and worms in a configurable radius. The default, 250 tiles, is about two zoomed-out screen widths on full HD. After destruction, it shows how many objects were destroyed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius = 250&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local pp = game.player.position&lt;br /&gt;
local cnt = 0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
    if entity.position.x &amp;gt; pp.x - radius and entity.position.x &amp;lt; pp.x + radius&lt;br /&gt;
        and entity.position.y &amp;gt; pp.y - radius and entity.position.y &amp;lt; pp.y + radius then&lt;br /&gt;
        cnt = cnt+1&lt;br /&gt;
        entity.destroy()&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(cnt)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable peaceful mode ===&lt;br /&gt;
Enabling peaceful mode prevents biter attacks until provoked. Substitute true for false to disable. Already existing biters are not affected by this command so attacks could continue for a while after activating peaceful mode.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.peaceful_mode = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable biter expansion ===&lt;br /&gt;
Biter expansion allows biters to create new nests, it is enabled by default. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_expansion.enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Prevent biters being on newly generated chunks ===&lt;br /&gt;
On newly generated chunks no biters will be present, however all current biters will remain unaffected. Equivalent of setting the Enemy Base Size to None under the Terrain settings during map generation but achieved mid game by [[#Change map generation settings|changing map generation settings]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.autoplace_controls[&amp;quot;enemy-base&amp;quot;].size = &amp;quot;none&amp;quot;&lt;br /&gt;
surface.map_gen_settings = mgs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Player character scripts ==&lt;br /&gt;
Commands concerning the player directly.&lt;br /&gt;
=== Get player position ===&lt;br /&gt;
Prints coordinates of your current position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.position.x .. &amp;quot;, &amp;quot; .. game.player.position.y)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Teleport player ===&lt;br /&gt;
Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.teleport({X, Y})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To teleport to the world&#039;s origin, use 0,0.&lt;br /&gt;
&lt;br /&gt;
=== Enable god mode ===&lt;br /&gt;
God mode removes your player character allowing you to fly over obstacles and take no damage.&lt;br /&gt;
&lt;br /&gt;
Disassociate your controls from the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.character=nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, hover the mouse over the useless player and destroy it by typing:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.destroy()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To undo, spawn a player character. This will spawn a new player at the spawn point of the world, and connect your controls to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.create_character()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable long reach ===&lt;br /&gt;
Enables long reach, which allows the player to build and interact with entities at a greater distance. The default reach is 10.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local reach = 10000&lt;br /&gt;
game.player.force.character_build_distance_bonus = reach&lt;br /&gt;
game.player.force.character_reach_distance_bonus = reach&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Enable Research Queue ===&lt;br /&gt;
Enable the research queue for the players current team. Can be done after the game has started if it was forgotten during the map&#039;s setup.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_queue_enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.laboratory_speed_modifier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
1 is normal speed, 2 is double speed 3 is triple etc.&lt;br /&gt;
&lt;br /&gt;
=== Research specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=true&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unresearch specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;electric-energy-distribution-1&#039;, 0)&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;steel-processing&#039;, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling specific recipes ===&lt;br /&gt;
The internal recipe/item names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;electric-energy-interface&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;rocket-silo&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes.loader.enabled=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable all recipes ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name, recipe in pairs(game.player.force.recipes) do recipe.enabled = true end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command line parameters ==&lt;br /&gt;
&#039;&#039;&#039;As of Game Version 0.15.13&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Command line parameters can be used to set settings in the command line before the game launches, this is useful mainly for advanced users or server hosts.&lt;br /&gt;
&lt;br /&gt;
General options:&lt;br /&gt;
  -h [ --help ]                      display help&lt;br /&gt;
  --version                          show version information&lt;br /&gt;
  -v [ --verbose ]                   enable verbose logging&lt;br /&gt;
  -c [ --config ] PATH               config file to use&lt;br /&gt;
  --no-log-rotation                  don&#039;t rotate log file&lt;br /&gt;
  --mod-directory PATH               Mod directory to use&lt;br /&gt;
  --check-unused-prototype-data      Print a warning for all prototype values that were not accessed&lt;br /&gt;
  --window-size WIDTHxHEIGHT         Resolution in format &#039;&#039;WIDTHxHEIGHT&#039;&#039; or the value &#039;&#039;maximized&#039;&#039;. Applies when Factorio run in windowed mode (non full screen). Default maximized.&lt;br /&gt;
&lt;br /&gt;
Running options:&lt;br /&gt;
  -s [ --map2scenario ] arg          map to scenario conversion&lt;br /&gt;
  -m [ --scenario2map ] arg          scenario to map conversion&lt;br /&gt;
  --apply-update arg                 immediately apply update package&lt;br /&gt;
  --create FILE                      create a new map&lt;br /&gt;
  --map-gen-settings FILE            Map generation settings for use with --create. See data/map-gen-settings.example.json&lt;br /&gt;
  --map-settings FILE                Map settings for use with --create. See data/base/prototypes/map-settings.lua&lt;br /&gt;
  --preset arg                       Name of the map generation preset to be used.&lt;br /&gt;
  --generate-map-preview FILE        Generate preview images of the map&lt;br /&gt;
  --map-preview-size SCALE (=1,024)  Size (in pixels) of map preview&lt;br /&gt;
  --map-preview-scale SCALE (=1)     Scale (meters per pixel) of map preview&lt;br /&gt;
  --map-preview-offset X,Y (=0,0)    Offset of the center of the map, in meters&lt;br /&gt;
  --start-server FILE                start a multiplayer server&lt;br /&gt;
  --start-server-load-scenario FILE  start a multiplayer server and load the specified scenario&lt;br /&gt;
  --start-server-load-latest         start a multiplayer server and load the latest available save&lt;br /&gt;
  --until-tick TICK                  run a save until given map tick&lt;br /&gt;
  --mp-connect ADDRESS               start factorio and connect to address&lt;br /&gt;
  --load-game FILE                   start Factorio and load a game in singleplayer&lt;br /&gt;
  --benchmark FILE                   load save and run benchmark&lt;br /&gt;
  --benchmark-ticks N (=1,000)       number of ticks for benchmarking. Default is 1000&lt;br /&gt;
  --force-opengl                     use OpenGL for rendering&lt;br /&gt;
  --force-d3d                        use Direct3D for rendering&lt;br /&gt;
  --fullscreen BOOL                  start game in windowed mode (saved to configuration)&lt;br /&gt;
  --max-texture-size N               maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048&lt;br /&gt;
  --graphics-quality arg             accepted values: normal, low, very-low&lt;br /&gt;
  --video-memory-usage arg           accepted values: all, high, medium, low&lt;br /&gt;
  --gfx-safe-mode                    resets some graphics settings to values that should work on most configurations&lt;br /&gt;
  --shader arg                       enable/disable shader postprocessing (saved to configuration)&lt;br /&gt;
  --disable-audio                    Disable audio. Mainly for faster startup during development.&lt;br /&gt;
&lt;br /&gt;
Server options:&lt;br /&gt;
  --port N                           network port to use&lt;br /&gt;
  --bind ADDRESS[:PORT]              IP address (and optionally port) to bind to&lt;br /&gt;
  --rcon-port N                      Port to use for RCON&lt;br /&gt;
  --rcon-password PASSWORD           Password for RCON&lt;br /&gt;
  --server-settings FILE             Path to file with server settings. See data/server-settings.example.json&lt;br /&gt;
  --server-whitelist FILE            Path to file with server whitelist.&lt;br /&gt;
  --server-banlist FILE              Path to file with server banlist.&lt;br /&gt;
  --console-log FILE                 Path to file where a copy of the server&#039;s log will be stored&lt;br /&gt;
  --server-id FILE                   Path where server ID will be stored or read from&lt;br /&gt;
&lt;br /&gt;
=== Multiplayer ===&lt;br /&gt;
&lt;br /&gt;
  --start-server SAVE&lt;br /&gt;
&lt;br /&gt;
Will start a Headless (Dedicated) server, with no GUI.&lt;br /&gt;
&lt;br /&gt;
  --mp-connect ADDRESS&lt;br /&gt;
ADDRESS is the IP:port of the remote host. Port is optional.&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101:2345&lt;br /&gt;
&lt;br /&gt;
As above, port can be specified by placing the port number after a colon in the address.&lt;br /&gt;
&lt;br /&gt;
  --map2scenario SAVE&lt;br /&gt;
Converts a save game to a User Scenario, allows saved game state to be loaded into map editor.&lt;br /&gt;
Assuming that save game name is &amp;quot;foo.zip&amp;quot;, executing &#039;./factorio --map2scenario s1&#039; will result in Factorio loading, opening the save file, and saving the scenario into the scenario folder.&lt;br /&gt;
&lt;br /&gt;
== Modding tools ==&lt;br /&gt;
A list of the internal names of most things in the vanilla game can also be found on [[data.raw]].&lt;br /&gt;
&lt;br /&gt;
=== Print to console which tile are you have under the player position ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.surface.get_tile(game.player.position.x, game.player.position.y).name)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all researched technologies to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	if tech.researched then&lt;br /&gt;
    list[#list+1] = tech.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;techs.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all enabled recipes to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, recipe in pairs(game.player.force.recipes) do &lt;br /&gt;
	if recipe.enabled then&lt;br /&gt;
    list[#list+1] = recipe.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;recipes.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=169818</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=169818"/>
		<updated>2019-03-03T18:55:37Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Add new oil patch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Overview ==&lt;br /&gt;
The &#039;&#039;&#039;Console&#039;&#039;&#039; is Factorio&#039;s command-line interface.&lt;br /&gt;
&lt;br /&gt;
The in-game console is used for:&lt;br /&gt;
&lt;br /&gt;
* Chatting with other players&lt;br /&gt;
* Running commands / scripts / cheats&lt;br /&gt;
* Occasional status updates&lt;br /&gt;
&lt;br /&gt;
There are three types of commands:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[#Normal commands|Normal]]&#039;&#039;&#039; - Display information about the game and customize your experience.&lt;br /&gt;
* &#039;&#039;&#039;[[#Multiplayer commands|Multiplayer]]&#039;&#039;&#039; - Message filtering, banning users, etc.&lt;br /&gt;
* &#039;&#039;&#039;[[#Scripting and cheat commands|Scripting/Cheating]]&#039;&#039;&#039; - Run small Lua scripts (but they &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;disable achievements for the save game&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== Using the console ===&lt;br /&gt;
The console display can be toggled with the {{keybinding|/}} (slash) or {{keybinding|~}} (tilde) keys.&lt;br /&gt;
&lt;br /&gt;
You can customize the keys via &#039;&#039;&#039;Options Menu → Keyboard → Toggle Lua console&#039;&#039;&#039;.&lt;br /&gt;
When the console is open, you&#039;ll see a blinking cursor at the bottom of the screen; type your message or command and hit &#039;&#039;&#039;Return&#039;&#039;&#039; to send it (this will also close the console).&lt;br /&gt;
Documentation about message and command prefixes can be found further down this page.&lt;br /&gt;
&lt;br /&gt;
When console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages).&lt;br /&gt;
Note that by default, all executed commands are made visible to all users. You can set the fade out time via &#039;&#039;&#039;Options Menu → Other Settings → Message Delay&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you want to immediately hide the console, open the console and then press &#039;&#039;&#039;Escape&#039;&#039;&#039; key (or press &#039;&#039;&#039;Return&#039;&#039;&#039; without entering any message/command).&lt;br /&gt;
This not only closes the console, but it also hides all the recent messages/commands.&lt;br /&gt;
The console can be cleared with the &#039;&#039;&#039;/clear&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Note that the console can also accept raw Lua code as well as game commands.&lt;br /&gt;
&lt;br /&gt;
=== Console history ===&lt;br /&gt;
&lt;br /&gt;
The console has an inbuilt history; it&#039;s a bit like a text editor where only one line of text is displayed at a time.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;uarr;}} and {{keybinding|&amp;amp;darr;}} keys to scroll through the console history.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;larr;}} and {{keybinding|&amp;amp;rarr;}} keys to cursor through the currently displayed message or command, which you can edit (delete, insert, etc.) and resend (by pressing &#039;&#039;&#039;Return&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
The {{keybinding|Tab}} key will auto-complete commands and player ids.&lt;br /&gt;
&lt;br /&gt;
== Normal commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| /alerts &amp;lt;enable/disable/mute/unmute&amp;gt; &amp;lt;alert&amp;gt;&lt;br /&gt;
| /alerts disable turret_fire&lt;br /&gt;
| Enables, disables, mutes, or unmutes the given alert type. Available alerts: entity_destroyed, entity_under_attack, not_enough_construction_robots, no_material_for_construction, not_enough_repair packs, turret_fire, custom, no_storage.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /clear&lt;br /&gt;
| /clear&lt;br /&gt;
| Clears the console.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /color &amp;lt;color&amp;gt;&lt;br /&gt;
| /color 20 255 255 100&lt;br /&gt;
| Changes your color. Can either be one of the pre-defined colors or [[:Wikipedia:RGBA_color_space|RGBA value]] in the format of “# # # #”. Available colors: default, red, green, blue, orange, yellow, pink, purple, white, black, gray, brown, cyan, acid.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /evolution&lt;br /&gt;
| /evolution&lt;br /&gt;
| Prints info about the alien evolution factor.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /help [command]&lt;br /&gt;
| /help&lt;br /&gt;
| Prints a list of available commands, the optional argument can specify the command that should be described.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /h [command]&lt;br /&gt;
| /h&lt;br /&gt;
| Same as /help.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /mute-programmable-speaker &amp;lt;mute/unmute&amp;gt; &amp;lt;local/everyone&amp;gt;&lt;br /&gt;
| /mute-programmable-speaker mute local&lt;br /&gt;
| Mutes or unmutes the global sounds created by the Programmable Speaker. Use “local” to mute just the local client. Admins can use “everyone” to mute the sounds for everyone on the server.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /perf-avg-frames &amp;lt;number&amp;gt;&lt;br /&gt;
| /perf-avg-frames 100&lt;br /&gt;
| Number of ticks/updates used to average performance counters. Default is 100. Value of 5-10 is recommended for fast convergence, but numbers will jitter more rapidly.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /permissions&lt;br /&gt;
| /permissions&lt;br /&gt;
| Opens the permissions GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /screenshot [x resolution] [y resolution] [zoom]&lt;br /&gt;
| /screenshot&lt;br /&gt;
| Takes a screenshot with the GUI hidden, centered on the player. It is saved in the &amp;quot;script-output&amp;quot; subfolder of your [[User data directory]].  Resolution is optional and defaults to the current window size. Zoom is optional and defaults to 1.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /seed&lt;br /&gt;
| /seed&lt;br /&gt;
| Prints the starting map seed.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /time&lt;br /&gt;
| /time&lt;br /&gt;
| Prints info about how old the map is.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| Toggles logging all input actions performed by the game. This value isn’t persisted between game restarts and only affects your local game in multiplayer sessions.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| Used to investigate desyncs. Will slow down the game and make multiplayer unplayable.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| Toggles if the rockets sent button is shown in the upper left corner of the screen.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /version&lt;br /&gt;
| /version&lt;br /&gt;
| Prints the current game version.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Multiplayer commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;message&amp;gt;&lt;br /&gt;
| Hello team!&lt;br /&gt;
| Console input that does not start with {{keybinding|/}} is shown as a chat message to your team.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /admins&lt;br /&gt;
| /admins&lt;br /&gt;
| Prints a list of game admins.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ban &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /ban xTROLLx Throwing grenades in base&lt;br /&gt;
| Bans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /banlist &amp;lt;add/remove/get/clear&amp;gt; &amp;lt;player&amp;gt;&lt;br /&gt;
| /banlist get&lt;br /&gt;
| Adds or removes a player from the banlist. Same as /ban or /unban.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /config &amp;lt;get/set&amp;gt; &amp;lt;option&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
| /config set password hunter2&lt;br /&gt;
| Gets or sets various multiplayer game settings. Available configs are: afk-auto-kick, allow-commands, allow-debug-settings, autosave-interval, autosave-only-on-server, ignore-player-limit-for-returning-players, max-players, max-upload-speed, only-admins-can-pause, password, require-user-verification, visibility-lan, visibility-public.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /delete-blueprint-library &amp;lt;player&amp;gt;&lt;br /&gt;
| /delete-blueprint-library everybody confirm&lt;br /&gt;
| Deletes the blueprint library storage for the given offline player from the save file. Enter “everybody confirm” to delete the storage of all offline players.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /demote &amp;lt;player&amp;gt;&lt;br /&gt;
| /demote AzureDiamond&lt;br /&gt;
| Demotes the player from admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /ignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /ignore Cthon98&lt;br /&gt;
| Prevents the chat from showing messages from this player. Admin messages are still shown.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ignores&lt;br /&gt;
| /ignores&lt;br /&gt;
| Prints a list of ignored players.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /kick &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /kick xTROLLx Throwing grenades in base&lt;br /&gt;
| Kicks the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mute &amp;lt;player&amp;gt;&lt;br /&gt;
| /mute Cthon98&lt;br /&gt;
| Prevents the player from saying anything in chat.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mutes&lt;br /&gt;
| /mutes&lt;br /&gt;
| All players that are muted (can’t talk in chat).&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /open &amp;lt;player&amp;gt;&lt;br /&gt;
| /open AzureDiamond&lt;br /&gt;
| Opens another player’s inventory.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /o &amp;lt;player&amp;gt;&lt;br /&gt;
| /o AzureDiamond&lt;br /&gt;
| Same as /open.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /players [online/o/count/c]&lt;br /&gt;
| /players&lt;br /&gt;
| Prints a list of players in the game. (parameter online/o, it prints only players that are online, count/c prints only count)&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /promote &amp;lt;player&amp;gt;&lt;br /&gt;
| /promote AzureDiamond&lt;br /&gt;
| Promotes the player to admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /purge &amp;lt;player&amp;gt;&lt;br /&gt;
| /purge Cthon98&lt;br /&gt;
| Clears all the messages from this player from the chat log.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /reply &amp;lt;message&amp;gt;&lt;br /&gt;
| /reply oh, really?&lt;br /&gt;
| Replies to the last player that whispered to you.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /r &amp;lt;message&amp;gt;&lt;br /&gt;
| /r oh, really?&lt;br /&gt;
| Same as /reply.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /server-save&lt;br /&gt;
| /server-save&lt;br /&gt;
| Saves the game on the server in a multiplayer game.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /shout &amp;lt;message&amp;gt;&lt;br /&gt;
| /shout Hello world!&lt;br /&gt;
| Sends a message to all players including other forces.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /s &amp;lt;message&amp;gt;&lt;br /&gt;
| /s Hello world!&lt;br /&gt;
| Same as /shout.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /swap-players &amp;lt;player&amp;gt; [player]&lt;br /&gt;
| /swap-players AzureDiamond&lt;br /&gt;
| Swaps your character with the given player’s character, or if two players are given swaps the two player characters.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unban &amp;lt;player&amp;gt;&lt;br /&gt;
| /unban xTROLLx&lt;br /&gt;
| Unbans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /unignore Cthon98&lt;br /&gt;
| Allows the chat to show messages from this player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unmute &amp;lt;player&amp;gt;&lt;br /&gt;
| /unmute Cthon98&lt;br /&gt;
| Allows the player to talk in chat again.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /whisper &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /whisper AzureDiamond thats what I see&lt;br /&gt;
| Sends a message to the specified player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /w &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /w AzureDiamond thats what I see&lt;br /&gt;
| Same as /whisper.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /whitelist &amp;lt;add/remove/get/clear&amp;gt; [player]&lt;br /&gt;
| /whitelist get&lt;br /&gt;
| Adds or removes a player from the whitelist, where only whitelisted players can join the game. Enter nothing for “player” when using “get” to print a list of all whitelisted players. An empty whitelist disables the whitelist functionality allowing anyone to join.&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scripting and cheat commands ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| /c &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /measured-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command and measures time it took.&lt;br /&gt;
|-&lt;br /&gt;
| /silent-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command without printing it to the console.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a very powerful feature, which also allows cheating, and as such &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;achievements will be permanently disabled for the save&amp;lt;/span&amp;gt; as soon as you use a script command.&lt;br /&gt;
&lt;br /&gt;
== Basic example scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Use it as calculator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(1234*5678)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zoom beyond normal bounds ===&lt;br /&gt;
Note that zooming too far out can cause performance hits. Be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.zoom=0.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mine faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Craft faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unlock and research all technologies ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_all_technologies()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Undo this with the command in the next section.&lt;br /&gt;
&lt;br /&gt;
=== Unresearch all technologies ===&lt;br /&gt;
This does not reset manually applied bonuses&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	tech.researched=false&lt;br /&gt;
	game.player.force.set_saved_technology_progress(tech, 0)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Cancel current research ===&lt;br /&gt;
Cancels the current research.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.current_research = nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reset your force ===&lt;br /&gt;
This resets all data for your force, including kill and production statistics, technologies, bonuses and charting status.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.reset()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Always show rail block visualization ===&lt;br /&gt;
Permanently show the rail block visualization instead of only when holding a rail signal. Disable by replacing true with false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.game_view_settings.show_rail_block_visualisation = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inventory manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Cheat mode ===&lt;br /&gt;
Allows for infinite free crafting. Disable by replacing true with false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.cheat_mode=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource tile in-game&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.amount=7500&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can refill all resources in the map with the following command. Change ore.amount to the desired value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c surface = game.player.surface&lt;br /&gt;
for _, ore in pairs(surface.find_entities_filtered({type=&amp;quot;resource&amp;quot;})) do&lt;br /&gt;
    ore.amount = 10000&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add items to the player&#039;s inventory ===&lt;br /&gt;
Replace iron-plate with the [[data.raw|internal name]] of the item desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For instance, here&#039;s a stack of the god-mode energy system interface:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;electric-energy-interface&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a powerful armor with equipment and some tools for construction:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c	local player = game.player&lt;br /&gt;
player.insert{name=&amp;quot;power-armor-mk2&amp;quot;, count = 1}&lt;br /&gt;
local p_armor = player.get_inventory(5)[1].grid&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;personal-roboport-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;night-vision-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
player.insert{name=&amp;quot;construction-robot&amp;quot;, count = 25}&lt;br /&gt;
player.insert{name=&amp;quot;blueprint&amp;quot;, count = 3}&lt;br /&gt;
player.insert{name=&amp;quot;deconstruction-planner&amp;quot;, count = 1}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== World manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Reveal the map around the player ===&lt;br /&gt;
&lt;br /&gt;
Reveals the map around the player, similar to a [[radar]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or from start position&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces.player.chart(game.player.surface, {{x = -2000, y = -2000}, {x = 2000, y = 2000}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change 150 to the desired radius, higher values take longer.&lt;br /&gt;
&lt;br /&gt;
=== Delete chunks ===&lt;br /&gt;
If much of the map is revealed, it increases the size of the save file. The following command cancels the generation of all chunks that are currently queued for generation and removes chunks outside a 32 chunks radius around 0,0. Note that this will remove player entities if there are any on these chunks.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface;&lt;br /&gt;
game.player.force.cancel_charting(surface); &lt;br /&gt;
local chunk_radius = 32;&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  if (chunk.x &amp;lt; -chunk_radius or chunk.x &amp;gt; chunk_radius or chunk.y &amp;lt; -chunk_radius or chunk.y &amp;gt; chunk_radius) then&lt;br /&gt;
    surface.delete_chunk(chunk)&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
Enables eternal day.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.always_day=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change game speed ===&lt;br /&gt;
0.5 is half speed, 1 is default, 2 is double speed, etc. Minimum is 0.01. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.speed=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expensive (marathon) or normal mode ===&lt;br /&gt;
To change from normal to expensive mode preset (this changes the research cost and intermediate product cost):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change back to normal:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Freeze time ===&lt;br /&gt;
Stops the advancement of the time if you replace &amp;quot;BOOL&amp;quot; with &amp;quot;true&amp;quot; or unfreezes it if you replace it with &amp;quot;false&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.freeze_daytime=BOOL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.clear_pollution()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Completely turn off pollution ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, surface in pairs(game.surfaces) do&lt;br /&gt;
  surface.clear_pollution()&lt;br /&gt;
end&lt;br /&gt;
game.map_settings.pollution.enabled = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add a lot of pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.pollute(game.player.position, 1000000)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where speakers are, by who ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c speakers = game.player.surface.find_entities_filtered{force = &amp;quot;player&amp;quot;, type=&amp;quot;programmable-speaker&amp;quot;}&lt;br /&gt;
for key, speaker in pairs(speakers) do&lt;br /&gt;
    game.player.print(speaker.last_user.name .. &amp;quot; placed a speaker at X=&amp;quot; .. speaker.position.x .. &amp;quot;, Y=&amp;quot; .. speaker.position.y)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable friendly fire for your force ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.friendly_fire = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 11×11 patch of resources, centered on the player character, where the ground is not water.&lt;br /&gt;
The patch it creates is perfectly square but it randomizes the amount similar to natural generation, with fewer ore at the edges and more ore in the center.&lt;br /&gt;
The default numbers result in a patch with 2500-3000 ore.&lt;br /&gt;
&lt;br /&gt;
If you want a larger patch, change &amp;quot;local size = 5&amp;quot; to a larger number.&lt;br /&gt;
A larger patch will have exponentially more ore.&lt;br /&gt;
Entering a number above 30 is not recommended.&lt;br /&gt;
&lt;br /&gt;
If you want a richer patch, change &amp;quot;local density = 10&amp;quot; to a larger number.&lt;br /&gt;
Entering a very large number shouldn&#039;t hurt anything but you probably don&#039;t need to go above 100.&lt;br /&gt;
&lt;br /&gt;
To choose which resource is spawned, change &amp;quot;stone&amp;quot; near the bottom to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, &amp;quot;coal&amp;quot;, or &amp;quot;uranium-ore&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local ore=nil&lt;br /&gt;
local size=5&lt;br /&gt;
local density=10&lt;br /&gt;
for y=-size, size do&lt;br /&gt;
	for x=-size, size do&lt;br /&gt;
		a=(size+1-math.abs(x))*10&lt;br /&gt;
		b=(size+1-math.abs(y))*10&lt;br /&gt;
		if a&amp;lt;b then&lt;br /&gt;
			ore=math.random(a*density-a*(density-8), a*density+a*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if b&amp;lt;a then&lt;br /&gt;
			ore=math.random(b*density-b*(density-8), b*density+b*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if surface.get_tile(game.player.position.x+x, game.player.position.y+y).collides_with(&amp;quot;ground-tile&amp;quot;) then&lt;br /&gt;
			surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=ore, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove resources around the player ===&lt;br /&gt;
Removes all resource patches from the ground in a 50 x 50 area around the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local size=50&lt;br /&gt;
local pos=game.player.position&lt;br /&gt;
&lt;br /&gt;
for _, e in pairs(surface.find_entities_filtered{area={{pos.x-size, pos.y-size},{pos.x+size, pos.y+size}}, type=&amp;quot;resource&amp;quot;}) &lt;br /&gt;
	do e.destroy() &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches in a 3×3 square.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for y=0,2 do&lt;br /&gt;
	for x=0,2 do&lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or randomly without any collision:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local position=nil&lt;br /&gt;
for i=1,9 do&lt;br /&gt;
	position=game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
	if position then &lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position=position})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Create 100 fishes ===&lt;br /&gt;
This creates 100 fishes around of player. The player must be on the water edge.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local player = game.player&lt;br /&gt;
local surface = player.surface&lt;br /&gt;
for i = 1, 10 do&lt;br /&gt;
  local position = surface.find_non_colliding_position(&#039;fish&#039;, player.position, 10, 1)&lt;br /&gt;
  if position then&lt;br /&gt;
    surface.create_entity {name = &#039;fish&#039;, position = position}&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Count entities ===&lt;br /&gt;
Counts all entities whose name includes the string in local entity.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local entity=&amp;quot;belt&amp;quot;&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local count=0&lt;br /&gt;
for key, ent in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(ent.name,entity) then&lt;br /&gt;
		count=count+1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(count)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emptying all pipes, underground pipes and pumps ===&lt;br /&gt;
Useful when pipes contain a fluid you dont want.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local deleted=0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(entity.name, &amp;quot;pipe&amp;quot;) or &lt;br /&gt;
		string.find(entity.name, &amp;quot;pump&amp;quot;) &lt;br /&gt;
	then&lt;br /&gt;
		for i=1,#entity.fluidbox do&lt;br /&gt;
			deleted = deleted + 1&lt;br /&gt;
			entity.fluidbox[i] = nil;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(&amp;quot;Fluids removed from &amp;quot;..deleted ..&amp;quot; entities&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off cliff generation ===&lt;br /&gt;
Sets size to &amp;quot;none&amp;quot;. Only effective on chunks that are generated after using this command. Use [[#Remove all cliffs]] to delete existing cliffs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local mgs = game.player.surface.map_gen_settings&lt;br /&gt;
mgs.cliff_settings.cliff_elevation_0 = 1024&lt;br /&gt;
game.player.surface.map_gen_settings = mgs&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all cliffs ===&lt;br /&gt;
Removes all cliffs existing cliffs from the world. Use [[#Turn off cliff generation]] to turn off cliff generation in new chunks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, v in pairs(game.player.surface.find_entities_filtered{type=&amp;quot;cliff&amp;quot;}) do&lt;br /&gt;
  v.destroy()&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Delete all decoratives ===&lt;br /&gt;
Delete the decoratives that can be found in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
for c in surface.get_chunks() do&lt;br /&gt;
	surface.destroy_decoratives({{c.x*32, c.y*32}, {c.x*32+32, c.y*32+32}})&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change map generation settings ===&lt;br /&gt;
This allows to change the map generation settings for new chunks; it does not alter already generated chunks. [[#Delete chunks|Deleted chunks]] are affected by the setting change because they are newly generated when they get explored again.&lt;br /&gt;
&lt;br /&gt;
To change resource generation settings, replace &amp;quot;iron-ore&amp;quot; with the [[Data.raw#resource|resource]] that should be changed and replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command. Replace &amp;quot;iron-ore&amp;quot; with &amp;quot;enemy-base&amp;quot; to change the enemy base generation settings. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local resource = &amp;quot;iron-ore&amp;quot;&lt;br /&gt;
local autoplace = surface.map_gen_settings.autoplace_controls&lt;br /&gt;
autoplace[resource].size = &amp;quot;very-high&amp;quot;&lt;br /&gt;
autoplace[resource].frequency = &amp;quot;very-high&amp;quot;&lt;br /&gt;
autoplace[resource].richness = &amp;quot;very-high&amp;quot;&lt;br /&gt;
surface.map_gen_settings.autoplace_controls = autoplace&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change water generation settings, replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.water = &amp;quot;very-high&amp;quot; --[[ size]]&lt;br /&gt;
mgs.terrain_segmentation  = &amp;quot;very-high&amp;quot; --[[ frequency]]&lt;br /&gt;
surface.map_gen_settings = mgs &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enemy/evolution scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Set evolution factor ===&lt;br /&gt;
Ranges from 0 (new game) to 1.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].evolution_factor=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_evolution.time_factor=0&lt;br /&gt;
/c game.map_settings.enemy_evolution.pollution_factor=game.map_settings.enemy_evolution.pollution_factor*2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;2&amp;quot; at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.&lt;br /&gt;
&lt;br /&gt;
=== Kill all biters on the &amp;quot;enemy&amp;quot; force ===&lt;br /&gt;
Note that this will kill only mobile units, spawners will not be killed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all enemies ===&lt;br /&gt;
This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the explored world, so any unexplored parts of the map which still need to be generated will still have enemies. You can [[#Prevent biters being on newly generated chunks|prevent biters being on newly generated chunks]] if desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all nearby enemies ===&lt;br /&gt;
&lt;br /&gt;
This will kill all biters, bases and worms in a configurable radius. The default, 250 tiles, is about two zoomed-out screen widths on full HD. After destruction, it shows how many objects were destroyed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius = 250&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local pp = game.player.position&lt;br /&gt;
local cnt = 0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
    if entity.position.x &amp;gt; pp.x - radius and entity.position.x &amp;lt; pp.x + radius&lt;br /&gt;
        and entity.position.y &amp;gt; pp.y - radius and entity.position.y &amp;lt; pp.y + radius then&lt;br /&gt;
        cnt = cnt+1&lt;br /&gt;
        entity.destroy()&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(cnt)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable peaceful mode ===&lt;br /&gt;
Enabling peaceful mode prevents biter attacks until provoked. Substitute true for false to disable. Already existing biters are not affected by this command so attacks could continue for a while after activating peaceful mode.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.peaceful_mode = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable biter expansion ===&lt;br /&gt;
Biter expansion allows biters to create new nests, it is enabled by default. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_expansion.enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Prevent biters being on newly generated chunks ===&lt;br /&gt;
On newly generated chunks no biters will be present, however all current biters will remain unaffected. Equivalent of setting the Enemy Base Size to None under the Terrain settings during map generation but achieved mid game by [[#Change map generation settings|changing map generation settings]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.autoplace_controls[&amp;quot;enemy-base&amp;quot;].size = &amp;quot;none&amp;quot;&lt;br /&gt;
surface.map_gen_settings = mgs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Player character scripts ==&lt;br /&gt;
Commands concerning the player directly.&lt;br /&gt;
=== Get player position ===&lt;br /&gt;
Prints coordinates of your current position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.position.x .. &amp;quot;, &amp;quot; .. game.player.position.y)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Teleport player ===&lt;br /&gt;
Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.teleport({X, Y})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To teleport to the world&#039;s origin, use 0,0.&lt;br /&gt;
&lt;br /&gt;
=== Enable god mode ===&lt;br /&gt;
God mode removes your player character allowing you to fly over obstacles and take no damage.&lt;br /&gt;
&lt;br /&gt;
Disassociate your controls from the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.character=nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, hover the mouse over the useless player and destroy it by typing:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.destroy()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To undo, spawn a player character. This will spawn a new player at the spawn point of the world, and connect your controls to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.create_character()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable long reach ===&lt;br /&gt;
Enables long reach, which allows the player to build and interact with entities at a greater distance. The default reach is 10.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local reach = 10000&lt;br /&gt;
game.player.force.character_build_distance_bonus = reach&lt;br /&gt;
game.player.force.character_reach_distance_bonus = reach&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Enable Research Queue ===&lt;br /&gt;
Enable the research queue for the players current team. Can be done after the game has started if it was forgotten during the map&#039;s setup.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_queue_enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.laboratory_speed_modifier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
1 is normal speed, 2 is double speed 3 is triple etc.&lt;br /&gt;
&lt;br /&gt;
=== Research specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=true&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unresearch specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;electric-energy-distribution-1&#039;, 0)&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;steel-processing&#039;, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling specific recipes ===&lt;br /&gt;
The internal recipe/item names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;electric-energy-interface&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;rocket-silo&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes.loader.enabled=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable all recipes ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name, recipe in pairs(game.player.force.recipes) do recipe.enabled = true end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command line parameters ==&lt;br /&gt;
&#039;&#039;&#039;As of Game Version 0.15.13&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Command line parameters can be used to set settings in the command line before the game launches, this is useful mainly for advanced users or server hosts.&lt;br /&gt;
&lt;br /&gt;
General options:&lt;br /&gt;
  -h [ --help ]                      display help&lt;br /&gt;
  --version                          show version information&lt;br /&gt;
  -v [ --verbose ]                   enable verbose logging&lt;br /&gt;
  -c [ --config ] PATH               config file to use&lt;br /&gt;
  --no-log-rotation                  don&#039;t rotate log file&lt;br /&gt;
  --mod-directory PATH               Mod directory to use&lt;br /&gt;
  --check-unused-prototype-data      Print a warning for all prototype values that were not accessed&lt;br /&gt;
  --window-size WIDTHxHEIGHT         Resolution in format &#039;&#039;WIDTHxHEIGHT&#039;&#039; or the value &#039;&#039;maximized&#039;&#039;. Applies when Factorio run in windowed mode (non full screen). Default maximized.&lt;br /&gt;
&lt;br /&gt;
Running options:&lt;br /&gt;
  -s [ --map2scenario ] arg          map to scenario conversion&lt;br /&gt;
  -m [ --scenario2map ] arg          scenario to map conversion&lt;br /&gt;
  --apply-update arg                 immediately apply update package&lt;br /&gt;
  --create FILE                      create a new map&lt;br /&gt;
  --map-gen-settings FILE            Map generation settings for use with --create. See data/map-gen-settings.example.json&lt;br /&gt;
  --map-settings FILE                Map settings for use with --create. See data/base/prototypes/map-settings.lua&lt;br /&gt;
  --preset arg                       Name of the map generation preset to be used.&lt;br /&gt;
  --generate-map-preview FILE        Generate preview images of the map&lt;br /&gt;
  --map-preview-size SCALE (=1,024)  Size (in pixels) of map preview&lt;br /&gt;
  --map-preview-scale SCALE (=1)     Scale (meters per pixel) of map preview&lt;br /&gt;
  --map-preview-offset X,Y (=0,0)    Offset of the center of the map, in meters&lt;br /&gt;
  --start-server FILE                start a multiplayer server&lt;br /&gt;
  --start-server-load-scenario FILE  start a multiplayer server and load the specified scenario&lt;br /&gt;
  --start-server-load-latest         start a multiplayer server and load the latest available save&lt;br /&gt;
  --until-tick TICK                  run a save until given map tick&lt;br /&gt;
  --mp-connect ADDRESS               start factorio and connect to address&lt;br /&gt;
  --load-game FILE                   start Factorio and load a game in singleplayer&lt;br /&gt;
  --benchmark FILE                   load save and run benchmark&lt;br /&gt;
  --benchmark-ticks N (=1,000)       number of ticks for benchmarking. Default is 1000&lt;br /&gt;
  --force-opengl                     use OpenGL for rendering&lt;br /&gt;
  --force-d3d                        use Direct3D for rendering&lt;br /&gt;
  --fullscreen BOOL                  start game in windowed mode (saved to configuration)&lt;br /&gt;
  --max-texture-size N               maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048&lt;br /&gt;
  --graphics-quality arg             accepted values: normal, low, very-low&lt;br /&gt;
  --video-memory-usage arg           accepted values: all, high, medium, low&lt;br /&gt;
  --gfx-safe-mode                    resets some graphics settings to values that should work on most configurations&lt;br /&gt;
  --shader arg                       enable/disable shader postprocessing (saved to configuration)&lt;br /&gt;
  --disable-audio                    Disable audio. Mainly for faster startup during development.&lt;br /&gt;
&lt;br /&gt;
Server options:&lt;br /&gt;
  --port N                           network port to use&lt;br /&gt;
  --bind ADDRESS[:PORT]              IP address (and optionally port) to bind to&lt;br /&gt;
  --rcon-port N                      Port to use for RCON&lt;br /&gt;
  --rcon-password PASSWORD           Password for RCON&lt;br /&gt;
  --server-settings FILE             Path to file with server settings. See data/server-settings.example.json&lt;br /&gt;
  --server-whitelist FILE            Path to file with server whitelist.&lt;br /&gt;
  --server-banlist FILE              Path to file with server banlist.&lt;br /&gt;
  --console-log FILE                 Path to file where a copy of the server&#039;s log will be stored&lt;br /&gt;
  --server-id FILE                   Path where server ID will be stored or read from&lt;br /&gt;
&lt;br /&gt;
=== Multiplayer ===&lt;br /&gt;
&lt;br /&gt;
  --start-server SAVE&lt;br /&gt;
&lt;br /&gt;
Will start a Headless (Dedicated) server, with no GUI.&lt;br /&gt;
&lt;br /&gt;
  --mp-connect ADDRESS&lt;br /&gt;
ADDRESS is the IP:port of the remote host. Port is optional.&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101:2345&lt;br /&gt;
&lt;br /&gt;
As above, port can be specified by placing the port number after a colon in the address.&lt;br /&gt;
&lt;br /&gt;
  --map2scenario SAVE&lt;br /&gt;
Converts a save game to a User Scenario, allows saved game state to be loaded into map editor.&lt;br /&gt;
Assuming that save game name is &amp;quot;foo.zip&amp;quot;, executing &#039;./factorio --map2scenario s1&#039; will result in Factorio loading, opening the save file, and saving the scenario into the scenario folder.&lt;br /&gt;
&lt;br /&gt;
== Modding tools ==&lt;br /&gt;
A list of the internal names of most things in the vanilla game can also be found on [[data.raw]].&lt;br /&gt;
&lt;br /&gt;
=== Print to console which tile are you have under the player position ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.surface.get_tile(game.player.position.x, game.player.position.y).name)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all researched technologies to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	if tech.researched then&lt;br /&gt;
    list[#list+1] = tech.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;techs.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all enabled recipes to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, recipe in pairs(game.player.force.recipes) do &lt;br /&gt;
	if recipe.enabled then&lt;br /&gt;
    list[#list+1] = recipe.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;recipes.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=169691</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=169691"/>
		<updated>2019-02-28T18:16:23Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Add items to the player&amp;#039;s inventory */ no steel axe for you!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Overview ==&lt;br /&gt;
The &#039;&#039;&#039;Console&#039;&#039;&#039; is Factorio&#039;s command-line interface.&lt;br /&gt;
&lt;br /&gt;
The in-game console is used for:&lt;br /&gt;
&lt;br /&gt;
* Chatting with other players&lt;br /&gt;
* Running commands / scripts / cheats&lt;br /&gt;
* Occasional status updates&lt;br /&gt;
&lt;br /&gt;
There are three types of commands:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[#Normal commands|Normal]]&#039;&#039;&#039; - Display information about the game and customize your experience.&lt;br /&gt;
* &#039;&#039;&#039;[[#Multiplayer commands|Multiplayer]]&#039;&#039;&#039; - Message filtering, banning users, etc.&lt;br /&gt;
* &#039;&#039;&#039;[[#Scripting and cheat commands|Scripting/Cheating]]&#039;&#039;&#039; - Run small Lua scripts (but they &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;disable achievements for the save game&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== Using the console ===&lt;br /&gt;
The console display can be toggled with the {{keybinding|/}} (slash) or {{keybinding|~}} (tilde) keys.&lt;br /&gt;
&lt;br /&gt;
You can customize the keys via &#039;&#039;&#039;Options Menu → Keyboard → Toggle Lua console&#039;&#039;&#039;.&lt;br /&gt;
When the console is open, you&#039;ll see a blinking cursor at the bottom of the screen; type your message or command and hit &#039;&#039;&#039;Return&#039;&#039;&#039; to send it (this will also close the console).&lt;br /&gt;
Documentation about message and command prefixes can be found further down this page.&lt;br /&gt;
&lt;br /&gt;
When console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages).&lt;br /&gt;
Note that by default, all executed commands are made visible to all users. You can set the fade out time via &#039;&#039;&#039;Options Menu → Other Settings → Message Delay&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you want to immediately hide the console, open the console and then press &#039;&#039;&#039;Escape&#039;&#039;&#039; key (or press &#039;&#039;&#039;Return&#039;&#039;&#039; without entering any message/command).&lt;br /&gt;
This not only closes the console, but it also hides all the recent messages/commands.&lt;br /&gt;
The console can be cleared with the &#039;&#039;&#039;/clear&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Note that the console can also accept raw Lua code as well as game commands.&lt;br /&gt;
&lt;br /&gt;
=== Console history ===&lt;br /&gt;
&lt;br /&gt;
The console has an inbuilt history; it&#039;s a bit like a text editor where only one line of text is displayed at a time.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;uarr;}} and {{keybinding|&amp;amp;darr;}} keys to scroll through the console history.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;larr;}} and {{keybinding|&amp;amp;rarr;}} keys to cursor through the currently displayed message or command, which you can edit (delete, insert, etc.) and resend (by pressing &#039;&#039;&#039;Return&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
The {{keybinding|Tab}} key will auto-complete commands and player ids.&lt;br /&gt;
&lt;br /&gt;
== Normal commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| /alerts &amp;lt;enable/disable/mute/unmute&amp;gt; &amp;lt;alert&amp;gt;&lt;br /&gt;
| /alerts disable turret_fire&lt;br /&gt;
| Enables, disables, mutes, or unmutes the given alert type. Available alerts: entity_destroyed, entity_under_attack, not_enough_construction_robots, no_material_for_construction, not_enough_repair packs, turret_fire, custom, no_storage.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /clear&lt;br /&gt;
| /clear&lt;br /&gt;
| Clears the console.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /color &amp;lt;color&amp;gt;&lt;br /&gt;
| /color 20 255 255 100&lt;br /&gt;
| Changes your color. Can either be one of the pre-defined colors or [[:Wikipedia:RGBA_color_space|RGBA value]] in the format of “# # # #”. Available colors: default, red, green, blue, orange, yellow, pink, purple, white, black, gray, brown, cyan, acid.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /evolution&lt;br /&gt;
| /evolution&lt;br /&gt;
| Prints info about the alien evolution factor.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /help [command]&lt;br /&gt;
| /help&lt;br /&gt;
| Prints a list of available commands, the optional argument can specify the command that should be described.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /h [command]&lt;br /&gt;
| /h&lt;br /&gt;
| Same as /help.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /mute-programmable-speaker &amp;lt;mute/unmute&amp;gt; &amp;lt;local/everyone&amp;gt;&lt;br /&gt;
| /mute-programmable-speaker mute local&lt;br /&gt;
| Mutes or unmutes the global sounds created by the Programmable Speaker. Use “local” to mute just the local client. Admins can use “everyone” to mute the sounds for everyone on the server.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /perf-avg-frames &amp;lt;number&amp;gt;&lt;br /&gt;
| /perf-avg-frames 100&lt;br /&gt;
| Number of ticks/updates used to average performance counters. Default is 100. Value of 5-10 is recommended for fast convergence, but numbers will jitter more rapidly.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /permissions&lt;br /&gt;
| /permissions&lt;br /&gt;
| Opens the permissions GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /screenshot [x resolution] [y resolution] [zoom]&lt;br /&gt;
| /screenshot&lt;br /&gt;
| Takes a screenshot with the GUI hidden, centered on the player. It is saved in the &amp;quot;script-output&amp;quot; subfolder of your [[User data directory]].  Resolution is optional and defaults to the current window size. Zoom is optional and defaults to 1.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /seed&lt;br /&gt;
| /seed&lt;br /&gt;
| Prints the starting map seed.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /time&lt;br /&gt;
| /time&lt;br /&gt;
| Prints info about how old the map is.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| Toggles logging all input actions performed by the game. This value isn’t persisted between game restarts and only affects your local game in multiplayer sessions.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| Used to investigate desyncs. Will slow down the game and make multiplayer unplayable.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| Toggles if the rockets sent button is shown in the upper left corner of the screen.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /version&lt;br /&gt;
| /version&lt;br /&gt;
| Prints the current game version.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Multiplayer commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;message&amp;gt;&lt;br /&gt;
| Hello team!&lt;br /&gt;
| Console input that does not start with {{keybinding|/}} is shown as a chat message to your team.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /admins&lt;br /&gt;
| /admins&lt;br /&gt;
| Prints a list of game admins.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ban &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /ban xTROLLx Throwing grenades in base&lt;br /&gt;
| Bans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /banlist &amp;lt;add/remove/get/clear&amp;gt; &amp;lt;player&amp;gt;&lt;br /&gt;
| /banlist get&lt;br /&gt;
| Adds or removes a player from the banlist. Same as /ban or /unban.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /config &amp;lt;get/set&amp;gt; &amp;lt;option&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
| /config set password hunter2&lt;br /&gt;
| Gets or sets various multiplayer game settings. Available configs are: afk-auto-kick, allow-commands, allow-debug-settings, autosave-interval, autosave-only-on-server, ignore-player-limit-for-returning-players, max-players, max-upload-speed, only-admins-can-pause, password, require-user-verification, visibility-lan, visibility-public.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /delete-blueprint-library &amp;lt;player&amp;gt;&lt;br /&gt;
| /delete-blueprint-library everybody confirm&lt;br /&gt;
| Deletes the blueprint library storage for the given offline player from the save file. Enter “everybody confirm” to delete the storage of all offline players.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /demote &amp;lt;player&amp;gt;&lt;br /&gt;
| /demote AzureDiamond&lt;br /&gt;
| Demotes the player from admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /ignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /ignore Cthon98&lt;br /&gt;
| Prevents the chat from showing messages from this player. Admin messages are still shown.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ignores&lt;br /&gt;
| /ignores&lt;br /&gt;
| Prints a list of ignored players.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /kick &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /kick xTROLLx Throwing grenades in base&lt;br /&gt;
| Kicks the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mute &amp;lt;player&amp;gt;&lt;br /&gt;
| /mute Cthon98&lt;br /&gt;
| Prevents the player from saying anything in chat.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mutes&lt;br /&gt;
| /mutes&lt;br /&gt;
| All players that are muted (can’t talk in chat).&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /open &amp;lt;player&amp;gt;&lt;br /&gt;
| /open AzureDiamond&lt;br /&gt;
| Opens another player’s inventory.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /o &amp;lt;player&amp;gt;&lt;br /&gt;
| /o AzureDiamond&lt;br /&gt;
| Same as /open.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /players [online/o/count/c]&lt;br /&gt;
| /players&lt;br /&gt;
| Prints a list of players in the game. (parameter online/o, it prints only players that are online, count/c prints only count)&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /promote &amp;lt;player&amp;gt;&lt;br /&gt;
| /promote AzureDiamond&lt;br /&gt;
| Promotes the player to admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /purge &amp;lt;player&amp;gt;&lt;br /&gt;
| /purge Cthon98&lt;br /&gt;
| Clears all the messages from this player from the chat log.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /reply &amp;lt;message&amp;gt;&lt;br /&gt;
| /reply oh, really?&lt;br /&gt;
| Replies to the last player that whispered to you.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /r &amp;lt;message&amp;gt;&lt;br /&gt;
| /r oh, really?&lt;br /&gt;
| Same as /reply.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /server-save&lt;br /&gt;
| /server-save&lt;br /&gt;
| Saves the game on the server in a multiplayer game.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /shout &amp;lt;message&amp;gt;&lt;br /&gt;
| /shout Hello world!&lt;br /&gt;
| Sends a message to all players including other forces.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /s &amp;lt;message&amp;gt;&lt;br /&gt;
| /s Hello world!&lt;br /&gt;
| Same as /shout.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /swap-players &amp;lt;player&amp;gt; [player]&lt;br /&gt;
| /swap-players AzureDiamond&lt;br /&gt;
| Swaps your character with the given player’s character, or if two players are given swaps the two player characters.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unban &amp;lt;player&amp;gt;&lt;br /&gt;
| /unban xTROLLx&lt;br /&gt;
| Unbans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /unignore Cthon98&lt;br /&gt;
| Allows the chat to show messages from this player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unmute &amp;lt;player&amp;gt;&lt;br /&gt;
| /unmute Cthon98&lt;br /&gt;
| Allows the player to talk in chat again.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /whisper &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /whisper AzureDiamond thats what I see&lt;br /&gt;
| Sends a message to the specified player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /w &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /w AzureDiamond thats what I see&lt;br /&gt;
| Same as /whisper.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /whitelist &amp;lt;add/remove/get/clear&amp;gt; [player]&lt;br /&gt;
| /whitelist get&lt;br /&gt;
| Adds or removes a player from the whitelist, where only whitelisted players can join the game. Enter nothing for “player” when using “get” to print a list of all whitelisted players. An empty whitelist disables the whitelist functionality allowing anyone to join.&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scripting and cheat commands ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| /c &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /measured-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command and measures time it took.&lt;br /&gt;
|-&lt;br /&gt;
| /silent-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command without printing it to the console.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a very powerful feature, which also allows cheating, and as such &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;achievements will be permanently disabled for the save&amp;lt;/span&amp;gt; as soon as you use a script command.&lt;br /&gt;
&lt;br /&gt;
== Basic example scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Use it as calculator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(1234*5678)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zoom beyond normal bounds ===&lt;br /&gt;
Note that zooming too far out can cause performance hits. Be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.zoom=0.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mine faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Craft faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unlock and research all technologies ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_all_technologies()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Undo this with the command in the next section.&lt;br /&gt;
&lt;br /&gt;
=== Unresearch all technologies ===&lt;br /&gt;
This does not reset manually applied bonuses&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	tech.researched=false&lt;br /&gt;
	game.player.force.set_saved_technology_progress(tech, 0)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Cancel current research ===&lt;br /&gt;
Cancels the current research.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.current_research = nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reset your force ===&lt;br /&gt;
This resets all data for your force, including kill and production statistics, technologies, bonuses and charting status.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.reset()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Always show rail block visualization ===&lt;br /&gt;
Permanently show the rail block visualization instead of only when holding a rail signal. Disable by replacing true with false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.game_view_settings.show_rail_block_visualisation = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inventory manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Cheat mode ===&lt;br /&gt;
Allows for infinite free crafting. Disable by replacing true with false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.cheat_mode=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource tile in-game&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.amount=7500&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can refill all resources in the map with the following command. Change ore.amount to the desired value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c surface = game.player.surface&lt;br /&gt;
for _, ore in pairs(surface.find_entities_filtered({type=&amp;quot;resource&amp;quot;})) do&lt;br /&gt;
    ore.amount = 10000&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add items to the player&#039;s inventory ===&lt;br /&gt;
Replace iron-plate with the [[data.raw|internal name]] of the item desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For instance, here&#039;s a stack of the god-mode energy system interface:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;electric-energy-interface&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a powerful armor with equipment and some tools for construction:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c	local player = game.player&lt;br /&gt;
player.insert{name=&amp;quot;power-armor-mk2&amp;quot;, count = 1}&lt;br /&gt;
local p_armor = player.get_inventory(5)[1].grid&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;personal-roboport-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;night-vision-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
player.insert{name=&amp;quot;construction-robot&amp;quot;, count = 25}&lt;br /&gt;
player.insert{name=&amp;quot;blueprint&amp;quot;, count = 3}&lt;br /&gt;
player.insert{name=&amp;quot;deconstruction-planner&amp;quot;, count = 1}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== World manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Reveal the map around the player ===&lt;br /&gt;
&lt;br /&gt;
Reveals the map around the player, similar to a [[radar]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or from start position&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces.player.chart(game.player.surface, {{x = -2000, y = -2000}, {x = 2000, y = 2000}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change 150 to the desired radius, higher values take longer.&lt;br /&gt;
&lt;br /&gt;
=== Delete chunks ===&lt;br /&gt;
If much of the map is revealed, it increases the size of the save file. The following command cancels the generation of all chunks that are currently queued for generation and removes chunks outside a 32 chunks radius around 0,0. Note that this will remove player entities if there are any on these chunks.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface;&lt;br /&gt;
game.player.force.cancel_charting(surface); &lt;br /&gt;
local chunk_radius = 32;&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  if (chunk.x &amp;lt; -chunk_radius or chunk.x &amp;gt; chunk_radius or chunk.y &amp;lt; -chunk_radius or chunk.y &amp;gt; chunk_radius) then&lt;br /&gt;
    surface.delete_chunk(chunk)&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
Enables eternal day.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.always_day=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change game speed ===&lt;br /&gt;
0.5 is half speed, 1 is default, 2 is double speed, etc. Minimum is 0.01. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.speed=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expensive (marathon) or normal mode ===&lt;br /&gt;
To change from normal to expensive mode preset (this changes the research cost and intermediate product cost):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change back to normal:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Freeze time ===&lt;br /&gt;
Stops the advancement of the time if you replace &amp;quot;BOOL&amp;quot; with &amp;quot;true&amp;quot; or unfreezes it if you replace it with &amp;quot;false&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.freeze_daytime=BOOL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.clear_pollution()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Completely turn off pollution ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, surface in pairs(game.surfaces) do&lt;br /&gt;
  surface.clear_pollution()&lt;br /&gt;
end&lt;br /&gt;
game.map_settings.pollution.enabled = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add a lot of pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.pollute(game.player.position, 1000000)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Where speakers are, by who ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c speakers = game.player.surface.find_entities_filtered{force = &amp;quot;player&amp;quot;, type=&amp;quot;programmable-speaker&amp;quot;}&lt;br /&gt;
for key, speaker in pairs(speakers) do&lt;br /&gt;
    game.player.print(speaker.last_user.name .. &amp;quot; placed a speaker at X=&amp;quot; .. speaker.position.x .. &amp;quot;, Y=&amp;quot; .. speaker.position.y)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable friendly fire for your force ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.friendly_fire = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 11×11 patch of resources, centered on the player character, where the ground is not water.&lt;br /&gt;
The patch it creates is perfectly square but it randomizes the amount similar to natural generation, with fewer ore at the edges and more ore in the center.&lt;br /&gt;
The default numbers result in a patch with 2500-3000 ore.&lt;br /&gt;
&lt;br /&gt;
If you want a larger patch, change &amp;quot;local size = 5&amp;quot; to a larger number.&lt;br /&gt;
A larger patch will have exponentially more ore.&lt;br /&gt;
Entering a number above 30 is not recommended.&lt;br /&gt;
&lt;br /&gt;
If you want a richer patch, change &amp;quot;local density = 10&amp;quot; to a larger number.&lt;br /&gt;
Entering a very large number shouldn&#039;t hurt anything but you probably don&#039;t need to go above 100.&lt;br /&gt;
&lt;br /&gt;
To choose which resource is spawned, change &amp;quot;stone&amp;quot; near the bottom to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, &amp;quot;coal&amp;quot;, or &amp;quot;uranium-ore&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local ore=nil&lt;br /&gt;
local size=5&lt;br /&gt;
local density=10&lt;br /&gt;
for y=-size, size do&lt;br /&gt;
	for x=-size, size do&lt;br /&gt;
		a=(size+1-math.abs(x))*10&lt;br /&gt;
		b=(size+1-math.abs(y))*10&lt;br /&gt;
		if a&amp;lt;b then&lt;br /&gt;
			ore=math.random(a*density-a*(density-8), a*density+a*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if b&amp;lt;a then&lt;br /&gt;
			ore=math.random(b*density-b*(density-8), b*density+b*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if surface.get_tile(game.player.position.x+x, game.player.position.y+y).collides_with(&amp;quot;ground-tile&amp;quot;) then&lt;br /&gt;
			surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=ore, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove resources around the player ===&lt;br /&gt;
Removes all resource patches from the ground in a 50 x 50 area around the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local size=50&lt;br /&gt;
local pos=game.player.position&lt;br /&gt;
&lt;br /&gt;
for _, e in pairs(surface.find_entities_filtered{area={{pos.x-size, pos.y-size},{pos.x+size, pos.y+size}}, type=&amp;quot;resource&amp;quot;}) &lt;br /&gt;
	do e.destroy() &lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches in a 3×3 square.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for y=0,2 do&lt;br /&gt;
	for x=0,2 do&lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or randomly without any collision:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local position=nil&lt;br /&gt;
for i=1,9 do&lt;br /&gt;
	position=game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
	if position then &lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=100000, position=position})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Count entities ===&lt;br /&gt;
Counts all entities whose name includes the string in local entity.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local entity=&amp;quot;belt&amp;quot;&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local count=0&lt;br /&gt;
for key, ent in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(ent.name,entity) then&lt;br /&gt;
		count=count+1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(count)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emptying all pipes, underground pipes and pumps ===&lt;br /&gt;
Useful when pipes contain a fluid you dont want.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local deleted=0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(entity.name, &amp;quot;pipe&amp;quot;) or &lt;br /&gt;
		string.find(entity.name, &amp;quot;pump&amp;quot;) &lt;br /&gt;
	then&lt;br /&gt;
		for i=1,#entity.fluidbox do&lt;br /&gt;
			deleted = deleted + 1&lt;br /&gt;
			entity.fluidbox[i] = nil;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(&amp;quot;Fluids removed from &amp;quot;..deleted ..&amp;quot; entities&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off cliff generation ===&lt;br /&gt;
Sets size to &amp;quot;none&amp;quot;. Only effective on chunks that are generated after using this command. Use [[#Remove all cliffs]] to delete existing cliffs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local mgs = game.player.surface.map_gen_settings&lt;br /&gt;
mgs.cliff_settings.cliff_elevation_0 = 1024&lt;br /&gt;
game.player.surface.map_gen_settings = mgs&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all cliffs ===&lt;br /&gt;
Removes all cliffs existing cliffs from the world. Use [[#Turn off cliff generation]] to turn off cliff generation in new chunks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, v in pairs(game.player.surface.find_entities_filtered{type=&amp;quot;cliff&amp;quot;}) do&lt;br /&gt;
  v.destroy()&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Delete all decoratives ===&lt;br /&gt;
Delete the decoratives that can be found in the world.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
for c in surface.get_chunks() do&lt;br /&gt;
	surface.destroy_decoratives({{c.x*32, c.y*32}, {c.x*32+32, c.y*32+32}})&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change map generation settings ===&lt;br /&gt;
This allows to change the map generation settings for new chunks; it does not alter already generated chunks. [[#Delete chunks|Deleted chunks]] are affected by the setting change because they are newly generated when they get explored again.&lt;br /&gt;
&lt;br /&gt;
To change resource generation settings, replace &amp;quot;iron-ore&amp;quot; with the [[Data.raw#resource|resource]] that should be changed and replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command. Replace &amp;quot;iron-ore&amp;quot; with &amp;quot;enemy-base&amp;quot; to change the enemy base generation settings. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local resource = &amp;quot;iron-ore&amp;quot;&lt;br /&gt;
local autoplace = surface.map_gen_settings.autoplace_controls&lt;br /&gt;
autoplace[resource].size = &amp;quot;very-high&amp;quot;&lt;br /&gt;
autoplace[resource].frequency = &amp;quot;very-high&amp;quot;&lt;br /&gt;
autoplace[resource].richness = &amp;quot;very-high&amp;quot;&lt;br /&gt;
surface.map_gen_settings.autoplace_controls = autoplace&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change water generation settings, replace &amp;quot;very-high&amp;quot; with the desired [https://lua-api.factorio.com/latest/Concepts.html#MapGenSize MapGenSize] in the following command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.water = &amp;quot;very-high&amp;quot; --[[ size]]&lt;br /&gt;
mgs.terrain_segmentation  = &amp;quot;very-high&amp;quot; --[[ frequency]]&lt;br /&gt;
surface.map_gen_settings = mgs &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enemy/evolution scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Set evolution factor ===&lt;br /&gt;
Ranges from 0 (new game) to 1.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].evolution_factor=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_evolution.time_factor=0&lt;br /&gt;
/c game.map_settings.enemy_evolution.pollution_factor=game.map_settings.enemy_evolution.pollution_factor*2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;2&amp;quot; at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.&lt;br /&gt;
&lt;br /&gt;
=== Kill all biters on the &amp;quot;enemy&amp;quot; force ===&lt;br /&gt;
Note that this will kill only mobile units, spawners will not be killed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all enemies ===&lt;br /&gt;
This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the explored world, so any unexplored parts of the map which still need to be generated will still have enemies. You can [[#Prevent biters being on newly generated chunks|prevent biters being on newly generated chunks]] if desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all nearby enemies ===&lt;br /&gt;
&lt;br /&gt;
This will kill all biters, bases and worms in a configurable radius. The default, 250 tiles, is about two zoomed-out screen widths on full HD. After destruction, it shows how many objects were destroyed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius = 250&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local pp = game.player.position&lt;br /&gt;
local cnt = 0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
    if entity.position.x &amp;gt; pp.x - radius and entity.position.x &amp;lt; pp.x + radius&lt;br /&gt;
        and entity.position.y &amp;gt; pp.y - radius and entity.position.y &amp;lt; pp.y + radius then&lt;br /&gt;
        cnt = cnt+1&lt;br /&gt;
        entity.destroy()&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(cnt)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable peaceful mode ===&lt;br /&gt;
Enabling peaceful mode prevents biter attacks until provoked. Substitute true for false to disable. Already existing biters are not affected by this command so attacks could continue for a while after activating peaceful mode.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.peaceful_mode = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable biter expansion ===&lt;br /&gt;
Biter expansion allows biters to create new nests, it is enabled by default. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_expansion.enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Prevent biters being on newly generated chunks ===&lt;br /&gt;
On newly generated chunks no biters will be present, however all current biters will remain unaffected. Equivalent of setting the Enemy Base Size to None under the Terrain settings during map generation but achieved mid game by [[#Change map generation settings|changing map generation settings]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local mgs = surface.map_gen_settings&lt;br /&gt;
mgs.autoplace_controls[&amp;quot;enemy-base&amp;quot;].size = &amp;quot;none&amp;quot;&lt;br /&gt;
surface.map_gen_settings = mgs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Player character scripts ==&lt;br /&gt;
Commands concerning the player directly.&lt;br /&gt;
=== Get player position ===&lt;br /&gt;
Prints coordinates of your current position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.position.x .. &amp;quot;, &amp;quot; .. game.player.position.y)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Teleport player ===&lt;br /&gt;
Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.teleport({X, Y})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To teleport to the world&#039;s origin, use 0,0.&lt;br /&gt;
&lt;br /&gt;
=== Enable god mode ===&lt;br /&gt;
God mode removes your player character allowing you to fly over obstacles and take no damage.&lt;br /&gt;
&lt;br /&gt;
Disassociate your controls from the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.character=nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, hover the mouse over the useless player and destroy it by typing:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.destroy()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To undo, spawn a player character. This will spawn a new player at the spawn point of the world, and connect your controls to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.create_character()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable long reach ===&lt;br /&gt;
Enables long reach, which allows the player to build and interact with entities at a greater distance. The default reach is 10.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local reach = 10000&lt;br /&gt;
game.player.force.character_build_distance_bonus = reach&lt;br /&gt;
game.player.force.character_reach_distance_bonus = reach&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Enable Research Queue ===&lt;br /&gt;
Enable the research queue for the players current team. Can be done after the game has started if it was forgotten during the map&#039;s setup.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_queue_enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.laboratory_speed_modifier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
1 is normal speed, 2 is double speed 3 is triple etc.&lt;br /&gt;
&lt;br /&gt;
=== Research specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=true&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unresearch specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;electric-energy-distribution-1&#039;, 0)&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;steel-processing&#039;, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling specific recipes ===&lt;br /&gt;
The internal recipe/item names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;electric-energy-interface&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;rocket-silo&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes.loader.enabled=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable all recipes ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name, recipe in pairs(game.player.force.recipes) do recipe.enabled = true end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command line parameters ==&lt;br /&gt;
&#039;&#039;&#039;As of Game Version 0.15.13&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Command line parameters can be used to set settings in the command line before the game launches, this is useful mainly for advanced users or server hosts.&lt;br /&gt;
&lt;br /&gt;
General options:&lt;br /&gt;
  -h [ --help ]                      display help&lt;br /&gt;
  --version                          show version information&lt;br /&gt;
  -v [ --verbose ]                   enable verbose logging&lt;br /&gt;
  -c [ --config ] PATH               config file to use&lt;br /&gt;
  --no-log-rotation                  don&#039;t rotate log file&lt;br /&gt;
  --mod-directory PATH               Mod directory to use&lt;br /&gt;
  --check-unused-prototype-data      Print a warning for all prototype values that were not accessed&lt;br /&gt;
&lt;br /&gt;
Running options:&lt;br /&gt;
  -s [ --map2scenario ] arg          map to scenario conversion&lt;br /&gt;
  -m [ --scenario2map ] arg          scenario to map conversion&lt;br /&gt;
  --apply-update arg                 immediately apply update package&lt;br /&gt;
  --create FILE                      create a new map&lt;br /&gt;
  --map-gen-settings FILE            Map generation settings for use with --create. See data/map-gen-settings.example.json&lt;br /&gt;
  --map-settings FILE                Map settings for use with --create. See data/base/prototypes/map-settings.lua&lt;br /&gt;
  --preset arg                       Name of the map generation preset to be used.&lt;br /&gt;
  --generate-map-preview FILE        Generate preview images of the map&lt;br /&gt;
  --map-preview-size SCALE (=1,024)  Size (in pixels) of map preview&lt;br /&gt;
  --map-preview-scale SCALE (=1)     Scale (meters per pixel) of map preview&lt;br /&gt;
  --map-preview-offset X,Y (=0,0)    Offset of the center of the map, in meters&lt;br /&gt;
  --start-server FILE                start a multiplayer server&lt;br /&gt;
  --start-server-load-scenario FILE  start a multiplayer server and load the specified scenario&lt;br /&gt;
  --start-server-load-latest         start a multiplayer server and load the latest available save&lt;br /&gt;
  --until-tick TICK                  run a save until given map tick&lt;br /&gt;
  --mp-connect ADDRESS               start factorio and connect to address&lt;br /&gt;
  --load-game FILE                   start Factorio and load a game in singleplayer&lt;br /&gt;
  --benchmark FILE                   load save and run benchmark&lt;br /&gt;
  --benchmark-ticks N (=1,000)       number of ticks for benchmarking. Default is 1000&lt;br /&gt;
  --force-opengl                     use OpenGL for rendering&lt;br /&gt;
  --force-d3d                        use Direct3D for rendering&lt;br /&gt;
  --fullscreen BOOL                  start game in windowed mode (saved to configuration)&lt;br /&gt;
  --max-texture-size N               maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048&lt;br /&gt;
  --graphics-quality arg             accepted values: normal, low, very-low&lt;br /&gt;
  --video-memory-usage arg           accepted values: all, high, medium, low&lt;br /&gt;
  --gfx-safe-mode                    resets some graphics settings to values that should work on most configurations&lt;br /&gt;
  --shader arg                       enable/disable shader postprocessing (saved to configuration)&lt;br /&gt;
  --disable-audio                    Disable audio. Mainly for faster startup during development.&lt;br /&gt;
&lt;br /&gt;
Server options:&lt;br /&gt;
  --port N                           network port to use&lt;br /&gt;
  --bind ADDRESS[:PORT]              IP address (and optionally port) to bind to&lt;br /&gt;
  --rcon-port N                      Port to use for RCON&lt;br /&gt;
  --rcon-password PASSWORD           Password for RCON&lt;br /&gt;
  --server-settings FILE             Path to file with server settings. See data/server-settings.example.json&lt;br /&gt;
  --server-whitelist FILE            Path to file with server whitelist.&lt;br /&gt;
  --server-banlist FILE              Path to file with server banlist.&lt;br /&gt;
  --console-log FILE                 Path to file where a copy of the server&#039;s log will be stored&lt;br /&gt;
  --server-id FILE                   Path where server ID will be stored or read from&lt;br /&gt;
&lt;br /&gt;
=== Multiplayer ===&lt;br /&gt;
&lt;br /&gt;
  --start-server SAVE&lt;br /&gt;
&lt;br /&gt;
Will start a Headless (Dedicated) server, with no GUI.&lt;br /&gt;
&lt;br /&gt;
  --mp-connect ADDRESS&lt;br /&gt;
ADDRESS is the IP:port of the remote host. Port is optional.&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101:2345&lt;br /&gt;
&lt;br /&gt;
As above, port can be specified by placing the port number after a colon in the address.&lt;br /&gt;
&lt;br /&gt;
  --map2scenario SAVE&lt;br /&gt;
Converts a save game to a User Scenario, allows saved game state to be loaded into map editor.&lt;br /&gt;
Assuming that save game name is &amp;quot;foo.zip&amp;quot;, executing &#039;./factorio --map2scenario s1&#039; will result in Factorio loading, opening the save file, and saving the scenario into the scenario folder.&lt;br /&gt;
&lt;br /&gt;
== Modding tools ==&lt;br /&gt;
A list of the internal names of most things in the vanilla game can also be found on [[data.raw]].&lt;br /&gt;
&lt;br /&gt;
=== Print to console which tile are you have under the player position ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.surface.get_tile(game.player.position.x, game.player.position.y).name)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all researched technologies to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	if tech.researched then&lt;br /&gt;
    list[#list+1] = tech.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;techs.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all enabled recipes to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, recipe in pairs(game.player.force.recipes) do &lt;br /&gt;
	if recipe.enabled then&lt;br /&gt;
    list[#list+1] = recipe.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;recipes.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Types/EnergySource&amp;diff=169690</id>
		<title>Types/EnergySource</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Types/EnergySource&amp;diff=169690"/>
		<updated>2019-02-28T15:02:01Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Basics ==&lt;br /&gt;
Specifies the way the entity gets its energy.&lt;br /&gt;
=== type ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/string]]&lt;br /&gt;
&lt;br /&gt;
Only valid values are &amp;quot;electric&amp;quot;, &amp;quot;burner&amp;quot;, &amp;quot;heat&amp;quot; or &amp;quot;void&amp;quot;, it specifies the type of the energy source to be used.&lt;br /&gt;
&lt;br /&gt;
=== emissions ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 0&lt;br /&gt;
&lt;br /&gt;
The pollution an entity emits is &#039;&#039;emissions&#039;&#039; times the energy consumption in kW. (This gives you the number that is shown in the entiy tooltip.)&lt;br /&gt;
&lt;br /&gt;
=== render_no_power_icon ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/bool]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: true&lt;br /&gt;
&lt;br /&gt;
Whether to render the [[File:Electricity-icon-red.png|50px]] icon on the entity if it is low on power. Also applies to [[File:Fuel-icon-red.png|50px]] when using a burner energy source.&lt;br /&gt;
&lt;br /&gt;
=== render_no_network_icon ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/bool]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: true&lt;br /&gt;
&lt;br /&gt;
Whether to render the [[File:Electricity-icon-unplugged.png|50px]] icon on the entity if it is not connected to a electric network.&lt;br /&gt;
&lt;br /&gt;
== Electric energy source ==&lt;br /&gt;
=== buffer_capacity ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Energy]]&lt;br /&gt;
&lt;br /&gt;
How much power the entity holds.&lt;br /&gt;
=== usage_priority ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/ElectricUsagePriority]]&lt;br /&gt;
=== input_flow_limit ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Energy]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 0&lt;br /&gt;
&lt;br /&gt;
How fast the energy can flow into the entity. 0 means no limit.&lt;br /&gt;
=== output_flow_limit ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Energy]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 0&lt;br /&gt;
&lt;br /&gt;
How fast the energy can flow out of the entity. 0 means no limit.&lt;br /&gt;
&lt;br /&gt;
=== drain ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Energy]]&lt;br /&gt;
&lt;br /&gt;
== Burner ==&lt;br /&gt;
=== fuel_inventory_size ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/ItemStackIndex]]&lt;br /&gt;
&lt;br /&gt;
=== burnt_inventory_size ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/ItemStackIndex]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 0&lt;br /&gt;
&lt;br /&gt;
=== smoke ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/table]] of [[Types/SmokeSource]]&lt;br /&gt;
&lt;br /&gt;
Array of 1 or more smoke sources.&lt;br /&gt;
&lt;br /&gt;
=== light_flicker ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/LightFlickeringDefinition]]&lt;br /&gt;
&lt;br /&gt;
=== effectivity ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 1&lt;br /&gt;
&lt;br /&gt;
1 means 100% effectivity. Can&#039;t be 0.&lt;br /&gt;
&lt;br /&gt;
=== fuel_category ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/string]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: &amp;quot;chemical&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The energy source can be used with fuel from this [[Prototype/FuelCategory|fuel category]].&lt;br /&gt;
&lt;br /&gt;
=== fuel_categories ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/table]] of [[Types/string]]&lt;br /&gt;
&lt;br /&gt;
Same as above, only one of them can exist.&lt;br /&gt;
&lt;br /&gt;
== Heat energy source ==&lt;br /&gt;
=== max_temperature ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
=== specific_heat ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Energy]]&lt;br /&gt;
&lt;br /&gt;
=== max_transfer ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Energy]]&lt;br /&gt;
&lt;br /&gt;
=== min_temperature_gradient ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/double]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Default&#039;&#039;&#039;: 1&lt;br /&gt;
&lt;br /&gt;
=== connections ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/table]] of [[Types/HeatConnection]]&lt;br /&gt;
&lt;br /&gt;
=== pipe_covers ===&lt;br /&gt;
&#039;&#039;&#039;Type&#039;&#039;&#039;: [[Types/Sprite4Way]]&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=165537</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=165537"/>
		<updated>2018-11-24T22:16:34Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Disable researching */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Overview ==&lt;br /&gt;
The &#039;&#039;&#039;Console&#039;&#039;&#039; is Factorio&#039;s command-line interface.&lt;br /&gt;
&lt;br /&gt;
The in-game console is used for:&lt;br /&gt;
&lt;br /&gt;
* Chatting with other players&lt;br /&gt;
* Running commands / scripts / cheats&lt;br /&gt;
* Occasional status updates&lt;br /&gt;
&lt;br /&gt;
There are three types of commands:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[#Normal commands|Normal]]&#039;&#039;&#039; - Display information about the game and customize your experience.&lt;br /&gt;
* &#039;&#039;&#039;[[#Multiplayer commands|Multiplayer]]&#039;&#039;&#039; - Message filtering, banning users, etc.&lt;br /&gt;
* &#039;&#039;&#039;[[#Scripting and cheat commands|Scripting/Cheating]]&#039;&#039;&#039; - Run small Lua scripts (but they &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;disable achievements for the save game&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== Using the console ===&lt;br /&gt;
The console display can be toggled with the {{keybinding|/}} (slash) or {{keybinding|~}} (tilde) keys.&lt;br /&gt;
&lt;br /&gt;
You can customize the keys via &#039;&#039;&#039;Options Menu → Keyboard → Toggle Lua console&#039;&#039;&#039;.&lt;br /&gt;
When the console is open, you&#039;ll see a blinking cursor at the bottom of the screen; type your message or command and hit &#039;&#039;&#039;Return&#039;&#039;&#039; to send it (this will also close the console).&lt;br /&gt;
Documentation about message and command prefixes can be found further down this page.&lt;br /&gt;
&lt;br /&gt;
When console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages).&lt;br /&gt;
Note that by default, all executed commands are made visible to all users. You can set the fade out time via &#039;&#039;&#039;Options Menu → Other Settings → Message Delay&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you want to immediately hide the console, open the console and then press &#039;&#039;&#039;Escape&#039;&#039;&#039; key (or press &#039;&#039;&#039;Return&#039;&#039;&#039; without entering any message/command).&lt;br /&gt;
This not only closes the console, but it also hides all the recent messages/commands.&lt;br /&gt;
The console can be cleared with the &#039;&#039;&#039;/clear&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Note that the console can also accept raw Lua code as well as game commands.&lt;br /&gt;
&lt;br /&gt;
=== Console history ===&lt;br /&gt;
&lt;br /&gt;
The console has an inbuilt history; it&#039;s a bit like a text editor where only one line of text is displayed at a time.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;uarr;}} and {{keybinding|&amp;amp;darr;}} keys to scroll through the console history.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;larr;}} and {{keybinding|&amp;amp;rarr;}} keys to cursor through the currently displayed message or command, which you can edit (delete, insert, etc.) and resend (by pressing &#039;&#039;&#039;Return&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
The {{keybinding|Tab}} key will auto-complete commands and player ids.&lt;br /&gt;
&lt;br /&gt;
== Normal commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| /alerts &amp;lt;enable/disable/mute/unmute&amp;gt; &amp;lt;alert&amp;gt;&lt;br /&gt;
| /alerts disable turret_fire&lt;br /&gt;
| Enables, disables, mutes, or unmutes the given alert type. Available alerts: entity_destroyed, entity_under_attack, not_enough_construction_robots, no_material_for_construction, not_enough_repair packs, turret_fire, custom, no_storage.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /clear&lt;br /&gt;
| /clear&lt;br /&gt;
| Clears the console.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /color &amp;lt;color&amp;gt;&lt;br /&gt;
| /color 20 255 255 100&lt;br /&gt;
| Changes your color. Can either be one of the pre-defined colors or [[:Wikipedia:RGBA_color_space|RGBA value]] in the format of “# # # #”. Available colors: default, red, green, blue, orange, yellow, pink, purple, white, black, gray, brown, cyan, acid.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /evolution&lt;br /&gt;
| /evolution&lt;br /&gt;
| Prints info about the alien evolution factor.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /help [command]&lt;br /&gt;
| /help&lt;br /&gt;
| Prints a list of available commands, the optional argument can specify the command that should be described.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /h [command]&lt;br /&gt;
| /h&lt;br /&gt;
| Same as /help.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /mute-programmable-speaker &amp;lt;mute/unmute&amp;gt; &amp;lt;local/everyone&amp;gt;&lt;br /&gt;
| /mute-programmable-speaker mute local&lt;br /&gt;
| Mutes or unmutes the global sounds created by the Programmable Speaker. Use “local” to mute just the local client. Admins can use “everyone” to mute the sounds for everyone on the server.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /perf-avg-frames &amp;lt;number&amp;gt;&lt;br /&gt;
| /perf-avg-frames 100&lt;br /&gt;
| Number of ticks/updates used to average performance counters. Default is 100. Value of 5-10 is recommended for fast convergence, but numbers will jitter more rapidly.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /permissions&lt;br /&gt;
| /permissions&lt;br /&gt;
| Opens the permissions GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /screenshot [x resolution] [y resolution] [zoom]&lt;br /&gt;
| /screenshot&lt;br /&gt;
| Takes a screenshot with the GUI hidden, centered on the player. It is saved in the &amp;quot;script-output&amp;quot; subfolder of your [[User data directory]].  Resolution is optional and defaults to the current window size. Zoom is optional and defaults to 1.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /seed&lt;br /&gt;
| /seed&lt;br /&gt;
| Prints the starting map seed.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /time&lt;br /&gt;
| /time&lt;br /&gt;
| Prints info about how old the map is.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| Toggles logging all input actions performed by the game. This value isn’t persisted between game restarts and only affects your local game in multiplayer sessions.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| Used to investigate desyncs. Will slow down the game and make multiplayer unplayable.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| Toggles if the rockets sent button is shown in the upper left corner of the screen.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /version&lt;br /&gt;
| /version&lt;br /&gt;
| Prints the current game version.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Multiplayer commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;message&amp;gt;&lt;br /&gt;
| Hello team!&lt;br /&gt;
| Console input that does not start with {{keybinding|/}} is shown as a chat message to your team.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /admins&lt;br /&gt;
| /admins&lt;br /&gt;
| Prints a list of game admins.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ban &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /ban xTROLLx Throwing grenades in base&lt;br /&gt;
| Bans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /banlist &amp;lt;add/remove/get/clear&amp;gt; &amp;lt;player&amp;gt;&lt;br /&gt;
| /banlist get&lt;br /&gt;
| Adds or removes a player from the banlist. Same as /ban or /unban.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /config &amp;lt;get/set&amp;gt; &amp;lt;option&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
| /config set password hunter2&lt;br /&gt;
| Gets or sets various multiplayer game settings. Available configs are: afk-auto-kick, allow-commands, allow-debug-settings, autosave-interval, autosave-only-on-server, ignore-player-limit-for-returning-players, max-players, max-upload-speed, only-admins-can-pause, password, require-user-verification, visibility-lan, visibility-public.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /delete-blueprint-library &amp;lt;player&amp;gt;&lt;br /&gt;
| /delete-blueprint-library everybody confirm&lt;br /&gt;
| Deletes the blueprint library storage for the given offline player from the save file. Enter “everybody confirm” to delete the storage of all offline players.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /demote &amp;lt;player&amp;gt;&lt;br /&gt;
| /demote AzureDiamond&lt;br /&gt;
| Demotes the player from admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /ignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /ignore Cthon98&lt;br /&gt;
| Prevents the chat from showing messages from this player. Admin messages are still shown.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ignores&lt;br /&gt;
| /ignores&lt;br /&gt;
| Prints a list of ignored players.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /kick &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /kick xTROLLx Throwing grenades in base&lt;br /&gt;
| Kicks the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mute &amp;lt;player&amp;gt;&lt;br /&gt;
| /mute Cthon98&lt;br /&gt;
| Prevents the player from saying anything in chat.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mutes&lt;br /&gt;
| /mutes&lt;br /&gt;
| All players that are muted (can’t talk in chat).&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /open &amp;lt;player&amp;gt;&lt;br /&gt;
| /open AzureDiamond&lt;br /&gt;
| Opens another player’s inventory.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /o &amp;lt;player&amp;gt;&lt;br /&gt;
| /o AzureDiamond&lt;br /&gt;
| Same as /open.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /players [online/o/count/c]&lt;br /&gt;
| /players&lt;br /&gt;
| Prints a list of players in the game. (parameter online/o, it prints only players that are online, count/c prints only count)&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /promote &amp;lt;player&amp;gt;&lt;br /&gt;
| /promote AzureDiamond&lt;br /&gt;
| Promotes the player to admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /purge &amp;lt;player&amp;gt;&lt;br /&gt;
| /purge Cthon98&lt;br /&gt;
| Clears all the messages from this player from the chat log.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /reply &amp;lt;message&amp;gt;&lt;br /&gt;
| /reply oh, really?&lt;br /&gt;
| Replies to the last player that whispered to you.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /r &amp;lt;message&amp;gt;&lt;br /&gt;
| /r oh, really?&lt;br /&gt;
| Same as /reply.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /server-save&lt;br /&gt;
| /server-save&lt;br /&gt;
| Saves the game on the server in a multiplayer game.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /shout &amp;lt;message&amp;gt;&lt;br /&gt;
| /shout Hello world!&lt;br /&gt;
| Sends a message to all players including other forces.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /s &amp;lt;message&amp;gt;&lt;br /&gt;
| /s Hello world!&lt;br /&gt;
| Same as /shout.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /swap-players &amp;lt;player&amp;gt; [player]&lt;br /&gt;
| /swap-players AzureDiamond&lt;br /&gt;
| Swaps your character with the given player’s character, or if two players are given swaps the two player characters.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unban &amp;lt;player&amp;gt;&lt;br /&gt;
| /unban xTROLLx&lt;br /&gt;
| Unbans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /unignore Cthon98&lt;br /&gt;
| Allows the chat to show messages from this player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unmute &amp;lt;player&amp;gt;&lt;br /&gt;
| /unmute Cthon98&lt;br /&gt;
| Allows the player to talk in chat again.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /whisper &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /whisper AzureDiamond thats what I see&lt;br /&gt;
| Sends a message to the specified player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /w &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /w AzureDiamond thats what I see&lt;br /&gt;
| Same as /whisper.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /whitelist &amp;lt;add/remove/get/clear&amp;gt; [player]&lt;br /&gt;
| /whitelist get&lt;br /&gt;
| Adds or removes a player from the whitelist, where only whitelisted players can join the game. Enter nothing for “player” when using “get” to print a list of all whitelisted players. An empty whitelist disables the whitelist functionality allowing anyone to join.&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scripting and cheat commands ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| /c &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /measured-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command and measures time it took.&lt;br /&gt;
|-&lt;br /&gt;
| /silent-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command without printing it to the console.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a very powerful feature, which also allows cheating, and as such &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;achievements will be permanently disabled for the save&amp;lt;/span&amp;gt; as soon as you use a script command.&lt;br /&gt;
&lt;br /&gt;
== Basic example scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Use it as calculator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(1234*5678)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zoom beyond normal bounds ===&lt;br /&gt;
Note that zooming too far out can cause performance hits. Be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.zoom=0.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mine faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Craft faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unlock and research all technologies ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_all_technologies()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Undo this with the command in the next section.&lt;br /&gt;
&lt;br /&gt;
=== Unresearch all technologies ===&lt;br /&gt;
This does not reset manually applied bonuses&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	tech.researched=false&lt;br /&gt;
	game.player.force.set_saved_technology_progress(tech, 0)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable researching ===&lt;br /&gt;
It disables actual researching&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/c game.player.force.current_research = nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reset your force ===&lt;br /&gt;
This resets all data for your force, including kill and production statistics, technologies, bonuses and charting status.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.reset()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Always show rail block visualization ===&lt;br /&gt;
Permanently show the rail block visualization instead of only when holding a rail signal. Disable by replacing true with false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.game_view_settings.show_rail_block_visualisation = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inventory manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Cheat mode ===&lt;br /&gt;
Allows for infinite free crafting. Disable by replacing true with false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.cheat_mode=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource tile in-game&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.amount=7500&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can refill all resources in the map with the following command. Change ore.amount to the desired value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c surface = game.player.surface&lt;br /&gt;
for _, ore in pairs(surface.find_entities_filtered({type=&amp;quot;resource&amp;quot;})) do&lt;br /&gt;
    ore.amount = 10000&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add items to the player&#039;s inventory ===&lt;br /&gt;
Replace iron-plate with the [[data.raw|internal name]] of the item desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For instance, here&#039;s a stack of the god-mode energy system interface:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;electric-energy-interface&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a powerful armor with equipment and some tools for construction:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c	local player = game.player&lt;br /&gt;
player.insert{name=&amp;quot;power-armor-mk2&amp;quot;, count = 1}&lt;br /&gt;
local p_armor = player.get_inventory(5)[1].grid&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;personal-roboport-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;night-vision-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
player.insert{name=&amp;quot;construction-robot&amp;quot;, count = 25}&lt;br /&gt;
player.insert{name=&amp;quot;blueprint&amp;quot;, count = 3}&lt;br /&gt;
player.insert{name=&amp;quot;deconstruction-planner&amp;quot;, count = 1}&lt;br /&gt;
player.insert{name=&amp;quot;steel-axe&amp;quot;, count = 10}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== World manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Reveal the map around the player ===&lt;br /&gt;
&lt;br /&gt;
Reveals the map around the player, similar to a [[radar]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or from start position&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces.player.chart(game.player.surface, {{x = -2000, y = -2000}, {x = 2000, y = 2000}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change 150 to the desired radius, higher values take longer.&lt;br /&gt;
&lt;br /&gt;
If much of the map is revealed, it increases the size of the save file. The following command cancels the generation of all chunks that are currently queued for generation and removes chunks outside a 32 chunks radius around 0,0. Note that this will remove player entities if there are any on these chunks.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface;&lt;br /&gt;
game.player.force.cancel_charting(surface); &lt;br /&gt;
local chunk_radius = 32;&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  if (chunk.x &amp;lt; -chunk_radius or chunk.x &amp;gt; chunk_radius or chunk.y &amp;lt; -chunk_radius or chunk.y &amp;gt; chunk_radius) then&lt;br /&gt;
    surface.delete_chunk(chunk)&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
Enables eternal day.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.always_day=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change game speed ===&lt;br /&gt;
0.5 is half speed, 1 is default, 2 is double speed, etc. Minimum is 0.01. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.speed=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expensive (marathon) or normal mode ===&lt;br /&gt;
To change from normal to expensive mode preset (this changes the research cost and intermediate product cost):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change back to normal:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Freeze time ===&lt;br /&gt;
Stops the advancement of the time if you replace &amp;quot;BOOL&amp;quot; with &amp;quot;true&amp;quot; or unfreezes it if you replace it with &amp;quot;false&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.freeze_daytime=BOOL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.clear_pollution()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Completely turn off pollution ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, surface in pairs(game.surfaces) do&lt;br /&gt;
  surface.clear_pollution()&lt;br /&gt;
end&lt;br /&gt;
game.map_settings.pollution.enabled = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add a lot of pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.pollute(game.player.position, 1000000)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable friendly fire for your force ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.friendly_fire = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 11×11 patch of resources, centered on the player character, where the ground is not water.&lt;br /&gt;
The patch it creates is perfectly square but it randomizes the amount similar to natural generation, with fewer ore at the edges and more ore in the center.&lt;br /&gt;
The default numbers result in a patch with 2500-3000 ore.&lt;br /&gt;
&lt;br /&gt;
If you want a larger patch, change &amp;quot;local size = 5&amp;quot; to a larger number.&lt;br /&gt;
A larger patch will have exponentially more ore.&lt;br /&gt;
Entering a number above 30 is not recommended.&lt;br /&gt;
&lt;br /&gt;
If you want a richer patch, change &amp;quot;local density = 10&amp;quot; to a larger number.&lt;br /&gt;
Entering a very large number shouldn&#039;t hurt anything but you probably don&#039;t need to go above 100.&lt;br /&gt;
&lt;br /&gt;
To choose which resource is spawned, change &amp;quot;stone&amp;quot; near the bottom to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, &amp;quot;coal&amp;quot;, or &amp;quot;uranium-ore&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local ore=nil&lt;br /&gt;
local size=5&lt;br /&gt;
local density=10&lt;br /&gt;
for y=-size, size do&lt;br /&gt;
	for x=-size, size do&lt;br /&gt;
		a=(size+1-math.abs(x))*10&lt;br /&gt;
		b=(size+1-math.abs(y))*10&lt;br /&gt;
		if a&amp;lt;b then&lt;br /&gt;
			ore=math.random(a*density-a*(density-8), a*density+a*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if b&amp;lt;a then&lt;br /&gt;
			ore=math.random(b*density-b*(density-8), b*density+b*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if surface.get_tile(game.player.position.x+x, game.player.position.y+y).collides_with(&amp;quot;ground-tile&amp;quot;) then&lt;br /&gt;
			surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=ore, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches in a 3×3 square.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for y=0,2 do&lt;br /&gt;
	for x=0,2 do&lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or randomly without any collision:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local position=nil&lt;br /&gt;
for i=1,9 do&lt;br /&gt;
	position=game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
	if position then &lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position=position})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Count entities ===&lt;br /&gt;
Counts all entities whose name includes the string in local entity.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local entity=&amp;quot;belt&amp;quot;&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local count=0&lt;br /&gt;
for key, ent in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(ent.name,entity) then&lt;br /&gt;
		count=count+1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(count)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emptying all pipes, underground pipes and pumps ===&lt;br /&gt;
Useful when pipes contain a fluid you dont want.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local deleted=0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(entity.name, &amp;quot;pipe&amp;quot;) or &lt;br /&gt;
		string.find(entity.name, &amp;quot;pump&amp;quot;) &lt;br /&gt;
	then&lt;br /&gt;
		for i=1,#entity.fluidbox do&lt;br /&gt;
			deleted = deleted + 1&lt;br /&gt;
			entity.fluidbox[i] = nil;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(&amp;quot;Fluids removed from &amp;quot;..deleted ..&amp;quot; entities&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off cliff generation ===&lt;br /&gt;
Sets size to &amp;quot;none&amp;quot;. Only effective on chunks that are generated after using this command. Use [[#Remove all cliffs]] to delete existing cliffs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local mgs = game.player.surface.map_gen_settings&lt;br /&gt;
mgs.cliff_settings.cliff_elevation_0 = 1024&lt;br /&gt;
game.player.surface.map_gen_settings = mgs&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all cliffs ===&lt;br /&gt;
Removes all cliffs existing cliffs from the world. Use [[#Turn off cliff generation]] to turn off cliff generation in new chunks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, v in pairs(game.player.surface.find_entities_filtered{type=&amp;quot;cliff&amp;quot;}) do&lt;br /&gt;
  v.destroy()&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enemy/evolution scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Set evolution factor ===&lt;br /&gt;
Ranges from 0 (new game) to 1.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].evolution_factor=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_evolution.time_factor=0&lt;br /&gt;
/c game.map_settings.enemy_evolution.pollution_factor=game.map_settings.enemy_evolution.pollution_factor*2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;2&amp;quot; at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.&lt;br /&gt;
&lt;br /&gt;
=== Kill all biters on the &amp;quot;enemy&amp;quot; force ===&lt;br /&gt;
Note that this will kill only mobile units, spawners will not be killed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all enemies ===&lt;br /&gt;
This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the explored world, so any unexplored parts of the map which still need to be generated will still have enemies.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable peaceful mode ===&lt;br /&gt;
Enabling peaceful mode prevents biter attacks until provoked. Substitute true for false to disable. Already existing biters are not affected by this command so attacks could continue for a while after activating peaceful mode.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.peaceful_mode = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable biter expansion ===&lt;br /&gt;
Biter expansion allows biters to create new nests, it is enabled by default. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_expansion.enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Player character scripts ==&lt;br /&gt;
Commands concerning the player directly.&lt;br /&gt;
=== Get player position ===&lt;br /&gt;
Prints coordinates of your current position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.position.x .. &amp;quot;, &amp;quot; .. game.player.position.y)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Teleport player ===&lt;br /&gt;
Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.teleport({X, Y})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To teleport to the world&#039;s origin, use 0,0.&lt;br /&gt;
&lt;br /&gt;
=== Enable god mode ===&lt;br /&gt;
God mode removes your player character allowing you to fly over obstacles and take no damage.&lt;br /&gt;
&lt;br /&gt;
Disassociate your controls from the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.character=nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, hover the mouse over the useless player and destroy it by typing:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.destroy()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To undo, spawn a player character. This will spawn a new player at the spawn point of the world, and connect your controls to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.create_character()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.laboratory_speed_modifier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
1 is normal speed, 2 is double speed 3 is triple etc.&lt;br /&gt;
&lt;br /&gt;
=== Research specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=true&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unresearch specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;electric-energy-distribution-1&#039;, 0)&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;steel-processing&#039;, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling specific recipes ===&lt;br /&gt;
The internal recipe/item names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;electric-energy-interface&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;rocket-silo&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes.loader.enabled=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable all recipes ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name, recipe in pairs(game.player.force.recipes) do recipe.enabled = true end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command line parameters ==&lt;br /&gt;
&#039;&#039;&#039;As of Game Version 0.15.13&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Command line parameters can be used to set settings in the command line before the game launches, this is useful mainly for advanced users or server hosts.&lt;br /&gt;
&lt;br /&gt;
General options:&lt;br /&gt;
  -h [ --help ]                      display help&lt;br /&gt;
  --version                          show version information&lt;br /&gt;
  -v [ --verbose ]                   enable verbose logging&lt;br /&gt;
  -c [ --config ] PATH               config file to use&lt;br /&gt;
  --no-log-rotation                  don&#039;t rotate log file&lt;br /&gt;
  --mod-directory PATH               Mod directory to use&lt;br /&gt;
  --check-unused-prototype-data      Print a warning for all prototype values that were not accessed&lt;br /&gt;
&lt;br /&gt;
Running options:&lt;br /&gt;
  -s [ --map2scenario ] arg          map to scenario conversion&lt;br /&gt;
  -m [ --scenario2map ] arg          scenario to map conversion&lt;br /&gt;
  --apply-update arg                 immediately apply update package&lt;br /&gt;
  --create FILE                      create a new map&lt;br /&gt;
  --map-gen-settings FILE            Map generation settings for use with --create. See data/map-gen-settings.example.json&lt;br /&gt;
  --map-settings FILE                Map settings for use with --create. See data/base/prototypes/map-settings.lua&lt;br /&gt;
  --preset arg                       Name of the map generation preset to be used.&lt;br /&gt;
  --generate-map-preview FILE        Generate preview images of the map&lt;br /&gt;
  --map-preview-size SCALE (=1,024)  Size (in pixels) of map preview&lt;br /&gt;
  --map-preview-scale SCALE (=1)     Scale (meters per pixel) of map preview&lt;br /&gt;
  --map-preview-offset X,Y (=0,0)    Offset of the center of the map, in meters&lt;br /&gt;
  --start-server FILE                start a multiplayer server&lt;br /&gt;
  --start-server-load-scenario FILE  start a multiplayer server and load the specified scenario&lt;br /&gt;
  --start-server-load-latest         start a multiplayer server and load the latest available save&lt;br /&gt;
  --until-tick TICK                  run a save until given map tick&lt;br /&gt;
  --mp-connect ADDRESS               start factorio and connect to address&lt;br /&gt;
  --load-game FILE                   start Factorio and load a game in singleplayer&lt;br /&gt;
  --benchmark FILE                   load save and run benchmark&lt;br /&gt;
  --benchmark-ticks N (=1,000)       number of ticks for benchmarking. Default is 1000&lt;br /&gt;
  --force-opengl                     use OpenGL for rendering&lt;br /&gt;
  --force-d3d                        use Direct3D for rendering&lt;br /&gt;
  --fullscreen BOOL                  start game in windowed mode (saved to configuration)&lt;br /&gt;
  --max-texture-size N               maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048&lt;br /&gt;
  --graphics-quality arg             accepted values: normal, low, very-low&lt;br /&gt;
  --video-memory-usage arg           accepted values: all, high, medium, low&lt;br /&gt;
  --gfx-safe-mode                    resets some graphics settings to values that should work on most configurations&lt;br /&gt;
  --shader arg                       enable/disable shader postprocessing (saved to configuration)&lt;br /&gt;
  --disable-audio                    Disable audio. Mainly for faster startup during development.&lt;br /&gt;
&lt;br /&gt;
Server options:&lt;br /&gt;
  --port N                           network port to use&lt;br /&gt;
  --bind ADDRESS[:PORT]              IP address (and optionally port) to bind to&lt;br /&gt;
  --rcon-port N                      Port to use for RCON&lt;br /&gt;
  --rcon-password PASSWORD           Password for RCON&lt;br /&gt;
  --server-settings FILE             Path to file with server settings. See data/server-settings.example.json&lt;br /&gt;
  --server-whitelist FILE            Path to file with server whitelist.&lt;br /&gt;
  --server-banlist FILE              Path to file with server banlist.&lt;br /&gt;
  --console-log FILE                 Path to file where a copy of the server&#039;s log will be stored&lt;br /&gt;
  --server-id FILE                   Path where server ID will be stored or read from&lt;br /&gt;
&lt;br /&gt;
=== Multiplayer ===&lt;br /&gt;
&lt;br /&gt;
  --start-server SAVE&lt;br /&gt;
&lt;br /&gt;
Will start a Headless (Dedicated) server, with no GUI.&lt;br /&gt;
&lt;br /&gt;
  --mp-connect ADDRESS&lt;br /&gt;
ADDRESS is the IP:port of the remote host. Port is optional.&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101:2345&lt;br /&gt;
&lt;br /&gt;
As above, port can be specified by placing the port number after a colon in the address.&lt;br /&gt;
&lt;br /&gt;
  --map2scenario SAVE&lt;br /&gt;
Converts a save game to a User Scenario, allows saved game state to be loaded into map editor.&lt;br /&gt;
Assuming that save game name is &amp;quot;foo.zip&amp;quot;, executing &#039;./factorio --map2scenario s1&#039; will result in Factorio loading, opening the save file, and saving the scenario into the scenario folder.&lt;br /&gt;
&lt;br /&gt;
== Modding tools ==&lt;br /&gt;
A list of the internal names of most things in the vanilla game can also be found on [[data.raw]].&lt;br /&gt;
&lt;br /&gt;
=== Print to console which tile are you have under the player position ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.surface.get_tile(game.player.position.x, game.player.position.y).name)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all researched technologies to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	if tech.researched then&lt;br /&gt;
    list[#list+1] = tech.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;techs.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all enabled recipes to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, recipe in pairs(game.player.force.recipes) do &lt;br /&gt;
	if recipe.enabled then&lt;br /&gt;
    list[#list+1] = recipe.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;recipes.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=165536</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=165536"/>
		<updated>2018-11-24T22:14:51Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Unresearch all technologies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Overview ==&lt;br /&gt;
The &#039;&#039;&#039;Console&#039;&#039;&#039; is Factorio&#039;s command-line interface.&lt;br /&gt;
&lt;br /&gt;
The in-game console is used for:&lt;br /&gt;
&lt;br /&gt;
* Chatting with other players&lt;br /&gt;
* Running commands / scripts / cheats&lt;br /&gt;
* Occasional status updates&lt;br /&gt;
&lt;br /&gt;
There are three types of commands:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[#Normal commands|Normal]]&#039;&#039;&#039; - Display information about the game and customize your experience.&lt;br /&gt;
* &#039;&#039;&#039;[[#Multiplayer commands|Multiplayer]]&#039;&#039;&#039; - Message filtering, banning users, etc.&lt;br /&gt;
* &#039;&#039;&#039;[[#Scripting and cheat commands|Scripting/Cheating]]&#039;&#039;&#039; - Run small Lua scripts (but they &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;disable achievements for the save game&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== Using the console ===&lt;br /&gt;
The console display can be toggled with the {{keybinding|/}} (slash) or {{keybinding|~}} (tilde) keys.&lt;br /&gt;
&lt;br /&gt;
You can customize the keys via &#039;&#039;&#039;Options Menu → Keyboard → Toggle Lua console&#039;&#039;&#039;.&lt;br /&gt;
When the console is open, you&#039;ll see a blinking cursor at the bottom of the screen; type your message or command and hit &#039;&#039;&#039;Return&#039;&#039;&#039; to send it (this will also close the console).&lt;br /&gt;
Documentation about message and command prefixes can be found further down this page.&lt;br /&gt;
&lt;br /&gt;
When console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages).&lt;br /&gt;
Note that by default, all executed commands are made visible to all users. You can set the fade out time via &#039;&#039;&#039;Options Menu → Other Settings → Message Delay&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you want to immediately hide the console, open the console and then press &#039;&#039;&#039;Escape&#039;&#039;&#039; key (or press &#039;&#039;&#039;Return&#039;&#039;&#039; without entering any message/command).&lt;br /&gt;
This not only closes the console, but it also hides all the recent messages/commands.&lt;br /&gt;
The console can be cleared with the &#039;&#039;&#039;/clear&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Note that the console can also accept raw Lua code as well as game commands.&lt;br /&gt;
&lt;br /&gt;
=== Console history ===&lt;br /&gt;
&lt;br /&gt;
The console has an inbuilt history; it&#039;s a bit like a text editor where only one line of text is displayed at a time.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;uarr;}} and {{keybinding|&amp;amp;darr;}} keys to scroll through the console history.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;larr;}} and {{keybinding|&amp;amp;rarr;}} keys to cursor through the currently displayed message or command, which you can edit (delete, insert, etc.) and resend (by pressing &#039;&#039;&#039;Return&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
The {{keybinding|Tab}} key will auto-complete commands and player ids.&lt;br /&gt;
&lt;br /&gt;
== Normal commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| /alerts &amp;lt;enable/disable/mute/unmute&amp;gt; &amp;lt;alert&amp;gt;&lt;br /&gt;
| /alerts disable turret_fire&lt;br /&gt;
| Enables, disables, mutes, or unmutes the given alert type. Available alerts: entity_destroyed, entity_under_attack, not_enough_construction_robots, no_material_for_construction, not_enough_repair packs, turret_fire, custom, no_storage.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /clear&lt;br /&gt;
| /clear&lt;br /&gt;
| Clears the console.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /color &amp;lt;color&amp;gt;&lt;br /&gt;
| /color 20 255 255 100&lt;br /&gt;
| Changes your color. Can either be one of the pre-defined colors or [[:Wikipedia:RGBA_color_space|RGBA value]] in the format of “# # # #”. Available colors: default, red, green, blue, orange, yellow, pink, purple, white, black, gray, brown, cyan, acid.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /evolution&lt;br /&gt;
| /evolution&lt;br /&gt;
| Prints info about the alien evolution factor.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /help [command]&lt;br /&gt;
| /help&lt;br /&gt;
| Prints a list of available commands, the optional argument can specify the command that should be described.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /h [command]&lt;br /&gt;
| /h&lt;br /&gt;
| Same as /help.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /mute-programmable-speaker &amp;lt;mute/unmute&amp;gt; &amp;lt;local/everyone&amp;gt;&lt;br /&gt;
| /mute-programmable-speaker mute local&lt;br /&gt;
| Mutes or unmutes the global sounds created by the Programmable Speaker. Use “local” to mute just the local client. Admins can use “everyone” to mute the sounds for everyone on the server.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /perf-avg-frames &amp;lt;number&amp;gt;&lt;br /&gt;
| /perf-avg-frames 100&lt;br /&gt;
| Number of ticks/updates used to average performance counters. Default is 100. Value of 5-10 is recommended for fast convergence, but numbers will jitter more rapidly.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /permissions&lt;br /&gt;
| /permissions&lt;br /&gt;
| Opens the permissions GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /screenshot [x resolution] [y resolution] [zoom]&lt;br /&gt;
| /screenshot&lt;br /&gt;
| Takes a screenshot with the GUI hidden, centered on the player. It is saved in the &amp;quot;script-output&amp;quot; subfolder of your [[User data directory]].  Resolution is optional and defaults to the current window size. Zoom is optional and defaults to 1.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /seed&lt;br /&gt;
| /seed&lt;br /&gt;
| Prints the starting map seed.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /time&lt;br /&gt;
| /time&lt;br /&gt;
| Prints info about how old the map is.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| Toggles logging all input actions performed by the game. This value isn’t persisted between game restarts and only affects your local game in multiplayer sessions.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| Used to investigate desyncs. Will slow down the game and make multiplayer unplayable.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| Toggles if the rockets sent button is shown in the upper left corner of the screen.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /version&lt;br /&gt;
| /version&lt;br /&gt;
| Prints the current game version.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Multiplayer commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;message&amp;gt;&lt;br /&gt;
| Hello team!&lt;br /&gt;
| Console input that does not start with {{keybinding|/}} is shown as a chat message to your team.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /admins&lt;br /&gt;
| /admins&lt;br /&gt;
| Prints a list of game admins.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ban &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /ban xTROLLx Throwing grenades in base&lt;br /&gt;
| Bans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /banlist &amp;lt;add/remove/get/clear&amp;gt; &amp;lt;player&amp;gt;&lt;br /&gt;
| /banlist get&lt;br /&gt;
| Adds or removes a player from the banlist. Same as /ban or /unban.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /config &amp;lt;get/set&amp;gt; &amp;lt;option&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
| /config set password hunter2&lt;br /&gt;
| Gets or sets various multiplayer game settings. Available configs are: afk-auto-kick, allow-commands, allow-debug-settings, autosave-interval, autosave-only-on-server, ignore-player-limit-for-returning-players, max-players, max-upload-speed, only-admins-can-pause, password, require-user-verification, visibility-lan, visibility-public.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /delete-blueprint-library &amp;lt;player&amp;gt;&lt;br /&gt;
| /delete-blueprint-library everybody confirm&lt;br /&gt;
| Deletes the blueprint library storage for the given offline player from the save file. Enter “everybody confirm” to delete the storage of all offline players.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /demote &amp;lt;player&amp;gt;&lt;br /&gt;
| /demote AzureDiamond&lt;br /&gt;
| Demotes the player from admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /ignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /ignore Cthon98&lt;br /&gt;
| Prevents the chat from showing messages from this player. Admin messages are still shown.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ignores&lt;br /&gt;
| /ignores&lt;br /&gt;
| Prints a list of ignored players.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /kick &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /kick xTROLLx Throwing grenades in base&lt;br /&gt;
| Kicks the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mute &amp;lt;player&amp;gt;&lt;br /&gt;
| /mute Cthon98&lt;br /&gt;
| Prevents the player from saying anything in chat.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mutes&lt;br /&gt;
| /mutes&lt;br /&gt;
| All players that are muted (can’t talk in chat).&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /open &amp;lt;player&amp;gt;&lt;br /&gt;
| /open AzureDiamond&lt;br /&gt;
| Opens another player’s inventory.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /o &amp;lt;player&amp;gt;&lt;br /&gt;
| /o AzureDiamond&lt;br /&gt;
| Same as /open.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /players [online/o/count/c]&lt;br /&gt;
| /players&lt;br /&gt;
| Prints a list of players in the game. (parameter online/o, it prints only players that are online, count/c prints only count)&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /promote &amp;lt;player&amp;gt;&lt;br /&gt;
| /promote AzureDiamond&lt;br /&gt;
| Promotes the player to admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /purge &amp;lt;player&amp;gt;&lt;br /&gt;
| /purge Cthon98&lt;br /&gt;
| Clears all the messages from this player from the chat log.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /reply &amp;lt;message&amp;gt;&lt;br /&gt;
| /reply oh, really?&lt;br /&gt;
| Replies to the last player that whispered to you.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /r &amp;lt;message&amp;gt;&lt;br /&gt;
| /r oh, really?&lt;br /&gt;
| Same as /reply.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /server-save&lt;br /&gt;
| /server-save&lt;br /&gt;
| Saves the game on the server in a multiplayer game.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /shout &amp;lt;message&amp;gt;&lt;br /&gt;
| /shout Hello world!&lt;br /&gt;
| Sends a message to all players including other forces.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /s &amp;lt;message&amp;gt;&lt;br /&gt;
| /s Hello world!&lt;br /&gt;
| Same as /shout.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /swap-players &amp;lt;player&amp;gt; [player]&lt;br /&gt;
| /swap-players AzureDiamond&lt;br /&gt;
| Swaps your character with the given player’s character, or if two players are given swaps the two player characters.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unban &amp;lt;player&amp;gt;&lt;br /&gt;
| /unban xTROLLx&lt;br /&gt;
| Unbans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /unignore Cthon98&lt;br /&gt;
| Allows the chat to show messages from this player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unmute &amp;lt;player&amp;gt;&lt;br /&gt;
| /unmute Cthon98&lt;br /&gt;
| Allows the player to talk in chat again.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /whisper &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /whisper AzureDiamond thats what I see&lt;br /&gt;
| Sends a message to the specified player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /w &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /w AzureDiamond thats what I see&lt;br /&gt;
| Same as /whisper.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /whitelist &amp;lt;add/remove/get/clear&amp;gt; [player]&lt;br /&gt;
| /whitelist get&lt;br /&gt;
| Adds or removes a player from the whitelist, where only whitelisted players can join the game. Enter nothing for “player” when using “get” to print a list of all whitelisted players. An empty whitelist disables the whitelist functionality allowing anyone to join.&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scripting and cheat commands ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| /c &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /measured-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command and measures time it took.&lt;br /&gt;
|-&lt;br /&gt;
| /silent-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command without printing it to the console.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a very powerful feature, which also allows cheating, and as such &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;achievements will be permanently disabled for the save&amp;lt;/span&amp;gt; as soon as you use a script command.&lt;br /&gt;
&lt;br /&gt;
== Basic example scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Use it as calculator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(1234*5678)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zoom beyond normal bounds ===&lt;br /&gt;
Note that zooming too far out can cause performance hits. Be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.zoom=0.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mine faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Craft faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unlock and research all technologies ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_all_technologies()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Undo this with the command in the next section.&lt;br /&gt;
&lt;br /&gt;
=== Unresearch all technologies ===&lt;br /&gt;
This does not reset manually applied bonuses&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	tech.researched=false&lt;br /&gt;
	game.player.force.set_saved_technology_progress(tech, 0)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable researching ===&lt;br /&gt;
It disables actual researching&lt;br /&gt;
/c game.player.force.current_research = nil&lt;br /&gt;
&lt;br /&gt;
=== Reset your force ===&lt;br /&gt;
This resets all data for your force, including kill and production statistics, technologies, bonuses and charting status.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.reset()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Always show rail block visualization ===&lt;br /&gt;
Permanently show the rail block visualization instead of only when holding a rail signal. Disable by replacing true with false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.game_view_settings.show_rail_block_visualisation = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inventory manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Cheat mode ===&lt;br /&gt;
Allows for infinite free crafting. Disable by replacing true with false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.cheat_mode=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource tile in-game&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.amount=7500&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively you can refill all resources in the map with the following command. Change ore.amount to the desired value.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c surface = game.player.surface&lt;br /&gt;
for _, ore in pairs(surface.find_entities_filtered({type=&amp;quot;resource&amp;quot;})) do&lt;br /&gt;
    ore.amount = 10000&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add items to the player&#039;s inventory ===&lt;br /&gt;
Replace iron-plate with the [[data.raw|internal name]] of the item desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For instance, here&#039;s a stack of the god-mode energy system interface:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;electric-energy-interface&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a powerful armor with equipment and some tools for construction:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c	local player = game.player&lt;br /&gt;
player.insert{name=&amp;quot;power-armor-mk2&amp;quot;, count = 1}&lt;br /&gt;
local p_armor = player.get_inventory(5)[1].grid&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;personal-roboport-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;night-vision-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
player.insert{name=&amp;quot;construction-robot&amp;quot;, count = 25}&lt;br /&gt;
player.insert{name=&amp;quot;blueprint&amp;quot;, count = 3}&lt;br /&gt;
player.insert{name=&amp;quot;deconstruction-planner&amp;quot;, count = 1}&lt;br /&gt;
player.insert{name=&amp;quot;steel-axe&amp;quot;, count = 10}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== World manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Reveal the map around the player ===&lt;br /&gt;
&lt;br /&gt;
Reveals the map around the player, similar to a [[radar]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or from start position&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces.player.chart(game.player.surface, {{x = -2000, y = -2000}, {x = 2000, y = 2000}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change 150 to the desired radius, higher values take longer.&lt;br /&gt;
&lt;br /&gt;
If much of the map is revealed, it increases the size of the save file. The following command cancels the generation of all chunks that are currently queued for generation and removes chunks outside a 32 chunks radius around 0,0. Note that this will remove player entities if there are any on these chunks.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface;&lt;br /&gt;
game.player.force.cancel_charting(surface); &lt;br /&gt;
local chunk_radius = 32;&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  if (chunk.x &amp;lt; -chunk_radius or chunk.x &amp;gt; chunk_radius or chunk.y &amp;lt; -chunk_radius or chunk.y &amp;gt; chunk_radius) then&lt;br /&gt;
    surface.delete_chunk(chunk)&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
Enables eternal day.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.always_day=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change game speed ===&lt;br /&gt;
0.5 is half speed, 1 is default, 2 is double speed, etc. Minimum is 0.01. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.speed=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expensive (marathon) or normal mode ===&lt;br /&gt;
To change from normal to expensive mode preset (this changes the research cost and intermediate product cost):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change back to normal:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Freeze time ===&lt;br /&gt;
Stops the advancement of the time if you replace &amp;quot;BOOL&amp;quot; with &amp;quot;true&amp;quot; or unfreezes it if you replace it with &amp;quot;false&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.freeze_daytime=BOOL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.clear_pollution()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Completely turn off pollution ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, surface in pairs(game.surfaces) do&lt;br /&gt;
  surface.clear_pollution()&lt;br /&gt;
end&lt;br /&gt;
game.map_settings.pollution.enabled = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add a lot of pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.pollute(game.player.position, 1000000)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable friendly fire for your force ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.friendly_fire = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 11×11 patch of resources, centered on the player character, where the ground is not water.&lt;br /&gt;
The patch it creates is perfectly square but it randomizes the amount similar to natural generation, with fewer ore at the edges and more ore in the center.&lt;br /&gt;
The default numbers result in a patch with 2500-3000 ore.&lt;br /&gt;
&lt;br /&gt;
If you want a larger patch, change &amp;quot;local size = 5&amp;quot; to a larger number.&lt;br /&gt;
A larger patch will have exponentially more ore.&lt;br /&gt;
Entering a number above 30 is not recommended.&lt;br /&gt;
&lt;br /&gt;
If you want a richer patch, change &amp;quot;local density = 10&amp;quot; to a larger number.&lt;br /&gt;
Entering a very large number shouldn&#039;t hurt anything but you probably don&#039;t need to go above 100.&lt;br /&gt;
&lt;br /&gt;
To choose which resource is spawned, change &amp;quot;stone&amp;quot; near the bottom to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, &amp;quot;coal&amp;quot;, or &amp;quot;uranium-ore&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local ore=nil&lt;br /&gt;
local size=5&lt;br /&gt;
local density=10&lt;br /&gt;
for y=-size, size do&lt;br /&gt;
	for x=-size, size do&lt;br /&gt;
		a=(size+1-math.abs(x))*10&lt;br /&gt;
		b=(size+1-math.abs(y))*10&lt;br /&gt;
		if a&amp;lt;b then&lt;br /&gt;
			ore=math.random(a*density-a*(density-8), a*density+a*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if b&amp;lt;a then&lt;br /&gt;
			ore=math.random(b*density-b*(density-8), b*density+b*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if surface.get_tile(game.player.position.x+x, game.player.position.y+y).collides_with(&amp;quot;ground-tile&amp;quot;) then&lt;br /&gt;
			surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=ore, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches in a 3×3 square.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for y=0,2 do&lt;br /&gt;
	for x=0,2 do&lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or randomly without any collision:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local position=nil&lt;br /&gt;
for i=1,9 do&lt;br /&gt;
	position=game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
	if position then &lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position=position})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Count entities ===&lt;br /&gt;
Counts all entities whose name includes the string in local entity.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local entity=&amp;quot;belt&amp;quot;&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local count=0&lt;br /&gt;
for key, ent in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(ent.name,entity) then&lt;br /&gt;
		count=count+1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(count)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emptying all pipes, underground pipes and pumps ===&lt;br /&gt;
Useful when pipes contain a fluid you dont want.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local deleted=0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(entity.name, &amp;quot;pipe&amp;quot;) or &lt;br /&gt;
		string.find(entity.name, &amp;quot;pump&amp;quot;) &lt;br /&gt;
	then&lt;br /&gt;
		for i=1,#entity.fluidbox do&lt;br /&gt;
			deleted = deleted + 1&lt;br /&gt;
			entity.fluidbox[i] = nil;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(&amp;quot;Fluids removed from &amp;quot;..deleted ..&amp;quot; entities&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off cliff generation ===&lt;br /&gt;
Sets size to &amp;quot;none&amp;quot;. Only effective on chunks that are generated after using this command. Use [[#Remove all cliffs]] to delete existing cliffs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local mgs = game.player.surface.map_gen_settings&lt;br /&gt;
mgs.cliff_settings.cliff_elevation_0 = 1024&lt;br /&gt;
game.player.surface.map_gen_settings = mgs&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all cliffs ===&lt;br /&gt;
Removes all cliffs existing cliffs from the world. Use [[#Turn off cliff generation]] to turn off cliff generation in new chunks.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, v in pairs(game.player.surface.find_entities_filtered{type=&amp;quot;cliff&amp;quot;}) do&lt;br /&gt;
  v.destroy()&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enemy/evolution scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Set evolution factor ===&lt;br /&gt;
Ranges from 0 (new game) to 1.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].evolution_factor=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_evolution.time_factor=0&lt;br /&gt;
/c game.map_settings.enemy_evolution.pollution_factor=game.map_settings.enemy_evolution.pollution_factor*2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;2&amp;quot; at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.&lt;br /&gt;
&lt;br /&gt;
=== Kill all biters on the &amp;quot;enemy&amp;quot; force ===&lt;br /&gt;
Note that this will kill only mobile units, spawners will not be killed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all enemies ===&lt;br /&gt;
This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the explored world, so any unexplored parts of the map which still need to be generated will still have enemies.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable peaceful mode ===&lt;br /&gt;
Enabling peaceful mode prevents biter attacks until provoked. Substitute true for false to disable. Already existing biters are not affected by this command so attacks could continue for a while after activating peaceful mode.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.peaceful_mode = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable biter expansion ===&lt;br /&gt;
Biter expansion allows biters to create new nests, it is enabled by default. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_expansion.enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Player character scripts ==&lt;br /&gt;
Commands concerning the player directly.&lt;br /&gt;
=== Get player position ===&lt;br /&gt;
Prints coordinates of your current position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.position.x .. &amp;quot;, &amp;quot; .. game.player.position.y)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Teleport player ===&lt;br /&gt;
Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.teleport({X, Y})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To teleport to the world&#039;s origin, use 0,0.&lt;br /&gt;
&lt;br /&gt;
=== Enable god mode ===&lt;br /&gt;
God mode removes your player character allowing you to fly over obstacles and take no damage.&lt;br /&gt;
&lt;br /&gt;
Disassociate your controls from the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.character=nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, hover the mouse over the useless player and destroy it by typing:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.destroy()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To undo, spawn a player character. This will spawn a new player at the spawn point of the world, and connect your controls to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.create_character()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.laboratory_speed_modifier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
1 is normal speed, 2 is double speed 3 is triple etc.&lt;br /&gt;
&lt;br /&gt;
=== Research specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=true&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unresearch specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;electric-energy-distribution-1&#039;, 0)&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;steel-processing&#039;, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling specific recipes ===&lt;br /&gt;
The internal recipe/item names can be found in the infoboxes on their respective pages.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;electric-energy-interface&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;rocket-silo&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes.loader.enabled=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable all recipes ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name, recipe in pairs(game.player.force.recipes) do recipe.enabled = true end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command line parameters ==&lt;br /&gt;
&#039;&#039;&#039;As of Game Version 0.15.13&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Command line parameters can be used to set settings in the command line before the game launches, this is useful mainly for advanced users or server hosts.&lt;br /&gt;
&lt;br /&gt;
General options:&lt;br /&gt;
  -h [ --help ]                      display help&lt;br /&gt;
  --version                          show version information&lt;br /&gt;
  -v [ --verbose ]                   enable verbose logging&lt;br /&gt;
  -c [ --config ] PATH               config file to use&lt;br /&gt;
  --no-log-rotation                  don&#039;t rotate log file&lt;br /&gt;
  --mod-directory PATH               Mod directory to use&lt;br /&gt;
  --check-unused-prototype-data      Print a warning for all prototype values that were not accessed&lt;br /&gt;
&lt;br /&gt;
Running options:&lt;br /&gt;
  -s [ --map2scenario ] arg          map to scenario conversion&lt;br /&gt;
  -m [ --scenario2map ] arg          scenario to map conversion&lt;br /&gt;
  --apply-update arg                 immediately apply update package&lt;br /&gt;
  --create FILE                      create a new map&lt;br /&gt;
  --map-gen-settings FILE            Map generation settings for use with --create. See data/map-gen-settings.example.json&lt;br /&gt;
  --map-settings FILE                Map settings for use with --create. See data/base/prototypes/map-settings.lua&lt;br /&gt;
  --preset arg                       Name of the map generation preset to be used.&lt;br /&gt;
  --generate-map-preview FILE        Generate preview images of the map&lt;br /&gt;
  --map-preview-size SCALE (=1,024)  Size (in pixels) of map preview&lt;br /&gt;
  --map-preview-scale SCALE (=1)     Scale (meters per pixel) of map preview&lt;br /&gt;
  --map-preview-offset X,Y (=0,0)    Offset of the center of the map, in meters&lt;br /&gt;
  --start-server FILE                start a multiplayer server&lt;br /&gt;
  --start-server-load-scenario FILE  start a multiplayer server and load the specified scenario&lt;br /&gt;
  --start-server-load-latest         start a multiplayer server and load the latest available save&lt;br /&gt;
  --until-tick TICK                  run a save until given map tick&lt;br /&gt;
  --mp-connect ADDRESS               start factorio and connect to address&lt;br /&gt;
  --load-game FILE                   start Factorio and load a game in singleplayer&lt;br /&gt;
  --benchmark FILE                   load save and run benchmark&lt;br /&gt;
  --benchmark-ticks N (=1,000)       number of ticks for benchmarking. Default is 1000&lt;br /&gt;
  --force-opengl                     use OpenGL for rendering&lt;br /&gt;
  --force-d3d                        use Direct3D for rendering&lt;br /&gt;
  --fullscreen BOOL                  start game in windowed mode (saved to configuration)&lt;br /&gt;
  --max-texture-size N               maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048&lt;br /&gt;
  --graphics-quality arg             accepted values: normal, low, very-low&lt;br /&gt;
  --video-memory-usage arg           accepted values: all, high, medium, low&lt;br /&gt;
  --gfx-safe-mode                    resets some graphics settings to values that should work on most configurations&lt;br /&gt;
  --shader arg                       enable/disable shader postprocessing (saved to configuration)&lt;br /&gt;
  --disable-audio                    Disable audio. Mainly for faster startup during development.&lt;br /&gt;
&lt;br /&gt;
Server options:&lt;br /&gt;
  --port N                           network port to use&lt;br /&gt;
  --bind ADDRESS[:PORT]              IP address (and optionally port) to bind to&lt;br /&gt;
  --rcon-port N                      Port to use for RCON&lt;br /&gt;
  --rcon-password PASSWORD           Password for RCON&lt;br /&gt;
  --server-settings FILE             Path to file with server settings. See data/server-settings.example.json&lt;br /&gt;
  --server-whitelist FILE            Path to file with server whitelist.&lt;br /&gt;
  --server-banlist FILE              Path to file with server banlist.&lt;br /&gt;
  --console-log FILE                 Path to file where a copy of the server&#039;s log will be stored&lt;br /&gt;
  --server-id FILE                   Path where server ID will be stored or read from&lt;br /&gt;
&lt;br /&gt;
=== Multiplayer ===&lt;br /&gt;
&lt;br /&gt;
  --start-server SAVE&lt;br /&gt;
&lt;br /&gt;
Will start a Headless (Dedicated) server, with no GUI.&lt;br /&gt;
&lt;br /&gt;
  --mp-connect ADDRESS&lt;br /&gt;
ADDRESS is the IP:port of the remote host. Port is optional.&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101:2345&lt;br /&gt;
&lt;br /&gt;
As above, port can be specified by placing the port number after a colon in the address.&lt;br /&gt;
&lt;br /&gt;
  --map2scenario SAVE&lt;br /&gt;
Converts a save game to a User Scenario, allows saved game state to be loaded into map editor.&lt;br /&gt;
Assuming that save game name is &amp;quot;foo.zip&amp;quot;, executing &#039;./factorio --map2scenario s1&#039; will result in Factorio loading, opening the save file, and saving the scenario into the scenario folder.&lt;br /&gt;
&lt;br /&gt;
== Modding tools ==&lt;br /&gt;
A list of the internal names of most things in the vanilla game can also be found on [[data.raw]].&lt;br /&gt;
&lt;br /&gt;
=== Print to console which tile are you have under the player position ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.surface.get_tile(game.player.position.x, game.player.position.y).name)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all researched technologies to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	if tech.researched then&lt;br /&gt;
    list[#list+1] = tech.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;techs.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all enabled recipes to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, recipe in pairs(game.player.force.recipes) do &lt;br /&gt;
	if recipe.enabled then&lt;br /&gt;
    list[#list+1] = recipe.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;recipes.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=165092</id>
		<title>User:Darkfrei/script</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=165092"/>
		<updated>2018-11-04T12:41:06Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Add new oil patch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches randomly without collisions:&lt;br /&gt;
&lt;br /&gt;
 /c local position = nil&lt;br /&gt;
 for i=1,9 do&lt;br /&gt;
   position = game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
   if position then &lt;br /&gt;
     game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position=position})&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
=== Respawn enemies ===&lt;br /&gt;
This creates one respawner every 32x32 tiles:&lt;br /&gt;
&lt;br /&gt;
 /c local surface = game.player.surface&lt;br /&gt;
 for c in surface.get_chunks() do&lt;br /&gt;
   local position = surface.find_non_colliding_position(&amp;quot;biter-spawner&amp;quot;, {x=c.x*32+16, y=c.y*32+16}, 10, 3)&lt;br /&gt;
   if position and surface.is_chunk_generated(c) then&lt;br /&gt;
     surface.create_entity{name=&amp;quot;biter-spawner&amp;quot;, position=position}&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=165091</id>
		<title>User:Darkfrei/script</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=User:Darkfrei/script&amp;diff=165091"/>
		<updated>2018-11-04T12:40:52Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Respawn enemies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches randomly without collisions:&lt;br /&gt;
&lt;br /&gt;
 /c local position = nil&lt;br /&gt;
 for i=1,9 do&lt;br /&gt;
 	position = game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
 	if position then &lt;br /&gt;
 		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position=position})&lt;br /&gt;
 	end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
=== Respawn enemies ===&lt;br /&gt;
This creates one respawner every 32x32 tiles:&lt;br /&gt;
&lt;br /&gt;
 /c local surface = game.player.surface&lt;br /&gt;
 for c in surface.get_chunks() do&lt;br /&gt;
   local position = surface.find_non_colliding_position(&amp;quot;biter-spawner&amp;quot;, {x=c.x*32+16, y=c.y*32+16}, 10, 3)&lt;br /&gt;
   if position and surface.is_chunk_generated(c) then&lt;br /&gt;
     surface.create_entity{name=&amp;quot;biter-spawner&amp;quot;, position=position}&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Game-day&amp;diff=165001</id>
		<title>Game-day</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Game-day&amp;diff=165001"/>
		<updated>2018-10-26T07:22:07Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
A [[Game-day|day]] lasts 25000 [[Game-tick]]s or 416.66~ [[Game-second]]s.&lt;br /&gt;
&lt;br /&gt;
The light varies throughout the day in a cycle consisting of 4 phases:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Phase Name !! Internal name !! Behaviour !! Time of day at start !! Time of day at end !! Duration (in ticks) || Duration (in seconds)&lt;br /&gt;
|-&lt;br /&gt;
|day || dawn ||fully light ||0.75 ||0.25 ||12500 ||208.33~&lt;br /&gt;
|-&lt;br /&gt;
|sunset|| dusk ||darkening ||0.25 ||0.45 ||5000 ||83.33~&lt;br /&gt;
|-&lt;br /&gt;
|night || evening ||fully dark ||0.45 ||0.55 ||2500 ||41.66~&lt;br /&gt;
|-&lt;br /&gt;
|sunrise || morning ||lightening ||0.55 ||0.75 ||5000 ||83.33~&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
   ------------- day -------&amp;gt;&amp;lt;----- sunset -----&amp;gt;&amp;lt; night -&amp;gt;&amp;lt;----- sunrise ----&amp;gt;&amp;lt;-------- day ------------&lt;br /&gt;
   &lt;br /&gt;
 % 0    5    10   15   20   25   30   35   40   45   50   55   60   65   70   75   80   85   90   95  100&lt;br /&gt;
   |----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|&lt;br /&gt;
&lt;br /&gt;
During sunset, the light level decreases linearly from fully light to fully dark. During sunrise, it increases linearly from dark to light.&lt;br /&gt;
&lt;br /&gt;
Note: The actual time between phases can vary +/- a tick due to rounding errors.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Time]]&lt;br /&gt;
* [http://lua-api.factorio.com/latest/LuaGameScript.html#LuaGameScript.tick LuaGameScript.tick].&lt;br /&gt;
* [https://lua-api.factorio.com/latest/LuaSurface.html#LuaSurface.ticks_per_day LuaSurface.ticks_per_day].&lt;br /&gt;
* [[Game-tick]]&lt;br /&gt;
* [[Game-second]]&lt;br /&gt;
* [[Units]]&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Map_generator&amp;diff=164349</id>
		<title>Talk:Map generator</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Map_generator&amp;diff=164349"/>
		<updated>2018-09-18T19:00:20Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I think all references to terrain segmentation should be removed - it was just water frequency with a different name in older builds according to https://forums.factorio.com/viewtopic.php?p=235907#p235907&lt;br /&gt;
[[User:Zx64|Zx64]] ([[User talk:Zx64|talk]]) 12:12, 20 January 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Fog of war ==&lt;br /&gt;
&lt;br /&gt;
The charting and fog of war mechanics should be moved to their own page. Do they have one already?&lt;br /&gt;
[[User:Gergely|Gergely]]&lt;br /&gt;
&lt;br /&gt;
:They don&#039;t have their own page, they are located on [[radar]]. Why do you want to move them to their own page? -- [[User:Bilka|Bilka]] ([[User talk:Bilka|talk]]) - &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Admin&amp;lt;/span&amp;gt; 11:52, 3 August 2018 (UTC)&lt;br /&gt;
&lt;br /&gt;
:I see... I didn&#039;t know that. The charting mechanics are at a good place on the Radar&#039;s page. [[User:Gergely|Gergely]]&lt;br /&gt;
&lt;br /&gt;
== Seed ==&lt;br /&gt;
&lt;br /&gt;
I think that here must be some information about seed:&lt;br /&gt;
&lt;br /&gt;
With the console:&lt;br /&gt;
/seed&lt;br /&gt;
With control.lua:&lt;br /&gt;
game.surfaces[&#039;nauvis&#039;].map_gen_settings.seed&lt;br /&gt;
--[[User:Darkfrei|Darkfrei]] ([[User talk:Darkfrei|talk]]) 19:00, 18 September 2018 (UTC)&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Talk:Map_generator&amp;diff=164348</id>
		<title>Talk:Map generator</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Talk:Map_generator&amp;diff=164348"/>
		<updated>2018-09-18T18:59:49Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I think all references to terrain segmentation should be removed - it was just water frequency with a different name in older builds according to https://forums.factorio.com/viewtopic.php?p=235907#p235907&lt;br /&gt;
[[User:Zx64|Zx64]] ([[User talk:Zx64|talk]]) 12:12, 20 January 2017 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Fog of war ==&lt;br /&gt;
&lt;br /&gt;
The charting and fog of war mechanics should be moved to their own page. Do they have one already?&lt;br /&gt;
[[User:Gergely|Gergely]]&lt;br /&gt;
&lt;br /&gt;
:They don&#039;t have their own page, they are located on [[radar]]. Why do you want to move them to their own page? -- [[User:Bilka|Bilka]] ([[User talk:Bilka|talk]]) - &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;Admin&amp;lt;/span&amp;gt; 11:52, 3 August 2018 (UTC)&lt;br /&gt;
&lt;br /&gt;
:I see... I didn&#039;t know that. The charting mechanics are at a good place on the Radar&#039;s page. [[User:Gergely|Gergely]]&lt;br /&gt;
&lt;br /&gt;
== Seed ==&lt;br /&gt;
&lt;br /&gt;
I think that here must be some information about seed:&lt;br /&gt;
With the console:&lt;br /&gt;
/seed&lt;br /&gt;
With control.lua:&lt;br /&gt;
game.surfaces[&#039;nauvis&#039;].map_gen_settings.seed&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=159331</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=159331"/>
		<updated>2018-05-18T20:16:03Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Modding tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Overview ==&lt;br /&gt;
The &#039;&#039;&#039;Console&#039;&#039;&#039; is Factorio&#039;s command-line interface.&lt;br /&gt;
&lt;br /&gt;
The in-game console is used for:&lt;br /&gt;
&lt;br /&gt;
* Chatting with other players&lt;br /&gt;
* Running commands / scripts / cheats&lt;br /&gt;
* Occasional status updates&lt;br /&gt;
&lt;br /&gt;
There are three types of commands:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[#Normal commands|Normal]]&#039;&#039;&#039; - Display information about the game and customize your experience.&lt;br /&gt;
* &#039;&#039;&#039;[[#Multiplayer commands|Multiplayer]]&#039;&#039;&#039; - Message filtering, banning users, etc.&lt;br /&gt;
* &#039;&#039;&#039;[[#Scripting and cheat commands|Scripting/Cheating]]&#039;&#039;&#039; - Run small Lua scripts (but they &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;disable achievements for the save game&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== Using the console ===&lt;br /&gt;
The console display can be toggled with the {{keybinding|/}} (slash) or {{keybinding|~}} (tilde) keys.&lt;br /&gt;
&lt;br /&gt;
You can customize the keys via &#039;&#039;&#039;Options Menu → Keyboard → Toggle Lua console&#039;&#039;&#039;.&lt;br /&gt;
When the console is open, you&#039;ll see a blinking cursor at the bottom of the screen; type your message or command and hit &#039;&#039;&#039;Return&#039;&#039;&#039; to send it (this will also close the console).&lt;br /&gt;
Documentation about message and command prefixes can be found further down this page.&lt;br /&gt;
&lt;br /&gt;
When console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages).&lt;br /&gt;
Note that by default, all executed commands are made visible to all users. You can set the fade out time via &#039;&#039;&#039;Options Menu → Other Settings → Message Delay&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you want to immediately hide the console, open the console and then press &#039;&#039;&#039;Escape&#039;&#039;&#039; key (or press &#039;&#039;&#039;Return&#039;&#039;&#039; without entering any message/command).&lt;br /&gt;
This not only closes the console, but it also hides all the recent messages/commands.&lt;br /&gt;
The console can be cleared with the &#039;&#039;&#039;/clear&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Note that the console can also accept raw Lua code as well as game commands.&lt;br /&gt;
&lt;br /&gt;
=== Console history ===&lt;br /&gt;
&lt;br /&gt;
The console has an inbuilt history; it&#039;s a bit like a text editor where only one line of text is displayed at a time.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;uarr;}} and {{keybinding|&amp;amp;darr;}} keys to scroll through the console history.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;larr;}} and {{keybinding|&amp;amp;rarr;}} keys to cursor through the currently displayed message or command, which you can edit (delete, insert, etc.) and resend (by pressing &#039;&#039;&#039;Return&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
The {{keybinding|Tab}} key will auto-complete commands and player ids.&lt;br /&gt;
&lt;br /&gt;
== Normal commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| /alerts &amp;lt;enable/disable/mute/unmute&amp;gt; &amp;lt;alert&amp;gt;&lt;br /&gt;
| /alerts disable turret_fire&lt;br /&gt;
| Enables, disables, mutes, or unmutes the given alert type. Available alerts: entity_destroyed, entity_under_attack, not_enough_construction_robots, no_material_for_construction, not_enough_repair packs, turret_fire, custom, no_storage.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /clear&lt;br /&gt;
| /clear&lt;br /&gt;
| Clears the console.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /color &amp;lt;color&amp;gt;&lt;br /&gt;
| /color 20 255 255 100&lt;br /&gt;
| Changes your color. Can either be one of the pre-defined colors or [[:Wikipedia:RGBA_color_space|RGBA value]] in the format of “# # # #”. Available colors: default, red, green, blue, orange, yellow, pink, purple, white, black, gray, brown, cyan, acid.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /evolution&lt;br /&gt;
| /evolution&lt;br /&gt;
| Prints info about the alien evolution factor.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /help [command]&lt;br /&gt;
| /help&lt;br /&gt;
| Prints a list of available commands, the optional argument can specify the command that should be described.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /h [command]&lt;br /&gt;
| /h&lt;br /&gt;
| Same as /help.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /mute-programmable-speaker &amp;lt;mute/unmute&amp;gt; &amp;lt;local/everyone&amp;gt;&lt;br /&gt;
| /mute-programmable-speaker mute local&lt;br /&gt;
| Mutes or unmutes the global sounds created by the Programmable Speaker. Use “local” to mute just the local client. Admins can use “everyone” to mute the sounds for everyone on the server.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /perf-avg-frames &amp;lt;number&amp;gt;&lt;br /&gt;
| /perf-avg-frames 100&lt;br /&gt;
| Number of ticks/updates used to average performance counters. Default is 100. Value of 5-10 is recommended for fast convergence, but numbers will jitter more rapidly.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /permissions&lt;br /&gt;
| /permissions&lt;br /&gt;
| Opens the permissions GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /screenshot [x resolution] [y resolution] [zoom]&lt;br /&gt;
| /screenshot&lt;br /&gt;
| Takes a screenshot with the GUI hidden, centered on the player. It is saved in the &amp;quot;script-output&amp;quot; subfolder of your [[User data directory]].  Resolution is optional and defaults to the current window size. Zoom is optional and defaults to 1.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /seed&lt;br /&gt;
| /seed&lt;br /&gt;
| Prints the starting map seed.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /time&lt;br /&gt;
| /time&lt;br /&gt;
| Prints info about how old the map is.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| Toggles logging all input actions performed by the game. This value isn’t persisted between game restarts and only affects your local game in multiplayer sessions.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| Used to investigate desyncs. Will slow down the game and make multiplayer unplayable.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| Toggles if the rockets sent button is shown in the upper left corner of the screen.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /version&lt;br /&gt;
| /version&lt;br /&gt;
| Prints the current game version.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Multiplayer commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;message&amp;gt;&lt;br /&gt;
| Hello team!&lt;br /&gt;
| Console input that does not start with {{keybinding|/}} is shown as a chat message to your team.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /admins&lt;br /&gt;
| /admins&lt;br /&gt;
| Prints a list of game admins.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ban &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /ban xTROLLx Throwing grenades in base&lt;br /&gt;
| Bans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /banlist &amp;lt;add/remove/get/clear&amp;gt; &amp;lt;player&amp;gt;&lt;br /&gt;
| /banlist get&lt;br /&gt;
| Adds or removes a player from the banlist. Same as /ban or /unban.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /config &amp;lt;get/set&amp;gt; &amp;lt;option&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
| /config set password hunter2&lt;br /&gt;
| Gets or sets various multiplayer game settings. Available configs are: afk-auto-kick, allow-commands, allow-debug-settings, autosave-interval, autosave-only-on-server, ignore-player-limit-for-returning-players, max-players, max-upload-speed, only-admins-can-pause, password, require-user-verification, visibility-lan, visibility-public.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /delete-blueprint-library &amp;lt;player&amp;gt;&lt;br /&gt;
| /delete-blueprint-library everybody confirm&lt;br /&gt;
| Deletes the blueprint library storage for the given offline player from the save file. Enter “everybody confirm” to delete the storage of all offline players.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /demote &amp;lt;player&amp;gt;&lt;br /&gt;
| /demote AzureDiamond&lt;br /&gt;
| Demotes the player from admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /ignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /ignore Cthon98&lt;br /&gt;
| Prevents the chat from showing messages from this player. Admin messages are still shown.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ignores&lt;br /&gt;
| /ignores&lt;br /&gt;
| Prints a list of ignored players.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /kick &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /kick xTROLLx Throwing grenades in base&lt;br /&gt;
| Kicks the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mute &amp;lt;player&amp;gt;&lt;br /&gt;
| /mute Cthon98&lt;br /&gt;
| Prevents the player from saying anything in chat.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mutes&lt;br /&gt;
| /mutes&lt;br /&gt;
| All players that are muted (can’t talk in chat).&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /open &amp;lt;player&amp;gt;&lt;br /&gt;
| /open AzureDiamond&lt;br /&gt;
| Opens another player’s inventory.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /o &amp;lt;player&amp;gt;&lt;br /&gt;
| /o AzureDiamond&lt;br /&gt;
| Same as /open.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /players [online/o/count/c]&lt;br /&gt;
| /players&lt;br /&gt;
| Prints a list of players in the game. (parameter online/o, it prints only players that are online, count/c prints only count)&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /promote &amp;lt;player&amp;gt;&lt;br /&gt;
| /promote AzureDiamond&lt;br /&gt;
| Promotes the player to admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /purge &amp;lt;player&amp;gt;&lt;br /&gt;
| /purge Cthon98&lt;br /&gt;
| Clears all the messages from this player from the chat log.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /reply &amp;lt;message&amp;gt;&lt;br /&gt;
| /reply oh, really?&lt;br /&gt;
| Replies to the last player that whispered to you.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /r &amp;lt;message&amp;gt;&lt;br /&gt;
| /r oh, really?&lt;br /&gt;
| Same as /reply.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /server-save&lt;br /&gt;
| /server-save&lt;br /&gt;
| Saves the game on the server in a multiplayer game.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /shout &amp;lt;message&amp;gt;&lt;br /&gt;
| /shout Hello world!&lt;br /&gt;
| Sends a message to all players including other forces.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /s &amp;lt;message&amp;gt;&lt;br /&gt;
| /s Hello world!&lt;br /&gt;
| Same as /shout.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /swap-players &amp;lt;player&amp;gt; [player]&lt;br /&gt;
| /swap-players AzureDiamond&lt;br /&gt;
| Swaps your character with the given player’s character, or if two players are given swaps the two player characters.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unban &amp;lt;player&amp;gt;&lt;br /&gt;
| /unban xTROLLx&lt;br /&gt;
| Unbans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /unignore Cthon98&lt;br /&gt;
| Allows the chat to show messages from this player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unmute &amp;lt;player&amp;gt;&lt;br /&gt;
| /unmute Cthon98&lt;br /&gt;
| Allows the player to talk in chat again.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /whisper &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /whisper AzureDiamond thats what I see&lt;br /&gt;
| Sends a message to the specified player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /w &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /w AzureDiamond thats what I see&lt;br /&gt;
| Same as /whisper.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /whitelist &amp;lt;add/remove/get/clear&amp;gt; [player]&lt;br /&gt;
| /whitelist get&lt;br /&gt;
| Adds or removes a player from the whitelist, where only whitelisted players can join the game. Enter nothing for “player” when using “get” to print a list of all whitelisted players. An empty whitelist disables the whitelist functionality allowing anyone to join.&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scripting and cheat commands ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| /c &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /measured-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command and measures time it took.&lt;br /&gt;
|-&lt;br /&gt;
| /silent-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command without printing it to the console.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a very powerful feature, which also allows cheating, and as such &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;achievements will be permanently disabled for the save&amp;lt;/span&amp;gt; as soon as you use a script command.&lt;br /&gt;
&lt;br /&gt;
== Basic example scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Use it as calculator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(1234*5678)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mine faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Craft faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unlock and Research all Technology ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_all_technologies()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Undo this with the command in the next section.&lt;br /&gt;
&lt;br /&gt;
=== Unresearch all technologies ===&lt;br /&gt;
This does not reset manually applied bonuses&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	tech.researched=false&lt;br /&gt;
	game.player.force.set_saved_technology_progress(tech, 0)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Reset your force ===&lt;br /&gt;
This resets all data for your force, including kill and production statistics, technologies, bonuses and charting status.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.reset()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zoom beyond normal bounds ===&lt;br /&gt;
Note that zooming too far out can cause performance hits. Be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.zoom=0.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inventory manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource tile in-game&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.amount=7500&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add items to the player&#039;s inventory ===&lt;br /&gt;
Replace iron-plate with the [[data.raw|internal name]] of the item desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For instance, here&#039;s a stack of the god-mode energy system interface:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;electric-energy-interface&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a powerful armor with equipment and some tools for construction:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c	local player = game.player&lt;br /&gt;
player.insert{name=&amp;quot;power-armor-mk2&amp;quot;, count = 1}&lt;br /&gt;
local p_armor = player.get_inventory(5)[1].grid&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;personal-roboport-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;night-vision-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
player.insert{name=&amp;quot;construction-robot&amp;quot;, count = 25}&lt;br /&gt;
player.insert{name=&amp;quot;blueprint&amp;quot;, count = 3}&lt;br /&gt;
player.insert{name=&amp;quot;deconstruction-planner&amp;quot;, count = 1}&lt;br /&gt;
player.insert{name=&amp;quot;steel-axe&amp;quot;, count = 10}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Cheat mode ===&lt;br /&gt;
Allows for infinite free crafting. Disable by replacing true with false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.cheat_mode=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== World manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Reveal the map around the player ===&lt;br /&gt;
&lt;br /&gt;
Reveals the map around the player, similar to a [[radar]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or from start position&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces.player.chart(game.player.surface, {{x = -2000, y = -2000}, {x = 2000, y = 2000}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change 150 to the desired radius, higher values take longer.&lt;br /&gt;
&lt;br /&gt;
If much of the map is revealed, it increases the size of the save file. The following command cancels the generation of all chunks that are currently queued for generation and removes chunks outside a 32 chunks radius around 0,0. Note that this will remove player entities if there are any on these chunks.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface;&lt;br /&gt;
game.player.force.cancel_charting(surface); &lt;br /&gt;
local chunk_radius = 32;&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  if (chunk.x &amp;lt; -chunk_radius or chunk.x &amp;gt; chunk_radius or chunk.y &amp;lt; -chunk_radius or chunk.y &amp;gt; chunk_radius) then&lt;br /&gt;
    surface.delete_chunk(chunk)&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
Enables eternal day.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.always_day=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change game speed ===&lt;br /&gt;
0.5 is half speed, 1 is default, 2 is double speed, etc. Minimum is 0.01. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.speed=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expensive (marathon) or normal mode ===&lt;br /&gt;
To change from normal to expensive mode preset (this changes the research cost and intermediate product cost):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change back to normal:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Freeze Time Passage ===&lt;br /&gt;
Stops the advancement of the time if you replace &amp;quot;BOOL&amp;quot; with &amp;quot;true&amp;quot; or unfreezes it if you replace it with &amp;quot;false&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.freeze_daytime=BOOL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.clear_pollution()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add a lot of pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.pollute(game.player.position, 1000000)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable friendly fire for your force ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.friendly_fire = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 11×11 patch of resources, centered on the player character, where the ground is not water.&lt;br /&gt;
The patch it creates is perfectly square but it randomizes the amount similar to natural generation, with fewer ore at the edges and more ore in the center.&lt;br /&gt;
The default numbers result in a patch with 2500-3000 ore.&lt;br /&gt;
&lt;br /&gt;
If you want a larger patch, change &amp;quot;local size = 5&amp;quot; to a larger number.&lt;br /&gt;
A larger patch will have exponentially more ore.&lt;br /&gt;
Entering a number above 30 is not recommended.&lt;br /&gt;
&lt;br /&gt;
If you want a richer patch, change &amp;quot;local density = 10&amp;quot; to a larger number.&lt;br /&gt;
Entering a very large number shouldn&#039;t hurt anything but you probably don&#039;t need to go above 100.&lt;br /&gt;
&lt;br /&gt;
To choose which resource is spawned, change &amp;quot;stone&amp;quot; near the bottom to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, &amp;quot;coal&amp;quot;, or &amp;quot;uranium-ore&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local ore=nil&lt;br /&gt;
local size=5&lt;br /&gt;
local density=10&lt;br /&gt;
for y=-size, size do&lt;br /&gt;
	for x=-size, size do&lt;br /&gt;
		a=(size+1-math.abs(x))*10&lt;br /&gt;
		b=(size+1-math.abs(y))*10&lt;br /&gt;
		if a&amp;lt;b then&lt;br /&gt;
			ore=math.random(a*density-a*(density-8), a*density+a*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if b&amp;lt;a then&lt;br /&gt;
			ore=math.random(b*density-b*(density-8), b*density+b*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if surface.get_tile(game.player.position.x+x, game.player.position.y+y).collides_with(&amp;quot;ground-tile&amp;quot;) then&lt;br /&gt;
			surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=ore, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches in a 3×3 square.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for y=0,2 do&lt;br /&gt;
	for x=0,2 do&lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or randomly without any collision:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local position=nil&lt;br /&gt;
for i=1,9 do&lt;br /&gt;
	position=game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
	if position then &lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position=position})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Count entities ===&lt;br /&gt;
Counts all entities whose name includes the string in local entity.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local entity=&amp;quot;belt&amp;quot;&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local count=0&lt;br /&gt;
for key, ent in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(ent.name,entity) then&lt;br /&gt;
		count=count+1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(count)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emptying all pipes, underground pipes and pumps ===&lt;br /&gt;
Useful when pipes contain a fluid you dont want.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local deleted=0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(entity.name, &amp;quot;pipe&amp;quot;) or &lt;br /&gt;
		string.find(entity.name, &amp;quot;pump&amp;quot;) &lt;br /&gt;
	then&lt;br /&gt;
		for i=1,#entity.fluidbox do&lt;br /&gt;
			deleted = deleted + 1&lt;br /&gt;
			entity.fluidbox[i] = nil;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(&amp;quot;Fluids removed from &amp;quot;..deleted ..&amp;quot; entities&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enemy/evolution scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Set evolution factor ===&lt;br /&gt;
Ranges from 0 (new game) to 1.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].evolution_factor=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_evolution.time_factor=0&lt;br /&gt;
/c game.map_settings.enemy_evolution.pollution_factor=game.map_settings.enemy_evolution.pollution_factor*2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;2&amp;quot; at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.&lt;br /&gt;
&lt;br /&gt;
=== Kill all biters on the &amp;quot;enemy&amp;quot; force ===&lt;br /&gt;
Note that this will kill only mobile units and worms, spawners will not be killed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all enemies ===&lt;br /&gt;
This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the explored world, so any unexplored parts of the map which still need to be generated will still have enemies.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable peaceful mode ===&lt;br /&gt;
Enabling peaceful mode prevents biter attacks until provoked. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.peaceful_mode = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable biter expansion ===&lt;br /&gt;
Biter expansion allows biters to create new nests, it is enabled by default. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_expansion.enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Player character scripts ==&lt;br /&gt;
Commands concerning the player directly.&lt;br /&gt;
=== Get Player Position ===&lt;br /&gt;
Prints coordinates of your current position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.position.x .. &amp;quot;, &amp;quot; .. game.player.position.y)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Teleport player ===&lt;br /&gt;
Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.teleport({X, Y})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To teleport to the world&#039;s origin, use 0,0.&lt;br /&gt;
&lt;br /&gt;
=== Enable god mode ===&lt;br /&gt;
God mode removes your player character allowing you to fly over obstacles and take no damage.&lt;br /&gt;
&lt;br /&gt;
Disassociate your controls from the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.character=nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, hover the mouse over the useless player and destroy it by typing:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.destroy()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To undo, spawn a player character. This will spawn a new player at the spawn point of the world, and connect your controls to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.create_character()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.laboratory_speed_modifier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
1 is normal speed, 2 is double speed 3 is triple etc. I think it goes up to 100.&lt;br /&gt;
&lt;br /&gt;
=== Researching specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages, click on the little arrow to show them.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=true&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unresearching specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages, click on the little arrow to show them.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;electric-energy-distribution-1&#039;, 0)&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;steel-processing&#039;, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling specific recipes ===&lt;br /&gt;
The internal recipe/item names can be found in the infoboxes on their respective pages, click on the little arrow to show them.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;electric-energy-interface&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;rocket-silo&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes.loader.enabled=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable all recipes&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name, recipe in pairs(game.player.force.recipes) do recipe.enabled = true end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finish research immediately ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name,technology in pairs(game.player.force.technologies) do technology.researched=technology.enabled end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command Line Parameters ==&lt;br /&gt;
&#039;&#039;&#039;As of Game Version 0.15.13&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Command line parameters can be used to set settings in the command line before the game launches, this is useful mainly for advanced users or server hosts.&lt;br /&gt;
&lt;br /&gt;
General options:&lt;br /&gt;
  -h [ --help ]                      display help&lt;br /&gt;
  --version                          show version information&lt;br /&gt;
  -v [ --verbose ]                   enable verbose logging&lt;br /&gt;
  -c [ --config ] PATH               config file to use&lt;br /&gt;
  --no-log-rotation                  don&#039;t rotate log file&lt;br /&gt;
  --mod-directory PATH               Mod directory to use&lt;br /&gt;
  --check-unused-prototype-data      Print a warning for all prototype values that were not accessed&lt;br /&gt;
&lt;br /&gt;
Running options:&lt;br /&gt;
  -s [ --map2scenario ] arg          map to scenario conversion&lt;br /&gt;
  -m [ --scenario2map ] arg          scenario to map conversion&lt;br /&gt;
  --apply-update arg                 immediately apply update package&lt;br /&gt;
  --create FILE                      create a new map&lt;br /&gt;
  --map-gen-settings FILE            Map generation settings for use with --create. See data/map-gen-settings.example.json&lt;br /&gt;
  --map-settings FILE                Map settings for use with --create. See data/base/prototypes/map-settings.lua&lt;br /&gt;
  --preset arg                       Name of the map generation preset to be used.&lt;br /&gt;
  --generate-map-preview FILE        Generate preview images of the map&lt;br /&gt;
  --map-preview-size SCALE (=1,024)  Size (in pixels) of map preview&lt;br /&gt;
  --map-preview-scale SCALE (=1)     Scale (meters per pixel) of map preview&lt;br /&gt;
  --map-preview-offset X,Y (=0,0)    Offset of the center of the map, in meters&lt;br /&gt;
  --start-server FILE                start a multiplayer server&lt;br /&gt;
  --start-server-load-scenario FILE  start a multiplayer server and load the specified scenario&lt;br /&gt;
  --start-server-load-latest         start a multiplayer server and load the latest available save&lt;br /&gt;
  --until-tick TICK                  run a save until given map tick&lt;br /&gt;
  --mp-connect ADDRESS               start factorio and connect to address&lt;br /&gt;
  --load-game FILE                   start Factorio and load a game in singleplayer&lt;br /&gt;
  --benchmark FILE                   load save and run benchmark&lt;br /&gt;
  --benchmark-ticks N (=1,000)       number of ticks for benchmarking. Default is 1000&lt;br /&gt;
  --force-opengl                     use OpenGL for rendering&lt;br /&gt;
  --force-d3d                        use Direct3D for rendering&lt;br /&gt;
  --fullscreen BOOL                  start game in windowed mode (saved to configuration)&lt;br /&gt;
  --max-texture-size N               maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048&lt;br /&gt;
  --graphics-quality arg             accepted values: normal, low, very-low&lt;br /&gt;
  --video-memory-usage arg           accepted values: all, high, medium, low&lt;br /&gt;
  --gfx-safe-mode                    resets some graphics settings to values that should work on most configurations&lt;br /&gt;
  --shader arg                       enable/disable shader postprocessing (saved to configuration)&lt;br /&gt;
  --disable-audio                    Disable audio. Mainly for faster startup during development.&lt;br /&gt;
&lt;br /&gt;
Server options:&lt;br /&gt;
  --port N                           network port to use&lt;br /&gt;
  --bind ADDRESS[:PORT]              IP address (and optionally port) to bind to&lt;br /&gt;
  --rcon-port N                      Port to use for RCON&lt;br /&gt;
  --rcon-password PASSWORD           Password for RCON&lt;br /&gt;
  --server-settings FILE             Path to file with server settings. See data/server-settings.example.json&lt;br /&gt;
  --server-whitelist FILE            Path to file with server whitelist.&lt;br /&gt;
  --server-banlist FILE              Path to file with server banlist.&lt;br /&gt;
  --console-log FILE                 Path to file where a copy of the server&#039;s log will be stored&lt;br /&gt;
  --server-id FILE                   Path where server ID will be stored or read from&lt;br /&gt;
&lt;br /&gt;
=== Multiplayer ===&lt;br /&gt;
&lt;br /&gt;
  --start-server SAVE&lt;br /&gt;
&lt;br /&gt;
Will start a Headless (Dedicated) server, with no GUI.&lt;br /&gt;
&lt;br /&gt;
  --mp-connect ADDRESS&lt;br /&gt;
ADDRESS is the IP:port of the remote host. Port is optional.&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101:2345&lt;br /&gt;
&lt;br /&gt;
As above, port can be specified by placing the port number after a colon in the address.&lt;br /&gt;
&lt;br /&gt;
  --map2scenario SAVE&lt;br /&gt;
Converts a save game to a User Scenario, allows saved game state to be loaded into map editor.&lt;br /&gt;
Assuming that save game name is &amp;quot;foo.zip&amp;quot;, executing &#039;./factorio --map2scenario s1&#039; will result in Factorio loading, opening the save file, and saving the scenario into the scenario folder.&lt;br /&gt;
&lt;br /&gt;
== Modding tools ==&lt;br /&gt;
A list of the internal names of most things in the vanilla game can also be found on [[data.raw]].&lt;br /&gt;
&lt;br /&gt;
=== Print to console which tile are you have under the player position ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.surface.get_tile(game.player.position.x, game.player.position.y).name)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all researched technologies to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	if tech.researched then&lt;br /&gt;
    list[#list+1] = tech.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;techs.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all enabled recipes to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, recipe in pairs(game.player.force.recipes) do &lt;br /&gt;
	if recipe.enabled then&lt;br /&gt;
    list[#list+1] = recipe.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;recipes.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=159274</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=159274"/>
		<updated>2018-05-16T19:14:21Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Add items to the player&amp;#039;s inventory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Overview ==&lt;br /&gt;
The &#039;&#039;&#039;Console&#039;&#039;&#039; is Factorio&#039;s command-line interface.&lt;br /&gt;
&lt;br /&gt;
The in-game console is used for:&lt;br /&gt;
&lt;br /&gt;
* Chatting with other players&lt;br /&gt;
* Running commands / scripts / cheats&lt;br /&gt;
* Occasional status updates&lt;br /&gt;
&lt;br /&gt;
There are three types of commands:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[#Normal commands|Normal]]&#039;&#039;&#039; - Display information about the game and customize your experience.&lt;br /&gt;
* &#039;&#039;&#039;[[#Multiplayer commands|Multiplayer]]&#039;&#039;&#039; - Message filtering, banning users, etc.&lt;br /&gt;
* &#039;&#039;&#039;[[#Scripting and cheat commands|Scripting/Cheating]]&#039;&#039;&#039; - Run small Lua scripts (but they &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;disable achievements for the save game&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== Using the console ===&lt;br /&gt;
The console display can be toggled with the {{keybinding|/}} (slash) or {{keybinding|~}} (tilde) keys.&lt;br /&gt;
&lt;br /&gt;
You can customize the keys via &#039;&#039;&#039;Options Menu → Keyboard → Toggle Lua console&#039;&#039;&#039;.&lt;br /&gt;
When the console is open, you&#039;ll see a blinking cursor at the bottom of the screen; type your message or command and hit &#039;&#039;&#039;Return&#039;&#039;&#039; to send it (this will also close the console).&lt;br /&gt;
Documentation about message and command prefixes can be found further down this page.&lt;br /&gt;
&lt;br /&gt;
When console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages).&lt;br /&gt;
Note that by default, all executed commands are made visible to all users. You can set the fade out time via &#039;&#039;&#039;Options Menu → Other Settings → Message Delay&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you want to immediately hide the console, open the console and then press &#039;&#039;&#039;Escape&#039;&#039;&#039; key (or press &#039;&#039;&#039;Return&#039;&#039;&#039; without entering any message/command).&lt;br /&gt;
This not only closes the console, but it also hides all the recent messages/commands.&lt;br /&gt;
The console can be cleared with the &#039;&#039;&#039;/clear&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Note that the console can also accept raw Lua code as well as game commands.&lt;br /&gt;
&lt;br /&gt;
=== Console history ===&lt;br /&gt;
&lt;br /&gt;
The console has an inbuilt history; it&#039;s a bit like a text editor where only one line of text is displayed at a time.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;uarr;}} and {{keybinding|&amp;amp;darr;}} keys to scroll through the console history.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;larr;}} and {{keybinding|&amp;amp;rarr;}} keys to cursor through the currently displayed message or command, which you can edit (delete, insert, etc.) and resend (by pressing &#039;&#039;&#039;Return&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
The {{keybinding|Tab}} key will auto-complete commands and player ids.&lt;br /&gt;
&lt;br /&gt;
== Normal commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| /alerts &amp;lt;enable/disable/mute/unmute&amp;gt; &amp;lt;alert&amp;gt;&lt;br /&gt;
| /alerts disable turret_fire&lt;br /&gt;
| Enables, disables, mutes, or unmutes the given alert type. Available alerts: entity_destroyed, entity_under_attack, not_enough_construction_robots, no_material_for_construction, not_enough_repair packs, turret_fire, custom, no_storage.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /clear&lt;br /&gt;
| /clear&lt;br /&gt;
| Clears the console.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /color &amp;lt;color&amp;gt;&lt;br /&gt;
| /color 20 255 255 100&lt;br /&gt;
| Changes your color. Can either be one of the pre-defined colors or [[:Wikipedia:RGBA_color_space|RGBA value]] in the format of “# # # #”. Available colors: default, red, green, blue, orange, yellow, pink, purple, white, black, gray, brown, cyan, acid.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /evolution&lt;br /&gt;
| /evolution&lt;br /&gt;
| Prints info about the alien evolution factor.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /help [command]&lt;br /&gt;
| /help&lt;br /&gt;
| Prints a list of available commands, the optional argument can specify the command that should be described.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /h [command]&lt;br /&gt;
| /h&lt;br /&gt;
| Same as /help.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /mute-programmable-speaker &amp;lt;mute/unmute&amp;gt; &amp;lt;local/everyone&amp;gt;&lt;br /&gt;
| /mute-programmable-speaker mute local&lt;br /&gt;
| Mutes or unmutes the global sounds created by the Programmable Speaker. Use “local” to mute just the local client. Admins can use “everyone” to mute the sounds for everyone on the server.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /perf-avg-frames &amp;lt;number&amp;gt;&lt;br /&gt;
| /perf-avg-frames 100&lt;br /&gt;
| Number of ticks/updates used to average performance counters. Default is 100. Value of 5-10 is recommended for fast convergence, but numbers will jitter more rapidly.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /permissions&lt;br /&gt;
| /permissions&lt;br /&gt;
| Opens the permissions GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /screenshot [x resolution] [y resolution] [zoom]&lt;br /&gt;
| /screenshot&lt;br /&gt;
| Takes a screenshot with the GUI hidden, centered on the player. It is saved in the &amp;quot;script-output&amp;quot; subfolder of your [[User data directory]].  Resolution is optional and defaults to the current window size. Zoom is optional and defaults to 1.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /seed&lt;br /&gt;
| /seed&lt;br /&gt;
| Prints the starting map seed.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /time&lt;br /&gt;
| /time&lt;br /&gt;
| Prints info about how old the map is.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| Toggles logging all input actions performed by the game. This value isn’t persisted between game restarts and only affects your local game in multiplayer sessions.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| Used to investigate desyncs. Will slow down the game and make multiplayer unplayable.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| Toggles if the rockets sent button is shown in the upper left corner of the screen.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /version&lt;br /&gt;
| /version&lt;br /&gt;
| Prints the current game version.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Multiplayer commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;message&amp;gt;&lt;br /&gt;
| Hello team!&lt;br /&gt;
| Console input that does not start with {{keybinding|/}} is shown as a chat message to your team.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /admins&lt;br /&gt;
| /admins&lt;br /&gt;
| Prints a list of game admins.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ban &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /ban xTROLLx Throwing grenades in base&lt;br /&gt;
| Bans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /banlist &amp;lt;add/remove/get/clear&amp;gt; &amp;lt;player&amp;gt;&lt;br /&gt;
| /banlist get&lt;br /&gt;
| Adds or removes a player from the banlist. Same as /ban or /unban.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /config &amp;lt;get/set&amp;gt; &amp;lt;option&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
| /config set password hunter2&lt;br /&gt;
| Gets or sets various multiplayer game settings. Available configs are: afk-auto-kick, allow-commands, allow-debug-settings, autosave-interval, autosave-only-on-server, ignore-player-limit-for-returning-players, max-players, max-upload-speed, only-admins-can-pause, password, require-user-verification, visibility-lan, visibility-public.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /delete-blueprint-library &amp;lt;player&amp;gt;&lt;br /&gt;
| /delete-blueprint-library everybody confirm&lt;br /&gt;
| Deletes the blueprint library storage for the given offline player from the save file. Enter “everybody confirm” to delete the storage of all offline players.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /demote &amp;lt;player&amp;gt;&lt;br /&gt;
| /demote AzureDiamond&lt;br /&gt;
| Demotes the player from admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /ignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /ignore Cthon98&lt;br /&gt;
| Prevents the chat from showing messages from this player. Admin messages are still shown.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ignores&lt;br /&gt;
| /ignores&lt;br /&gt;
| Prints a list of ignored players.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /kick &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /kick xTROLLx Throwing grenades in base&lt;br /&gt;
| Kicks the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mute &amp;lt;player&amp;gt;&lt;br /&gt;
| /mute Cthon98&lt;br /&gt;
| Prevents the player from saying anything in chat.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mutes&lt;br /&gt;
| /mutes&lt;br /&gt;
| All players that are muted (can’t talk in chat).&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /open &amp;lt;player&amp;gt;&lt;br /&gt;
| /open AzureDiamond&lt;br /&gt;
| Opens another player’s inventory.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /o &amp;lt;player&amp;gt;&lt;br /&gt;
| /o AzureDiamond&lt;br /&gt;
| Same as /open.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /players [online/o/count/c]&lt;br /&gt;
| /players&lt;br /&gt;
| Prints a list of players in the game. (parameter online/o, it prints only players that are online, count/c prints only count)&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /promote &amp;lt;player&amp;gt;&lt;br /&gt;
| /promote AzureDiamond&lt;br /&gt;
| Promotes the player to admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /purge &amp;lt;player&amp;gt;&lt;br /&gt;
| /purge Cthon98&lt;br /&gt;
| Clears all the messages from this player from the chat log.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /reply &amp;lt;message&amp;gt;&lt;br /&gt;
| /reply oh, really?&lt;br /&gt;
| Replies to the last player that whispered to you.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /r &amp;lt;message&amp;gt;&lt;br /&gt;
| /r oh, really?&lt;br /&gt;
| Same as /reply.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /server-save&lt;br /&gt;
| /server-save&lt;br /&gt;
| Saves the game on the server in a multiplayer game.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /shout &amp;lt;message&amp;gt;&lt;br /&gt;
| /shout Hello world!&lt;br /&gt;
| Sends a message to all players including other forces.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /s &amp;lt;message&amp;gt;&lt;br /&gt;
| /s Hello world!&lt;br /&gt;
| Same as /shout.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /swap-players &amp;lt;player&amp;gt; [player]&lt;br /&gt;
| /swap-players AzureDiamond&lt;br /&gt;
| Swaps your character with the given player’s character, or if two players are given swaps the two player characters.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unban &amp;lt;player&amp;gt;&lt;br /&gt;
| /unban xTROLLx&lt;br /&gt;
| Unbans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /unignore Cthon98&lt;br /&gt;
| Allows the chat to show messages from this player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unmute &amp;lt;player&amp;gt;&lt;br /&gt;
| /unmute Cthon98&lt;br /&gt;
| Allows the player to talk in chat again.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /whisper &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /whisper AzureDiamond thats what I see&lt;br /&gt;
| Sends a message to the specified player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /w &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /w AzureDiamond thats what I see&lt;br /&gt;
| Same as /whisper.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /whitelist &amp;lt;add/remove/get/clear&amp;gt; [player]&lt;br /&gt;
| /whitelist get&lt;br /&gt;
| Adds or removes a player from the whitelist, where only whitelisted players can join the game. Enter nothing for “player” when using “get” to print a list of all whitelisted players. An empty whitelist disables the whitelist functionality allowing anyone to join.&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scripting and cheat commands ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| /c &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /measured-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command and measures time it took.&lt;br /&gt;
|-&lt;br /&gt;
| /silent-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command without printing it to the console.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a very powerful feature, which also allows cheating, and as such &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;achievements will be permanently disabled for the save&amp;lt;/span&amp;gt; as soon as you use a script command.&lt;br /&gt;
&lt;br /&gt;
== Basic example scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Use it as calculator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(1234*5678)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mine faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Craft faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unlock and Research all Technology ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_all_technologies()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Undo this with the command in the next section.&lt;br /&gt;
&lt;br /&gt;
=== Unresearch all technologies ===&lt;br /&gt;
This does not reset manually applied bonuses&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	tech.researched=false&lt;br /&gt;
	game.player.force.set_saved_technology_progress(tech, 0)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Reset your force ===&lt;br /&gt;
This resets all data for your force, including kill and production statistics, technologies, bonuses and charting status.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.reset()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zoom beyond normal bounds ===&lt;br /&gt;
Note that zooming too far out can cause performance hits. Be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.zoom=0.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inventory manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource tile in-game&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.amount=7500&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add items to the player&#039;s inventory ===&lt;br /&gt;
Replace iron-plate with the [[data.raw|internal name]] of the item desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For instance, here&#039;s a god-mode energy system interface:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;electric-energy-interface&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a powerful armor with equipment:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c	local player = game.player&lt;br /&gt;
player.insert{name=&amp;quot;power-armor-mk2&amp;quot;, count = 1}&lt;br /&gt;
local p_armor = player.get_inventory(5)[1].grid&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;personal-roboport-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;night-vision-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a construction robots to inventory:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;construction-robot&amp;quot;, count = 25}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Cheat mode ===&lt;br /&gt;
Allows for infinite free crafting. Disable by replacing true with false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.cheat_mode=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== World manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Reveal the map around the player ===&lt;br /&gt;
&lt;br /&gt;
Reveals the map around the player, similar to a [[radar]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or from start position&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces.player.chart(game.player.surface, {{x = -2000, y = -2000}, {x = 2000, y = 2000}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change 150 to the desired radius, higher values take longer.&lt;br /&gt;
&lt;br /&gt;
If much of the map is revealed, it increases the size of the save file. The following command cancels the generation of all chunks that are currently queued for generation and removes chunks outside a 32 chunks radius around 0,0. Note that this will remove player entities if there are any on these chunks.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface;&lt;br /&gt;
game.player.force.cancel_charting(surface); &lt;br /&gt;
local chunk_radius = 32;&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  if (chunk.x &amp;lt; -chunk_radius or chunk.x &amp;gt; chunk_radius or chunk.y &amp;lt; -chunk_radius or chunk.y &amp;gt; chunk_radius) then&lt;br /&gt;
    surface.delete_chunk(chunk)&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
Enables eternal day.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.always_day=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change game speed ===&lt;br /&gt;
0.5 is half speed, 1 is default, 2 is double speed, etc. Minimum is 0.01. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.speed=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expensive (marathon) or normal mode ===&lt;br /&gt;
To change from normal to expensive mode preset (this changes the research cost and intermediate product cost):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change back to normal:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Freeze Time Passage ===&lt;br /&gt;
Stops the advancement of the time if you replace &amp;quot;BOOL&amp;quot; with &amp;quot;true&amp;quot; or unfreezes it if you replace it with &amp;quot;false&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.freeze_daytime=BOOL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.clear_pollution()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add a lot of pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.pollute(game.player.position, 1000000)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable friendly fire for your force ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.friendly_fire = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 11×11 patch of resources, centered on the player character, where the ground is not water.&lt;br /&gt;
The patch it creates is perfectly square but it randomizes the amount similar to natural generation, with fewer ore at the edges and more ore in the center.&lt;br /&gt;
The default numbers result in a patch with 2500-3000 ore.&lt;br /&gt;
&lt;br /&gt;
If you want a larger patch, change &amp;quot;local size = 5&amp;quot; to a larger number.&lt;br /&gt;
A larger patch will have exponentially more ore.&lt;br /&gt;
Entering a number above 30 is not recommended.&lt;br /&gt;
&lt;br /&gt;
If you want a richer patch, change &amp;quot;local density = 10&amp;quot; to a larger number.&lt;br /&gt;
Entering a very large number shouldn&#039;t hurt anything but you probably don&#039;t need to go above 100.&lt;br /&gt;
&lt;br /&gt;
To choose which resource is spawned, change &amp;quot;stone&amp;quot; near the bottom to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, &amp;quot;coal&amp;quot;, or &amp;quot;uranium-ore&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local ore=nil&lt;br /&gt;
local size=5&lt;br /&gt;
local density=10&lt;br /&gt;
for y=-size, size do&lt;br /&gt;
	for x=-size, size do&lt;br /&gt;
		a=(size+1-math.abs(x))*10&lt;br /&gt;
		b=(size+1-math.abs(y))*10&lt;br /&gt;
		if a&amp;lt;b then&lt;br /&gt;
			ore=math.random(a*density-a*(density-8), a*density+a*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if b&amp;lt;a then&lt;br /&gt;
			ore=math.random(b*density-b*(density-8), b*density+b*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if surface.get_tile(game.player.position.x+x, game.player.position.y+y).collides_with(&amp;quot;ground-tile&amp;quot;) then&lt;br /&gt;
			surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=ore, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches in a 3×3 square.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for y=0,2 do&lt;br /&gt;
	for x=0,2 do&lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or randomly without any collision:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local position=nil&lt;br /&gt;
for i=1,9 do&lt;br /&gt;
	position=game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
	if position then &lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position=position})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Count entities ===&lt;br /&gt;
Counts all entities whose name includes the string in local entity.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local entity=&amp;quot;belt&amp;quot;&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local count=0&lt;br /&gt;
for key, ent in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(ent.name,entity) then&lt;br /&gt;
		count=count+1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(count)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emptying all pipes, underground pipes and pumps ===&lt;br /&gt;
Useful when pipes contain a fluid you dont want.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local deleted=0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(entity.name, &amp;quot;pipe&amp;quot;) or &lt;br /&gt;
		string.find(entity.name, &amp;quot;pump&amp;quot;) &lt;br /&gt;
	then&lt;br /&gt;
		for i=1,#entity.fluidbox do&lt;br /&gt;
			deleted = deleted + 1&lt;br /&gt;
			entity.fluidbox[i] = nil;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(&amp;quot;Fluids removed from &amp;quot;..deleted ..&amp;quot; entities&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enemy/evolution scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Set evolution factor ===&lt;br /&gt;
Ranges from 0 (new game) to 1.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].evolution_factor=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_evolution.time_factor=0&lt;br /&gt;
/c game.map_settings.enemy_evolution.pollution_factor=game.map_settings.enemy_evolution.pollution_factor*2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;2&amp;quot; at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.&lt;br /&gt;
&lt;br /&gt;
=== Kill all biters on the &amp;quot;enemy&amp;quot; force ===&lt;br /&gt;
Note that this will kill only mobile units and worms, spawners will not be killed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all enemies ===&lt;br /&gt;
This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the explored world, so any unexplored parts of the map which still need to be generated will still have enemies.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable peaceful mode ===&lt;br /&gt;
Enabling peaceful mode prevents biter attacks until provoked. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.peaceful_mode = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable biter expansion ===&lt;br /&gt;
Biter expansion allows biters to create new nests, it is enabled by default. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_expansion.enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Player character scripts ==&lt;br /&gt;
Commands concerning the player directly.&lt;br /&gt;
=== Get Player Position ===&lt;br /&gt;
Prints coordinates of your current position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.position.x .. &amp;quot;, &amp;quot; .. game.player.position.y)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Teleport player ===&lt;br /&gt;
Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.teleport({X, Y})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To teleport to the world&#039;s origin, use 0,0.&lt;br /&gt;
&lt;br /&gt;
=== Enable god mode ===&lt;br /&gt;
God mode removes your player character allowing you to fly over obstacles and take no damage.&lt;br /&gt;
&lt;br /&gt;
Disassociate your controls from the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.character=nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, hover the mouse over the useless player and destroy it by typing:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.destroy()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To undo, spawn a player character. This will spawn a new player at the spawn point of the world, and connect your controls to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.create_character()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.laboratory_speed_modifier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
1 is normal speed, 2 is double speed 3 is triple etc. I think it goes up to 100.&lt;br /&gt;
&lt;br /&gt;
=== Researching specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages, click on the little arrow to show them.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=true&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unresearching specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages, click on the little arrow to show them.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;electric-energy-distribution-1&#039;, 0)&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;steel-processing&#039;, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling specific recipes ===&lt;br /&gt;
The internal recipe/item names can be found in the infoboxes on their respective pages, click on the little arrow to show them.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;electric-energy-interface&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;rocket-silo&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes.loader.enabled=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable all recipes&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name, recipe in pairs(game.player.force.recipes) do recipe.enabled = true end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finish research immediately ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name,technology in pairs(game.player.force.technologies) do technology.researched=technology.enabled end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command Line Parameters ==&lt;br /&gt;
&#039;&#039;&#039;As of Game Version 0.15.13&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Command line parameters can be used to set settings in the command line before the game launches, this is useful mainly for advanced users or server hosts.&lt;br /&gt;
&lt;br /&gt;
General options:&lt;br /&gt;
  -h [ --help ]                      display help&lt;br /&gt;
  --version                          show version information&lt;br /&gt;
  -v [ --verbose ]                   enable verbose logging&lt;br /&gt;
  -c [ --config ] PATH               config file to use&lt;br /&gt;
  --no-log-rotation                  don&#039;t rotate log file&lt;br /&gt;
  --mod-directory PATH               Mod directory to use&lt;br /&gt;
  --check-unused-prototype-data      Print a warning for all prototype values that were not accessed&lt;br /&gt;
&lt;br /&gt;
Running options:&lt;br /&gt;
  -s [ --map2scenario ] arg          map to scenario conversion&lt;br /&gt;
  -m [ --scenario2map ] arg          scenario to map conversion&lt;br /&gt;
  --apply-update arg                 immediately apply update package&lt;br /&gt;
  --create FILE                      create a new map&lt;br /&gt;
  --map-gen-settings FILE            Map generation settings for use with --create. See data/map-gen-settings.example.json&lt;br /&gt;
  --map-settings FILE                Map settings for use with --create. See data/base/prototypes/map-settings.lua&lt;br /&gt;
  --preset arg                       Name of the map generation preset to be used.&lt;br /&gt;
  --generate-map-preview FILE        Generate preview images of the map&lt;br /&gt;
  --map-preview-size SCALE (=1,024)  Size (in pixels) of map preview&lt;br /&gt;
  --map-preview-scale SCALE (=1)     Scale (meters per pixel) of map preview&lt;br /&gt;
  --map-preview-offset X,Y (=0,0)    Offset of the center of the map, in meters&lt;br /&gt;
  --start-server FILE                start a multiplayer server&lt;br /&gt;
  --start-server-load-scenario FILE  start a multiplayer server and load the specified scenario&lt;br /&gt;
  --start-server-load-latest         start a multiplayer server and load the latest available save&lt;br /&gt;
  --until-tick TICK                  run a save until given map tick&lt;br /&gt;
  --mp-connect ADDRESS               start factorio and connect to address&lt;br /&gt;
  --load-game FILE                   start Factorio and load a game in singleplayer&lt;br /&gt;
  --benchmark FILE                   load save and run benchmark&lt;br /&gt;
  --benchmark-ticks N (=1,000)       number of ticks for benchmarking. Default is 1000&lt;br /&gt;
  --force-opengl                     use OpenGL for rendering&lt;br /&gt;
  --force-d3d                        use Direct3D for rendering&lt;br /&gt;
  --fullscreen BOOL                  start game in windowed mode (saved to configuration)&lt;br /&gt;
  --max-texture-size N               maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048&lt;br /&gt;
  --graphics-quality arg             accepted values: normal, low, very-low&lt;br /&gt;
  --video-memory-usage arg           accepted values: all, high, medium, low&lt;br /&gt;
  --gfx-safe-mode                    resets some graphics settings to values that should work on most configurations&lt;br /&gt;
  --shader arg                       enable/disable shader postprocessing (saved to configuration)&lt;br /&gt;
  --disable-audio                    Disable audio. Mainly for faster startup during development.&lt;br /&gt;
&lt;br /&gt;
Server options:&lt;br /&gt;
  --port N                           network port to use&lt;br /&gt;
  --bind ADDRESS[:PORT]              IP address (and optionally port) to bind to&lt;br /&gt;
  --rcon-port N                      Port to use for RCON&lt;br /&gt;
  --rcon-password PASSWORD           Password for RCON&lt;br /&gt;
  --server-settings FILE             Path to file with server settings. See data/server-settings.example.json&lt;br /&gt;
  --server-whitelist FILE            Path to file with server whitelist.&lt;br /&gt;
  --server-banlist FILE              Path to file with server banlist.&lt;br /&gt;
  --console-log FILE                 Path to file where a copy of the server&#039;s log will be stored&lt;br /&gt;
  --server-id FILE                   Path where server ID will be stored or read from&lt;br /&gt;
&lt;br /&gt;
=== Multiplayer ===&lt;br /&gt;
&lt;br /&gt;
  --start-server SAVE&lt;br /&gt;
&lt;br /&gt;
Will start a Headless (Dedicated) server, with no GUI.&lt;br /&gt;
&lt;br /&gt;
  --mp-connect ADDRESS&lt;br /&gt;
ADDRESS is the IP:port of the remote host. Port is optional.&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101:2345&lt;br /&gt;
&lt;br /&gt;
As above, port can be specified by placing the port number after a colon in the address.&lt;br /&gt;
&lt;br /&gt;
  --map2scenario SAVE&lt;br /&gt;
Converts a save game to a User Scenario, allows saved game state to be loaded into map editor.&lt;br /&gt;
Assuming that save game name is &amp;quot;foo.zip&amp;quot;, executing &#039;./factorio --map2scenario s1&#039; will result in Factorio loading, opening the save file, and saving the scenario into the scenario folder.&lt;br /&gt;
&lt;br /&gt;
== Modding tools ==&lt;br /&gt;
A list of the internal names of most things in the vanilla game can also be found on [[data.raw]].&lt;br /&gt;
=== Write all researched technologies to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	if tech.researched then&lt;br /&gt;
    list[#list+1] = tech.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;techs.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all enabled recipes to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, recipe in pairs(game.player.force.recipes) do &lt;br /&gt;
	if recipe.enabled then&lt;br /&gt;
    list[#list+1] = recipe.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;recipes.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=159273</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=159273"/>
		<updated>2018-05-16T19:13:42Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Add items to the player&amp;#039;s inventory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
== Overview ==&lt;br /&gt;
The &#039;&#039;&#039;Console&#039;&#039;&#039; is Factorio&#039;s command-line interface.&lt;br /&gt;
&lt;br /&gt;
The in-game console is used for:&lt;br /&gt;
&lt;br /&gt;
* Chatting with other players&lt;br /&gt;
* Running commands / scripts / cheats&lt;br /&gt;
* Occasional status updates&lt;br /&gt;
&lt;br /&gt;
There are three types of commands:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[#Normal commands|Normal]]&#039;&#039;&#039; - Display information about the game and customize your experience.&lt;br /&gt;
* &#039;&#039;&#039;[[#Multiplayer commands|Multiplayer]]&#039;&#039;&#039; - Message filtering, banning users, etc.&lt;br /&gt;
* &#039;&#039;&#039;[[#Scripting and cheat commands|Scripting/Cheating]]&#039;&#039;&#039; - Run small Lua scripts (but they &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;disable achievements for the save game&amp;lt;/span&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
=== Using the console ===&lt;br /&gt;
The console display can be toggled with the {{keybinding|/}} (slash) or {{keybinding|~}} (tilde) keys.&lt;br /&gt;
&lt;br /&gt;
You can customize the keys via &#039;&#039;&#039;Options Menu → Keyboard → Toggle Lua console&#039;&#039;&#039;.&lt;br /&gt;
When the console is open, you&#039;ll see a blinking cursor at the bottom of the screen; type your message or command and hit &#039;&#039;&#039;Return&#039;&#039;&#039; to send it (this will also close the console).&lt;br /&gt;
Documentation about message and command prefixes can be found further down this page.&lt;br /&gt;
&lt;br /&gt;
When console is closed, only the most recent messages/commands will be displayed, but they will gradually fade away (opening the console will immediately re-display all recent messages).&lt;br /&gt;
Note that by default, all executed commands are made visible to all users. You can set the fade out time via &#039;&#039;&#039;Options Menu → Other Settings → Message Delay&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you want to immediately hide the console, open the console and then press &#039;&#039;&#039;Escape&#039;&#039;&#039; key (or press &#039;&#039;&#039;Return&#039;&#039;&#039; without entering any message/command).&lt;br /&gt;
This not only closes the console, but it also hides all the recent messages/commands.&lt;br /&gt;
The console can be cleared with the &#039;&#039;&#039;/clear&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
Note that the console can also accept raw Lua code as well as game commands.&lt;br /&gt;
&lt;br /&gt;
=== Console history ===&lt;br /&gt;
&lt;br /&gt;
The console has an inbuilt history; it&#039;s a bit like a text editor where only one line of text is displayed at a time.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;uarr;}} and {{keybinding|&amp;amp;darr;}} keys to scroll through the console history.&lt;br /&gt;
&lt;br /&gt;
Use the {{keybinding|&amp;amp;larr;}} and {{keybinding|&amp;amp;rarr;}} keys to cursor through the currently displayed message or command, which you can edit (delete, insert, etc.) and resend (by pressing &#039;&#039;&#039;Return&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
The {{keybinding|Tab}} key will auto-complete commands and player ids.&lt;br /&gt;
&lt;br /&gt;
== Normal commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| /alerts &amp;lt;enable/disable/mute/unmute&amp;gt; &amp;lt;alert&amp;gt;&lt;br /&gt;
| /alerts disable turret_fire&lt;br /&gt;
| Enables, disables, mutes, or unmutes the given alert type. Available alerts: entity_destroyed, entity_under_attack, not_enough_construction_robots, no_material_for_construction, not_enough_repair packs, turret_fire, custom, no_storage.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /clear&lt;br /&gt;
| /clear&lt;br /&gt;
| Clears the console.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /color &amp;lt;color&amp;gt;&lt;br /&gt;
| /color 20 255 255 100&lt;br /&gt;
| Changes your color. Can either be one of the pre-defined colors or [[:Wikipedia:RGBA_color_space|RGBA value]] in the format of “# # # #”. Available colors: default, red, green, blue, orange, yellow, pink, purple, white, black, gray, brown, cyan, acid.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /evolution&lt;br /&gt;
| /evolution&lt;br /&gt;
| Prints info about the alien evolution factor.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /help [command]&lt;br /&gt;
| /help&lt;br /&gt;
| Prints a list of available commands, the optional argument can specify the command that should be described.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /h [command]&lt;br /&gt;
| /h&lt;br /&gt;
| Same as /help.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /mute-programmable-speaker &amp;lt;mute/unmute&amp;gt; &amp;lt;local/everyone&amp;gt;&lt;br /&gt;
| /mute-programmable-speaker mute local&lt;br /&gt;
| Mutes or unmutes the global sounds created by the Programmable Speaker. Use “local” to mute just the local client. Admins can use “everyone” to mute the sounds for everyone on the server.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /perf-avg-frames &amp;lt;number&amp;gt;&lt;br /&gt;
| /perf-avg-frames 100&lt;br /&gt;
| Number of ticks/updates used to average performance counters. Default is 100. Value of 5-10 is recommended for fast convergence, but numbers will jitter more rapidly.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /permissions&lt;br /&gt;
| /permissions&lt;br /&gt;
| Opens the permissions GUI.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /screenshot [x resolution] [y resolution] [zoom]&lt;br /&gt;
| /screenshot&lt;br /&gt;
| Takes a screenshot with the GUI hidden, centered on the player. It is saved in the &amp;quot;script-output&amp;quot; subfolder of your [[User data directory]].  Resolution is optional and defaults to the current window size. Zoom is optional and defaults to 1.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /seed&lt;br /&gt;
| /seed&lt;br /&gt;
| Prints the starting map seed.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /time&lt;br /&gt;
| /time&lt;br /&gt;
| Prints info about how old the map is.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| /toggle-action-logging&lt;br /&gt;
| Toggles logging all input actions performed by the game. This value isn’t persisted between game restarts and only affects your local game in multiplayer sessions.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| /toggle-heavy-mode&lt;br /&gt;
| Used to investigate desyncs. Will slow down the game and make multiplayer unplayable.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| /toggle-rockets-sent-gui&lt;br /&gt;
| Toggles if the rockets sent button is shown in the upper left corner of the screen.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /version&lt;br /&gt;
| /version&lt;br /&gt;
| Prints the current game version.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Multiplayer commands ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Command&lt;br /&gt;
! style=&amp;quot;width:25%&amp;quot;| Example&lt;br /&gt;
! style=&amp;quot;width:46%&amp;quot;| Description&lt;br /&gt;
! style=&amp;quot;width:4%&amp;quot;| Admin only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;message&amp;gt;&lt;br /&gt;
| Hello team!&lt;br /&gt;
| Console input that does not start with {{keybinding|/}} is shown as a chat message to your team.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /admins&lt;br /&gt;
| /admins&lt;br /&gt;
| Prints a list of game admins.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ban &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /ban xTROLLx Throwing grenades in base&lt;br /&gt;
| Bans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /banlist &amp;lt;add/remove/get/clear&amp;gt; &amp;lt;player&amp;gt;&lt;br /&gt;
| /banlist get&lt;br /&gt;
| Adds or removes a player from the banlist. Same as /ban or /unban.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /config &amp;lt;get/set&amp;gt; &amp;lt;option&amp;gt; &amp;lt;value&amp;gt;&lt;br /&gt;
| /config set password hunter2&lt;br /&gt;
| Gets or sets various multiplayer game settings. Available configs are: afk-auto-kick, allow-commands, allow-debug-settings, autosave-interval, autosave-only-on-server, ignore-player-limit-for-returning-players, max-players, max-upload-speed, only-admins-can-pause, password, require-user-verification, visibility-lan, visibility-public.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /delete-blueprint-library &amp;lt;player&amp;gt;&lt;br /&gt;
| /delete-blueprint-library everybody confirm&lt;br /&gt;
| Deletes the blueprint library storage for the given offline player from the save file. Enter “everybody confirm” to delete the storage of all offline players.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /demote &amp;lt;player&amp;gt;&lt;br /&gt;
| /demote AzureDiamond&lt;br /&gt;
| Demotes the player from admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /ignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /ignore Cthon98&lt;br /&gt;
| Prevents the chat from showing messages from this player. Admin messages are still shown.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /ignores&lt;br /&gt;
| /ignores&lt;br /&gt;
| Prints a list of ignored players.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /kick &amp;lt;player&amp;gt; &amp;lt;reason&amp;gt;&lt;br /&gt;
| /kick xTROLLx Throwing grenades in base&lt;br /&gt;
| Kicks the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mute &amp;lt;player&amp;gt;&lt;br /&gt;
| /mute Cthon98&lt;br /&gt;
| Prevents the player from saying anything in chat.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /mutes&lt;br /&gt;
| /mutes&lt;br /&gt;
| All players that are muted (can’t talk in chat).&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /open &amp;lt;player&amp;gt;&lt;br /&gt;
| /open AzureDiamond&lt;br /&gt;
| Opens another player’s inventory.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /o &amp;lt;player&amp;gt;&lt;br /&gt;
| /o AzureDiamond&lt;br /&gt;
| Same as /open.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /players [online/o/count/c]&lt;br /&gt;
| /players&lt;br /&gt;
| Prints a list of players in the game. (parameter online/o, it prints only players that are online, count/c prints only count)&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /promote &amp;lt;player&amp;gt;&lt;br /&gt;
| /promote AzureDiamond&lt;br /&gt;
| Promotes the player to admin.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /purge &amp;lt;player&amp;gt;&lt;br /&gt;
| /purge Cthon98&lt;br /&gt;
| Clears all the messages from this player from the chat log.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /reply &amp;lt;message&amp;gt;&lt;br /&gt;
| /reply oh, really?&lt;br /&gt;
| Replies to the last player that whispered to you.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /r &amp;lt;message&amp;gt;&lt;br /&gt;
| /r oh, really?&lt;br /&gt;
| Same as /reply.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /server-save&lt;br /&gt;
| /server-save&lt;br /&gt;
| Saves the game on the server in a multiplayer game.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /shout &amp;lt;message&amp;gt;&lt;br /&gt;
| /shout Hello world!&lt;br /&gt;
| Sends a message to all players including other forces.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /s &amp;lt;message&amp;gt;&lt;br /&gt;
| /s Hello world!&lt;br /&gt;
| Same as /shout.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /swap-players &amp;lt;player&amp;gt; [player]&lt;br /&gt;
| /swap-players AzureDiamond&lt;br /&gt;
| Swaps your character with the given player’s character, or if two players are given swaps the two player characters.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unban &amp;lt;player&amp;gt;&lt;br /&gt;
| /unban xTROLLx&lt;br /&gt;
| Unbans the specified player.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /unignore &amp;lt;player&amp;gt;&lt;br /&gt;
| /unignore Cthon98&lt;br /&gt;
| Allows the chat to show messages from this player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /unmute &amp;lt;player&amp;gt;&lt;br /&gt;
| /unmute Cthon98&lt;br /&gt;
| Allows the player to talk in chat again.&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| /whisper &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /whisper AzureDiamond thats what I see&lt;br /&gt;
| Sends a message to the specified player.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /w &amp;lt;player&amp;gt; &amp;lt;message&amp;gt;&lt;br /&gt;
| /w AzureDiamond thats what I see&lt;br /&gt;
| Same as /whisper.&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| /whitelist &amp;lt;add/remove/get/clear&amp;gt; [player]&lt;br /&gt;
| /whitelist get&lt;br /&gt;
| Adds or removes a player from the whitelist, where only whitelisted players can join the game. Enter nothing for “player” when using “get” to print a list of all whitelisted players. An empty whitelist disables the whitelist functionality allowing anyone to join.&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Scripting and cheat commands ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Command&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| /c &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command.&lt;br /&gt;
|-&lt;br /&gt;
| /measured-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command and measures time it took.&lt;br /&gt;
|-&lt;br /&gt;
| /silent-command &amp;lt;command&amp;gt;&lt;br /&gt;
| Executes a Lua command without printing it to the console.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This is a very powerful feature, which also allows cheating, and as such &amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;achievements will be permanently disabled for the save&amp;lt;/span&amp;gt; as soon as you use a script command.&lt;br /&gt;
&lt;br /&gt;
== Basic example scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Use it as calculator ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(1234*5678)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Mine faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Craft faster ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unlock and Research all Technology ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.research_all_technologies()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Undo this with the command in the next section.&lt;br /&gt;
&lt;br /&gt;
=== Unresearch all technologies ===&lt;br /&gt;
This does not reset manually applied bonuses&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	tech.researched=false&lt;br /&gt;
	game.player.force.set_saved_technology_progress(tech, 0)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Reset your force ===&lt;br /&gt;
This resets all data for your force, including kill and production statistics, technologies, bonuses and charting status.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.reset()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Zoom beyond normal bounds ===&lt;br /&gt;
Note that zooming too far out can cause performance hits. Be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.zoom=0.1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Inventory manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource tile in-game&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.amount=7500&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add items to the player&#039;s inventory ===&lt;br /&gt;
Replace iron-plate with the [[data.raw|internal name]] of the item desired.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For instance, here&#039;s a god-mode energy system interface:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.insert{name=&amp;quot;electric-energy-interface&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a powerful armor with equipment:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c	local player = game.player&lt;br /&gt;
player.insert{name=&amp;quot;power-armor-mk2&amp;quot;, count = 1}&lt;br /&gt;
local p_armor = player.get_inventory(5)[1].grid&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;fusion-reactor-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;exoskeleton-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;energy-shield-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;personal-roboport-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;night-vision-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
	p_armor.put({name = &amp;quot;battery-mk2-equipment&amp;quot;})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add a construction robots to inventory:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c player.insert{name=&amp;quot;construction-robot&amp;quot;, count = 25}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Cheat mode ===&lt;br /&gt;
Allows for infinite free crafting. Disable by replacing true with false.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.cheat_mode=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== World manipulation scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Reveal the map around the player ===&lt;br /&gt;
&lt;br /&gt;
Reveals the map around the player, similar to a [[radar]].&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local radius=150&lt;br /&gt;
game.player.force.chart(game.player.surface, {{game.player.position.x-radius, game.player.position.y-radius}, {game.player.position.x+radius, game.player.position.y+radius}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
or from start position&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces.player.chart(game.player.surface, {{x = -2000, y = -2000}, {x = 2000, y = 2000}})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Change 150 to the desired radius, higher values take longer.&lt;br /&gt;
&lt;br /&gt;
If much of the map is revealed, it increases the size of the save file. The following command cancels the generation of all chunks that are currently queued for generation and removes chunks outside a 32 chunks radius around 0,0. Note that this will remove player entities if there are any on these chunks.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface;&lt;br /&gt;
game.player.force.cancel_charting(surface); &lt;br /&gt;
local chunk_radius = 32;&lt;br /&gt;
for chunk in surface.get_chunks() do&lt;br /&gt;
  if (chunk.x &amp;lt; -chunk_radius or chunk.x &amp;gt; chunk_radius or chunk.y &amp;lt; -chunk_radius or chunk.y &amp;gt; chunk_radius) then&lt;br /&gt;
    surface.delete_chunk(chunk)&lt;br /&gt;
  end&lt;br /&gt;
end &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
Enables eternal day.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.always_day=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change game speed ===&lt;br /&gt;
0.5 is half speed, 1 is default, 2 is double speed, etc. Minimum is 0.01. This can be used for a lot of things like when you know you will have to wait for long periods of time for something to complete. Increasing will decrease performance, be careful.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.speed=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Expensive (marathon) or normal mode ===&lt;br /&gt;
To change from normal to expensive mode preset (this changes the research cost and intermediate product cost):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_difficulty=1&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=4&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change back to normal:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.difficulty_settings.recipe_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_difficulty=0&lt;br /&gt;
game.difficulty_settings.technology_price_multiplier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Freeze Time Passage ===&lt;br /&gt;
Stops the advancement of the time if you replace &amp;quot;BOOL&amp;quot; with &amp;quot;true&amp;quot; or unfreezes it if you replace it with &amp;quot;false&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.freeze_daytime=BOOL&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Remove all pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.clear_pollution()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add a lot of pollution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.pollute(game.player.position, 1000000)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable friendly fire for your force ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.friendly_fire = false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 11×11 patch of resources, centered on the player character, where the ground is not water.&lt;br /&gt;
The patch it creates is perfectly square but it randomizes the amount similar to natural generation, with fewer ore at the edges and more ore in the center.&lt;br /&gt;
The default numbers result in a patch with 2500-3000 ore.&lt;br /&gt;
&lt;br /&gt;
If you want a larger patch, change &amp;quot;local size = 5&amp;quot; to a larger number.&lt;br /&gt;
A larger patch will have exponentially more ore.&lt;br /&gt;
Entering a number above 30 is not recommended.&lt;br /&gt;
&lt;br /&gt;
If you want a richer patch, change &amp;quot;local density = 10&amp;quot; to a larger number.&lt;br /&gt;
Entering a very large number shouldn&#039;t hurt anything but you probably don&#039;t need to go above 100.&lt;br /&gt;
&lt;br /&gt;
To choose which resource is spawned, change &amp;quot;stone&amp;quot; near the bottom to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, &amp;quot;coal&amp;quot;, or &amp;quot;uranium-ore&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
local ore=nil&lt;br /&gt;
local size=5&lt;br /&gt;
local density=10&lt;br /&gt;
for y=-size, size do&lt;br /&gt;
	for x=-size, size do&lt;br /&gt;
		a=(size+1-math.abs(x))*10&lt;br /&gt;
		b=(size+1-math.abs(y))*10&lt;br /&gt;
		if a&amp;lt;b then&lt;br /&gt;
			ore=math.random(a*density-a*(density-8), a*density+a*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if b&amp;lt;a then&lt;br /&gt;
			ore=math.random(b*density-b*(density-8), b*density+b*(density-8))&lt;br /&gt;
		end&lt;br /&gt;
		if surface.get_tile(game.player.position.x+x, game.player.position.y+y).collides_with(&amp;quot;ground-tile&amp;quot;) then&lt;br /&gt;
			surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=ore, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add new oil patch ===&lt;br /&gt;
This creates 9 crude oil patches in a 3×3 square.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for y=0,2 do&lt;br /&gt;
	for x=0,2 do&lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position={game.player.position.x+x*7-7, game.player.position.y+y*7-7}})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or randomly without any collision:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local position=nil&lt;br /&gt;
for i=1,9 do&lt;br /&gt;
	position=game.player.surface.find_non_colliding_position(&amp;quot;crude-oil&amp;quot;, game.player.position, 0, i/2+1.5)&lt;br /&gt;
	if position then &lt;br /&gt;
		game.player.surface.create_entity({name=&amp;quot;crude-oil&amp;quot;, amount=5000, position=position})&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Count entities ===&lt;br /&gt;
Counts all entities whose name includes the string in local entity.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local entity=&amp;quot;belt&amp;quot;&lt;br /&gt;
local surface=game.player.surface&lt;br /&gt;
local count=0&lt;br /&gt;
for key, ent in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(ent.name,entity) then&lt;br /&gt;
		count=count+1&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(count)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Emptying all pipes, underground pipes and pumps ===&lt;br /&gt;
Useful when pipes contain a fluid you dont want.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface = game.player.surface&lt;br /&gt;
local deleted=0&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=game.player.force})) do&lt;br /&gt;
	if string.find(entity.name, &amp;quot;pipe&amp;quot;) or &lt;br /&gt;
		string.find(entity.name, &amp;quot;pump&amp;quot;) &lt;br /&gt;
	then&lt;br /&gt;
		for i=1,#entity.fluidbox do&lt;br /&gt;
			deleted = deleted + 1&lt;br /&gt;
			entity.fluidbox[i] = nil;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
game.player.print(&amp;quot;Fluids removed from &amp;quot;..deleted ..&amp;quot; entities&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enemy/evolution scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Set evolution factor ===&lt;br /&gt;
Ranges from 0 (new game) to 1.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].evolution_factor=X&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_evolution.time_factor=0&lt;br /&gt;
/c game.map_settings.enemy_evolution.pollution_factor=game.map_settings.enemy_evolution.pollution_factor*2&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;2&amp;quot; at the end of the last command will double the default pollution factor. You can substitute another number to increase (or decrease) the pollution factor further.&lt;br /&gt;
&lt;br /&gt;
=== Kill all biters on the &amp;quot;enemy&amp;quot; force ===&lt;br /&gt;
Note that this will kill only mobile units and worms, spawners will not be killed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Kill all enemies ===&lt;br /&gt;
This will kill all biters, bases and worms. Anything that is an enemy will be completely destroyed. This only affects enemies in the explored world, so any unexplored parts of the map which still need to be generated will still have enemies.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local surface=game.player.surface&lt;br /&gt;
for key, entity in pairs(surface.find_entities_filtered({force=&amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
	entity.destroy()&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable peaceful mode ===&lt;br /&gt;
Enabling peaceful mode prevents biter attacks until provoked. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.surface.peaceful_mode = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enable/Disable biter expansion ===&lt;br /&gt;
Biter expansion allows biters to create new nests, it is enabled by default. Substitute true for false to disable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.map_settings.enemy_expansion.enabled = true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Player character scripts ==&lt;br /&gt;
Commands concerning the player directly.&lt;br /&gt;
=== Get Player Position ===&lt;br /&gt;
Prints coordinates of your current position.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.print(game.player.position.x .. &amp;quot;, &amp;quot; .. game.player.position.y)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Teleport player ===&lt;br /&gt;
Moves the player to the specified location. You should be able to teleport to a specific player if you obtain their coordinates via them executing the previous command and giving them to you.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.teleport({X, Y})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To teleport to the world&#039;s origin, use 0,0.&lt;br /&gt;
&lt;br /&gt;
=== Enable god mode ===&lt;br /&gt;
God mode removes your player character allowing you to fly over obstacles and take no damage.&lt;br /&gt;
&lt;br /&gt;
Disassociate your controls from the player:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.character=nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, hover the mouse over the useless player and destroy it by typing:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.selected.destroy()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To undo, spawn a player character. This will spawn a new player at the spawn point of the world, and connect your controls to it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.create_character()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Research scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.laboratory_speed_modifier=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
1 is normal speed, 2 is double speed 3 is triple etc. I think it goes up to 100.&lt;br /&gt;
&lt;br /&gt;
=== Researching specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages, click on the little arrow to show them.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=true&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Unresearching specific technologies ===&lt;br /&gt;
The internal technology names can be found in the infoboxes on their respective pages, click on the little arrow to show them.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.technologies[&#039;electric-energy-distribution-1&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;electric-energy-distribution-1&#039;, 0)&lt;br /&gt;
/c game.player.force.technologies[&#039;steel-processing&#039;].researched=false; game.player.force.set_saved_technology_progress(&#039;steel-processing&#039;, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Enabling specific recipes ===&lt;br /&gt;
The internal recipe/item names can be found in the infoboxes on their respective pages, click on the little arrow to show them.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;electric-energy-interface&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes[&amp;quot;rocket-silo&amp;quot;].enabled=true&lt;br /&gt;
/c game.player.force.recipes.loader.enabled=true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable all recipes&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name, recipe in pairs(game.player.force.recipes) do recipe.enabled = true end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Finish research immediately ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c for name,technology in pairs(game.player.force.technologies) do technology.researched=technology.enabled end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Command Line Parameters ==&lt;br /&gt;
&#039;&#039;&#039;As of Game Version 0.15.13&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Command line parameters can be used to set settings in the command line before the game launches, this is useful mainly for advanced users or server hosts.&lt;br /&gt;
&lt;br /&gt;
General options:&lt;br /&gt;
  -h [ --help ]                      display help&lt;br /&gt;
  --version                          show version information&lt;br /&gt;
  -v [ --verbose ]                   enable verbose logging&lt;br /&gt;
  -c [ --config ] PATH               config file to use&lt;br /&gt;
  --no-log-rotation                  don&#039;t rotate log file&lt;br /&gt;
  --mod-directory PATH               Mod directory to use&lt;br /&gt;
  --check-unused-prototype-data      Print a warning for all prototype values that were not accessed&lt;br /&gt;
&lt;br /&gt;
Running options:&lt;br /&gt;
  -s [ --map2scenario ] arg          map to scenario conversion&lt;br /&gt;
  -m [ --scenario2map ] arg          scenario to map conversion&lt;br /&gt;
  --apply-update arg                 immediately apply update package&lt;br /&gt;
  --create FILE                      create a new map&lt;br /&gt;
  --map-gen-settings FILE            Map generation settings for use with --create. See data/map-gen-settings.example.json&lt;br /&gt;
  --map-settings FILE                Map settings for use with --create. See data/base/prototypes/map-settings.lua&lt;br /&gt;
  --preset arg                       Name of the map generation preset to be used.&lt;br /&gt;
  --generate-map-preview FILE        Generate preview images of the map&lt;br /&gt;
  --map-preview-size SCALE (=1,024)  Size (in pixels) of map preview&lt;br /&gt;
  --map-preview-scale SCALE (=1)     Scale (meters per pixel) of map preview&lt;br /&gt;
  --map-preview-offset X,Y (=0,0)    Offset of the center of the map, in meters&lt;br /&gt;
  --start-server FILE                start a multiplayer server&lt;br /&gt;
  --start-server-load-scenario FILE  start a multiplayer server and load the specified scenario&lt;br /&gt;
  --start-server-load-latest         start a multiplayer server and load the latest available save&lt;br /&gt;
  --until-tick TICK                  run a save until given map tick&lt;br /&gt;
  --mp-connect ADDRESS               start factorio and connect to address&lt;br /&gt;
  --load-game FILE                   start Factorio and load a game in singleplayer&lt;br /&gt;
  --benchmark FILE                   load save and run benchmark&lt;br /&gt;
  --benchmark-ticks N (=1,000)       number of ticks for benchmarking. Default is 1000&lt;br /&gt;
  --force-opengl                     use OpenGL for rendering&lt;br /&gt;
  --force-d3d                        use Direct3D for rendering&lt;br /&gt;
  --fullscreen BOOL                  start game in windowed mode (saved to configuration)&lt;br /&gt;
  --max-texture-size N               maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048&lt;br /&gt;
  --graphics-quality arg             accepted values: normal, low, very-low&lt;br /&gt;
  --video-memory-usage arg           accepted values: all, high, medium, low&lt;br /&gt;
  --gfx-safe-mode                    resets some graphics settings to values that should work on most configurations&lt;br /&gt;
  --shader arg                       enable/disable shader postprocessing (saved to configuration)&lt;br /&gt;
  --disable-audio                    Disable audio. Mainly for faster startup during development.&lt;br /&gt;
&lt;br /&gt;
Server options:&lt;br /&gt;
  --port N                           network port to use&lt;br /&gt;
  --bind ADDRESS[:PORT]              IP address (and optionally port) to bind to&lt;br /&gt;
  --rcon-port N                      Port to use for RCON&lt;br /&gt;
  --rcon-password PASSWORD           Password for RCON&lt;br /&gt;
  --server-settings FILE             Path to file with server settings. See data/server-settings.example.json&lt;br /&gt;
  --server-whitelist FILE            Path to file with server whitelist.&lt;br /&gt;
  --server-banlist FILE              Path to file with server banlist.&lt;br /&gt;
  --console-log FILE                 Path to file where a copy of the server&#039;s log will be stored&lt;br /&gt;
  --server-id FILE                   Path where server ID will be stored or read from&lt;br /&gt;
&lt;br /&gt;
=== Multiplayer ===&lt;br /&gt;
&lt;br /&gt;
  --start-server SAVE&lt;br /&gt;
&lt;br /&gt;
Will start a Headless (Dedicated) server, with no GUI.&lt;br /&gt;
&lt;br /&gt;
  --mp-connect ADDRESS&lt;br /&gt;
ADDRESS is the IP:port of the remote host. Port is optional.&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101&lt;br /&gt;
  ./factorio --mp-connect 192.168.1.101:2345&lt;br /&gt;
&lt;br /&gt;
As above, port can be specified by placing the port number after a colon in the address.&lt;br /&gt;
&lt;br /&gt;
  --map2scenario SAVE&lt;br /&gt;
Converts a save game to a User Scenario, allows saved game state to be loaded into map editor.&lt;br /&gt;
Assuming that save game name is &amp;quot;foo.zip&amp;quot;, executing &#039;./factorio --map2scenario s1&#039; will result in Factorio loading, opening the save file, and saving the scenario into the scenario folder.&lt;br /&gt;
&lt;br /&gt;
== Modding tools ==&lt;br /&gt;
A list of the internal names of most things in the vanilla game can also be found on [[data.raw]].&lt;br /&gt;
=== Write all researched technologies to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, tech in pairs(game.player.force.technologies) do &lt;br /&gt;
	if tech.researched then&lt;br /&gt;
    list[#list+1] = tech.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;techs.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Write all enabled recipes to file ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
/c local list = {}&lt;br /&gt;
for _, recipe in pairs(game.player.force.recipes) do &lt;br /&gt;
	if recipe.enabled then&lt;br /&gt;
    list[#list+1] = recipe.name&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
game.write_file(&amp;quot;recipes.lua&amp;quot;, serpent.block(list) .. &amp;quot;\n&amp;quot;, true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Transport_belt&amp;diff=159262</id>
		<title>Transport belt</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Transport_belt&amp;diff=159262"/>
		<updated>2018-05-16T10:32:59Z</updated>

		<summary type="html">&lt;p&gt;Darkfrei: /* Properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
{{:Infobox:Transport belt}}&lt;br /&gt;
&#039;&#039;&#039;Transport belts&#039;&#039;&#039; are the easiest and cheapest method of automatic item transportation. They are the first tier among the three [[Belt transport system|transport belts]].&lt;br /&gt;
&lt;br /&gt;
No prior [[research]] is required and they are available from the beginning of the game.&lt;br /&gt;
&lt;br /&gt;
==Properties==&lt;br /&gt;
&lt;br /&gt;
[[File:Basic_transport_belt_fulldensity.gif|right|400px|thumb|3 [[fast inserter]]s per side will fill a basic transport belt to maximum density.]]&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Type&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Max. throughput (Items per [[game-second]] for two lanes)&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Speed ([[Tile|Tiles]] per [[game-second]])&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Max. density (Items per [[Tile|tile]])&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Required [[Research|technologies]]&lt;br /&gt;
|-&lt;br /&gt;
| {{Imagelink|Transport belt|Transport belt}} || 13.33 || 1.875 || 7.111 || none&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
(1) See [[Transport belts/Physics|Physics of Transport Belts]] for more detailed information.&lt;br /&gt;
&lt;br /&gt;
==Production Layouts==&lt;br /&gt;
[[Iron gear wheel]]s take the same amount of time to manufacture as transport belts, so one gear [[Assembling machine 1|assembler]] can supply one belt assembler at full capacity, provided they are the same tier. An example is shown below.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Design&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Input: (Items per [[game-second]])&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|rowspan=&amp;quot;3&amp;quot; | [[File:Transport_belt_layout1.jpg|top|400px]] &lt;br /&gt;
|&lt;br /&gt;
{{icon|iron plate|3}} &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;|Output: (Items per [[game-second]])&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
{{icon|transport belt|2}} &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
{{history|0.15.0|&lt;br /&gt;
* Increased stack size from 50 to 100.}}&lt;br /&gt;
&lt;br /&gt;
{{history|0.13.0|&lt;br /&gt;
* Transport belt is now connectible to the [[circuit network]]. &lt;br /&gt;
* Transport belt connectible entities will now disconnect from incoming belts when marked for deconstruction.}}&lt;br /&gt;
&lt;br /&gt;
{{history|0.12.0|&lt;br /&gt;
* Items on transport belts don&#039;t go off the belt at the end, so the transport belt has to go directly in front of the required inserter.&lt;br /&gt;
* Optimised the transport belt movement.}}&lt;br /&gt;
&lt;br /&gt;
{{history|0.11.9|&lt;br /&gt;
* Items marked for deconstruction cannot be moved by belts anymore. &lt;br /&gt;
* Reduced the CPU load caused by big counts of [[inserters]] loading/unloading transport belts.}}&lt;br /&gt;
&lt;br /&gt;
{{history|0.9.7|&lt;br /&gt;
* Belts to be deconstructed no longer accept items. }}&lt;br /&gt;
&lt;br /&gt;
{{history|0.9.6|&lt;br /&gt;
* New transport belt graphics. }}&lt;br /&gt;
&lt;br /&gt;
{{history|0.9.0|&lt;br /&gt;
* Small optimisation. }}&lt;br /&gt;
&lt;br /&gt;
{{history|0.6.0|&lt;br /&gt;
* Transport belt doesn&#039;t pull player out of the edge of it (like items), so player won&#039;t be almost trapped on faster transport belts. }}&lt;br /&gt;
&lt;br /&gt;
{{history|0.5.0|&lt;br /&gt;
* Better movement on transport belts in turns and crossings. }}&lt;br /&gt;
&lt;br /&gt;
{{history|0.2.8|&lt;br /&gt;
* Cross connections of transport belt of the same type are disabled. }}&lt;br /&gt;
&lt;br /&gt;
{{history|0.2.2|&lt;br /&gt;
* When transport belts are rotated (or replaced with different than opposite direction), items on transport belt are collected.}}&lt;br /&gt;
&lt;br /&gt;
{{history|0.2.1|&lt;br /&gt;
* Small optimisation. }}&lt;br /&gt;
&lt;br /&gt;
{{history|0.1.0|&lt;br /&gt;
* Introduced}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Belt transport system]]&lt;br /&gt;
* [[Fast transport belt]]&lt;br /&gt;
** [[Fast splitter]]&lt;br /&gt;
* [[Express transport belt]]&lt;br /&gt;
** [[Express splitter]]&lt;br /&gt;
&lt;br /&gt;
{{LogisticsNav}}&lt;br /&gt;
{{C|Belt transport system}}&lt;/div&gt;</summary>
		<author><name>Darkfrei</name></author>
	</entry>
</feed>