<?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=Jlucktay</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=Jlucktay"/>
	<link rel="alternate" type="text/html" href="https://wiki.factorio.com/Special:Contributions/Jlucktay"/>
	<updated>2026-04-05T01:01:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=177173</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=177173"/>
		<updated>2019-12-27T18:40:00Z</updated>

		<summary type="html">&lt;p&gt;Jlucktay: Fix up some repetition, grammar, etc&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.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;
* [[Command line parameters]]&lt;br /&gt;
* http://lua-api.factorio.com/latest/ - Factorio API reference for latest version&lt;/div&gt;</summary>
		<author><name>Jlucktay</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Data_types&amp;diff=173865</id>
		<title>Data types</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Data_types&amp;diff=173865"/>
		<updated>2019-06-17T20:08:00Z</updated>

		<summary type="html">&lt;p&gt;Jlucktay: Some grammar and spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}} [[Category:Technical]]&lt;br /&gt;
&lt;br /&gt;
This page describes common binary data types used by Factorio, and most modern-day computer applications, internally.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
=== Endianness ===&lt;br /&gt;
&lt;br /&gt;
All data stored in computers are stored in a single, small unit of data called a &amp;quot;byte&amp;quot;. Larger units of data are split into multiple bytes. The order in which sequential bytes are assembled together to form a larger unit of data is referred to as it&#039;s &amp;quot;endianness&amp;quot;. &#039;&#039;&#039;All data saved locally by Factorio is stored in &amp;quot;little&amp;quot;-endian format&#039;&#039;&#039; (because Intel favored little endian processors in the ancient times). All data transferred over the network by Factorio is done in &amp;quot;big&amp;quot;-endian format (the standard for network stuffs, so much so that it&#039;s often referred to as &amp;quot;network&amp;quot;-endian). (Please correct any of this if I&#039;m wrong!) For more information about endianness, please see the [https://en.wikipedia.org/wiki/Endianness Wikipedia entry].&lt;br /&gt;
&lt;br /&gt;
=== Signedness ===&lt;br /&gt;
&lt;br /&gt;
Another property of multi-byte data types is its signedness. Please see the [https://en.wikipedia.org/wiki/Signedness Wikipedia entry]. Data types without a &#039;u-&#039; prefix are signed, and &#039;&#039;&#039;those marked with a &#039;u-&#039; prefixed are unsigned&#039;&#039;&#039;. I&#039;m not certain which type of signedness Factorio uses – perhaps it is machine dependent, but for me, it always appears to be [https://en.wikipedia.org/wiki/Two%27s_complement two&#039;s complement].&lt;br /&gt;
&lt;br /&gt;
=== Space Optimized ===&lt;br /&gt;
&lt;br /&gt;
Some integer values are save using a &amp;quot;space optimized&amp;quot; system where instead of always writing out the full multi-byte integer Factorio will check if the integer size is &amp;lt; 255 and if so a single [[Data_types#unsigned byte|unsigned byte]] is written. If the integer size is ≥ 255 the value 255 as an [[Data_types#unsigned byte|unsigned byte]] is written and then the full data type is written. This is mainly used when saving strings, arrays, and dictionaries because their size is almost always &amp;lt; 255 bytes and in those cases, it saves 3 bytes of space.&lt;br /&gt;
&lt;br /&gt;
== Data Types ==&lt;br /&gt;
&lt;br /&gt;
=== bool ===&lt;br /&gt;
&lt;br /&gt;
1 byte value. Considered True if and only if value equals 1, otherwise it is considered False.&lt;br /&gt;
&lt;br /&gt;
=== byte ===&lt;br /&gt;
&lt;br /&gt;
1 byte long signed integer.&lt;br /&gt;
&lt;br /&gt;
=== unsigned byte ===&lt;br /&gt;
&lt;br /&gt;
1 byte long unsigned integer.&lt;br /&gt;
&lt;br /&gt;
=== short ===&lt;br /&gt;
&lt;br /&gt;
2 byte long signed integer.&lt;br /&gt;
&lt;br /&gt;
=== unsigned short ===&lt;br /&gt;
&lt;br /&gt;
2 byte long unsigned integer.&lt;br /&gt;
&lt;br /&gt;
=== int ===&lt;br /&gt;
&lt;br /&gt;
4 byte long signed integer.&lt;br /&gt;
&lt;br /&gt;
=== unsigned int ===&lt;br /&gt;
&lt;br /&gt;
4 byte long unsigned integer.&lt;br /&gt;
&lt;br /&gt;
=== long ===&lt;br /&gt;
&lt;br /&gt;
8 byte long signed integer.&lt;br /&gt;
&lt;br /&gt;
=== unsigned long ===&lt;br /&gt;
&lt;br /&gt;
8 byte long unsigned integer.&lt;br /&gt;
&lt;br /&gt;
=== float ===&lt;br /&gt;
&lt;br /&gt;
A 4 byte (32 bit) long [https://en.wikipedia.org/wiki/Floating-point_arithmetic floating point number] stored in a special format with two fields - the number&#039;s exponent, and it&#039;s [https://en.wikipedia.org/wiki/Significand mantissa]. This format is described by the [https://en.wikipedia.org/wiki/Single-precision_floating-point_format 32-bit data type in IEEE 754].&lt;br /&gt;
&lt;br /&gt;
=== double ===&lt;br /&gt;
&lt;br /&gt;
An 8 byte (64 bit) long [https://en.wikipedia.org/wiki/Floating-point_arithmetic floating point number] stored in a special format with two fields - the number&#039;s exponent, and it&#039;s [https://en.wikipedia.org/wiki/Significand mantissa]. This format is described by the [https://en.wikipedia.org/wiki/Double-precision_floating-point_format 64-bit data type in IEEE 754].&lt;br /&gt;
&lt;br /&gt;
=== string ===&lt;br /&gt;
&lt;br /&gt;
Strings in Factorio are stored [https://en.wikipedia.org/wiki/String_(computer_science)#Length-prefixed Pascal-style] – they&#039;re a variable length data type with two fields: an [[#unsigned int|unsigned int]] describing how many bytes long the string data is, and then the string data itself.&lt;br /&gt;
&lt;br /&gt;
=== array ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;array&amp;lt;element type&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arrays are a container type. Like a [[#string|string]], they&#039;re prefixed with an [[#unsigned int|unsigned int]] describing how many elements are in the array, followed by that many elements of the specified element type back to back.&lt;br /&gt;
&lt;br /&gt;
=== dict ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;dict&amp;lt;key type, value type&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dictionaries (or &amp;quot;dict&amp;quot;s for short) are like [[#array|arrays]], but their elements consist of (key, value) pairs that map their key (usually a string, or a number) to their value. Just like [[#array|arrays]], they&#039;re prefixed with an [[#unsigned int|unsigned int]] describing how many (key, value) pairs are in the dict, followed by that many (key, value) pairs.&lt;br /&gt;
Each key should be unique and only appear once. In a few esoteric languages, if a key is provided multiple times then only the last value is used – but in Factorio, assume any dict with multiple identical keys is malformed and error.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://lua-api.factorio.com/latest/Builtin-Types.html Factorios Lua API documentation about its builtin types]&lt;/div&gt;</summary>
		<author><name>Jlucktay</name></author>
	</entry>
</feed>