<?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=Sora</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=Sora"/>
	<link rel="alternate" type="text/html" href="https://wiki.factorio.com/Special:Contributions/Sora"/>
	<updated>2026-04-23T21:17:59Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=125875</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=125875"/>
		<updated>2016-07-04T17:42:16Z</updated>

		<summary type="html">&lt;p&gt;Sora: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
= Console Overview =&lt;br /&gt;
The Factorio console is the built in interface for executing Lua commands within Factorio. It works similarly to any command line interface or the JavaScript console for your browser.&lt;br /&gt;
&lt;br /&gt;
You can essentially fire any command here, just as you would from a Lua program - Factorio [[Mods]] are merely Lua commands. Therefore you don&#039;t necessarily need &amp;quot;cheats&amp;quot; per-se, as the console allows you full access to the game&#039;s internals. You only need a familiarity with the commands and types, as shown in the below examples and the [[Modding]] section.&lt;br /&gt;
&lt;br /&gt;
= Using the console =&lt;br /&gt;
== Opening the console ==&lt;br /&gt;
With default key bindings, the console is opened with the &#039;&#039;&#039; &#039;/&#039; or &#039;~&#039;&#039;&#039;&#039; keys. Like most others, this key binding may be customized within the Options Menu-&amp;gt;Keyboard&amp;gt;&amp;quot;Toggle Lua console&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Inputting commands ==&lt;br /&gt;
&lt;br /&gt;
The console is also the chat window in multiplayer. You need to type &#039;/c&#039; in front of your commands, otherwise it is just a chat message!&lt;br /&gt;
The console has an inbuilt history. You can use the &amp;quot;cursor-up&amp;quot;-key to repeat or quickly edit and re-issue previous commands.&lt;br /&gt;
&lt;br /&gt;
The game ignores newlines when pasting &amp;quot;scriptlets&amp;quot; in the console. This means they can be written in a human readable form in an editor and copy/pasted into the console, making understanding and editing a bit easier.&lt;br /&gt;
&lt;br /&gt;
On the other hand, if you want to type &#039;&#039;several commands in one line&#039;&#039; you just need to put &#039;;&#039; (semicolon) between the commands - see examples below.&lt;br /&gt;
&lt;br /&gt;
= Example&amp;quot;cheat&amp;quot; commands =&lt;br /&gt;
Information for additional commands may be found in the [[Modding|modding-section]]&lt;br /&gt;
&lt;br /&gt;
== Use it as calculator ==&lt;br /&gt;
(see [[#Inputting commands|Inputting Commands]]: you can repeat a prior command with the &amp;quot;cursor up&amp;quot;-key!)&lt;br /&gt;
 /c game.player.print(1234 * 5678)&lt;br /&gt;
&lt;br /&gt;
== Mine faster ==&lt;br /&gt;
 /c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&lt;br /&gt;
== Craft faster ==&lt;br /&gt;
 /c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&lt;br /&gt;
== Zoom beyond normal bounds ==&lt;br /&gt;
 /c game.player.zoom = 0.1&lt;br /&gt;
&lt;br /&gt;
== Use print() instead of game.local_player.print() ==&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=41&amp;amp;t=5638 Use print() instead of game.local_player.print()] (forums)&lt;br /&gt;
 /c print = function(text) game.player.print(text) end&lt;br /&gt;
&lt;br /&gt;
== Check water level in a pipe ==&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=6066&amp;amp;p=47758#p47758 Check water level in a pipe] (forums)&lt;br /&gt;
Hold cursor over the target pipe and execute:&lt;br /&gt;
 /c game.player.print(game.player.selected.fluidbox[1].amount)&lt;br /&gt;
&lt;br /&gt;
== Inventory Manipulation ==&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource in-game&lt;br /&gt;
 /c game.player.selected.amount=7500&lt;br /&gt;
&lt;br /&gt;
=== Add 100 iron plates to your inventory ===&lt;br /&gt;
 /c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&lt;br /&gt;
== World Manipulation ==&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
 /c game.surfaces[1].always_day=true&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 5x5 patch of resources, centered on the player character. For resources other than stone, just change &amp;quot;stone&amp;quot; to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, or &amp;quot;coal&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 /c local surface = game.player.surface;&lt;br /&gt;
 for y=-2,2 do&lt;br /&gt;
  for x=-2,2 do&lt;br /&gt;
   surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=5000, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
=== Destroy rocks in sandbox-mode ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=5686 Destroy rocks in sandbox-mode (forums)] - you don&#039;t have a player here, so you can&#039;t destroy anything.&lt;br /&gt;
  /c for _,entity in pairs(game.player.surface.find_entities_filtered{&lt;br /&gt;
        area={{game.player.position.x-32, game.player.position.y-32},&lt;br /&gt;
            {game.player.position.x+32, game.player.position.y+32}},&lt;br /&gt;
            name=&amp;quot;stone-rock&amp;quot;})&lt;br /&gt;
  do&lt;br /&gt;
    entity.destroy()&lt;br /&gt;
  end&lt;br /&gt;
you need to center the rock in your vision range&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Generate a section of the world and explore it at the same time ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=14&amp;amp;t=4761&amp;amp;p=44184#p44184 Generate a section of the world and explore it at the same time] (forums)&lt;br /&gt;
 /c game.player.force.chart(game.player.surface,{lefttop = {x = -1024, y = -1024}, rightbottom = {x = 1024, y = 1024}})&lt;br /&gt;
&lt;br /&gt;
Simply change the bounding box to the size you want and it will generate the map and explore it in that area. Keep In mind that command is telling Factorio to generate 64*64 (4096) chunks so it&#039;s going to take a while before all the background entity generation (trees, resources, biters) are placed in the world.&lt;br /&gt;
&lt;br /&gt;
== Enemy/Evolution == &lt;br /&gt;
=== Check how far the biters have evolved ===&lt;br /&gt;
 /c game.player.print(game.evolution_factor)&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&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;
&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;
 /c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&lt;br /&gt;
=== Remove all enemies from the map ===&lt;br /&gt;
    /c local surface = game.player.surface&lt;br /&gt;
    for c in surface.get_chunks() do&lt;br /&gt;
        for key, entity in pairs(surface.find_entities_filtered({area={{c.x * 32, c.y * 32}, {c.x * 32 + 32, c.y * 32 + 32}}, force= &amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
            entity.destroy()&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
=== Enable peaceful mode ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=9020 Switching on peaceful mode] (forums)&lt;br /&gt;
 /c game.peaceful_mode = true&lt;br /&gt;
 /c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&lt;br /&gt;
== Player Character ==&lt;br /&gt;
=== Spawn a player character ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=19447&amp;amp;p=124039#p123991 Custom Scenario: How to spawn a character at a certain point (instead of being in god-mode] (forums)&lt;br /&gt;
 /c game.player.character = game.player.surface.create_entity{name=&amp;quot;player&amp;quot;, position = {0,0}, force = game.forces.player}&lt;br /&gt;
&lt;br /&gt;
=== Change Player color ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=9028 Player color] (forums)&lt;br /&gt;
 /c game.player.color={r=200,g=50,b=200,a=.9}&lt;br /&gt;
&lt;br /&gt;
== Research ==&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
 /c game.player.force.laboratory_speed_modifier = 1&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;
=== Enabling specific technologies ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=6633 Enabling technologies] (forums)&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;
&lt;br /&gt;
=== Finish research immediately ===&lt;br /&gt;
 /c for name,technology in pairs(game.player.force.technologies) do technology.researched=technology.enabled end&lt;br /&gt;
&lt;br /&gt;
== Get robot count within network ==&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=9867&amp;amp;p=78209#p78209 Where can I see how many Robots are in my network?] (forums)&lt;br /&gt;
&lt;br /&gt;
Note that these are no longer needed because the roboport now provides accurate robot counts.&lt;br /&gt;
&lt;br /&gt;
=== Count all &#039;&#039;&#039;active robots&#039;&#039;&#039;===&lt;br /&gt;
 /c game.player.print(game.player.force.get_entitycount(&amp;quot;logistic-robot&amp;quot;))&lt;br /&gt;
 /c game.player.print(game.player.force.get_entitycount(&amp;quot;construction-robot&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
=== Count all &#039;&#039;&#039;active and inactive robots&#039;&#039;&#039; in the network, but misses the ones flying over gaps in coverage ===&lt;br /&gt;
    /c robots = {};&lt;br /&gt;
    roboports = {};&lt;br /&gt;
    logistic = 0;&lt;br /&gt;
    construction = 0;&lt;br /&gt;
    recurse = function(r)&lt;br /&gt;
       id = r.position.x .. &amp;quot;,&amp;quot; .. r.position.y;&lt;br /&gt;
       if (roboports[id] or r.force.name ~= game.player.force.name) then return end;&lt;br /&gt;
       roboports[id] = true;&lt;br /&gt;
       logistic = logistic + r.getinventory(1).getitemcount(&amp;quot;logistic-robot&amp;quot;);&lt;br /&gt;
       construction = construction + r.getinventory(1).getitemcount(&amp;quot;construction-robot&amp;quot;);&lt;br /&gt;
       ids = {};&lt;br /&gt;
       for _, robot in ipairs(game.findentitiesfiltered{area={{r.position.x-50, r.position.y-50}, {r.position.x+50, r.position.y+50}}, name=&amp;quot;construction-robot&amp;quot;}) do;&lt;br /&gt;
          id = robot.position.x .. &amp;quot;,&amp;quot; .. robot.position.y;&lt;br /&gt;
          if ((ids[id] or not robots[id]) and robot.force.name == game.player.force.name) then;&lt;br /&gt;
             construction = construction + 1;&lt;br /&gt;
             ids[id] = true;&lt;br /&gt;
             robots[id] = true;&lt;br /&gt;
          end;&lt;br /&gt;
       end;&lt;br /&gt;
       for _, robot in ipairs(game.findentitiesfiltered{area={{r.position.x-50, r.position.y-50}, {r.position.x+50, r.position.y+50}}, name=&amp;quot;logistic-robot&amp;quot;}) do;&lt;br /&gt;
          id = robot.position.x .. &amp;quot;,&amp;quot; .. robot.position.y;&lt;br /&gt;
          if ((ids[id] or not robots[id]) and robot.force.name == game.player.force.name) then;&lt;br /&gt;
             logistic = logistic + 1;&lt;br /&gt;
             ids[id] = true;&lt;br /&gt;
             robots[id] = true;&lt;br /&gt;
          end;&lt;br /&gt;
       end;&lt;br /&gt;
       for _, roboport in ipairs(game.findentitiesfiltered{area={{r.position.x-48.5, r.position.y-48.5}, {r.position.x+48.5, r.position.y+48.5}}, name=&amp;quot;roboport&amp;quot;}) do;&lt;br /&gt;
          recurse(roboport);&lt;br /&gt;
       end;&lt;br /&gt;
    end;&lt;br /&gt;
    p = game.player.character.position;&lt;br /&gt;
    roboport = game.findentitiesfiltered{area={{p.x-48.5, p.y-48.5}, {p.x+48.5, p.y+48.5}}, name=&amp;quot;roboport&amp;quot;}[1];&lt;br /&gt;
    if (roboport) then;&lt;br /&gt;
       recurse(roboport);&lt;br /&gt;
       game.player.print(&amp;quot;Robots in network: Construction:&amp;quot; .. construction .. &amp;quot; Logistic:&amp;quot; .. logistic);&lt;br /&gt;
    else;&lt;br /&gt;
       game.player.print(&amp;quot;Not in range of a roboport.&amp;quot;);&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
&lt;br /&gt;
* [http://lua-api.factorio.com/0.13.4/ Factorio API]&lt;br /&gt;
* [http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=7981 Superspeedrun]&lt;br /&gt;
* [http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=4752 The Console: What is it and How do I use it?]&lt;br /&gt;
: Some interesting cheats or useful commands and tips.&lt;br /&gt;
* [http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=6942&amp;amp;p=543H57#p54357 Totaly new player -&amp;gt; setting up a game]:&lt;br /&gt;
 # Preface all console commands with /c in .11.0+&lt;br /&gt;
 &lt;br /&gt;
 # Set player to white&lt;br /&gt;
 game.player.color = {g=1,b=1,r=1,a=.9}&lt;br /&gt;
 &lt;br /&gt;
 # remove old player&lt;br /&gt;
 game.remove_offline_player(&amp;quot;username&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 # Technology and Recipe unlocking&lt;br /&gt;
 game.player.force.reset_technologies()&lt;br /&gt;
 game.player.force.reset_recipes()&lt;br /&gt;
 game.player.force.enable_all_technologies() # does not research them (see below)&lt;br /&gt;
 game.player.force.enable_all_recipes()&lt;br /&gt;
 game.player.force.research_all_technologies()&lt;br /&gt;
 game.player.force.technologies[&amp;quot;technology-name&amp;quot;].researched = true&lt;br /&gt;
 &lt;br /&gt;
 # cheating&lt;br /&gt;
 game.player.force.manual_mining_speed_modifier = 200&lt;br /&gt;
 game.player.force.manual_crafting_speed_modifier = 200&lt;br /&gt;
 game.speed = 2&lt;br /&gt;
 game.freeze_day_time()&lt;br /&gt;
 game.surfaces[1].always_day = true&lt;br /&gt;
 game.surfaces[1].peaceful_mode = true&lt;br /&gt;
 game.player.insert{name=&amp;quot;item-name&amp;quot;, count=1}&lt;/div&gt;</summary>
		<author><name>Sora</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=125874</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=125874"/>
		<updated>2016-07-04T17:34:52Z</updated>

		<summary type="html">&lt;p&gt;Sora: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
= Console Overview =&lt;br /&gt;
The Factorio console is the built in interface for executing Lua commands within Factorio. It works similarly to any command line interface or the JavaScript console for your browser.&lt;br /&gt;
&lt;br /&gt;
You can essentially fire any command here, just as you would from a Lua program - Factorio [[Mods]] are merely Lua commands. Therefore you don&#039;t necessarily need &amp;quot;cheats&amp;quot; per-se, as the console allows you full access to the game&#039;s internals. You only need a familiarity with the commands and types, as shown in the below examples and the [[Modding]] section.&lt;br /&gt;
&lt;br /&gt;
= Using the console =&lt;br /&gt;
== Opening the console ==&lt;br /&gt;
With default key bindings, the console is opened with the &#039;&#039;&#039; &#039;/&#039; or &#039;~&#039;&#039;&#039;&#039; keys. Like most others, this key binding may be customized within the Options Menu-&amp;gt;Keyboard&amp;gt;&amp;quot;Toggle Lua console&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Inputting commands ==&lt;br /&gt;
&lt;br /&gt;
The console is also the chat window in multiplayer. You need to type &#039;/c&#039; in front of your commands, otherwise it is just a chat message!&lt;br /&gt;
The console has an inbuilt history. You can use the &amp;quot;cursor-up&amp;quot;-key to repeat or quickly edit and re-issue previous commands.&lt;br /&gt;
&lt;br /&gt;
The game ignores newlines when pasting &amp;quot;scriptlets&amp;quot; in the console. This means they can be written in a human readable form in an editor and copy/pasted into the console, making understanding and editing a bit easier.&lt;br /&gt;
&lt;br /&gt;
On the other hand, if you want to type &#039;&#039;several commands in one line&#039;&#039; you just need to put &#039;;&#039; (semicolon) between the commands - see examples below.&lt;br /&gt;
&lt;br /&gt;
= Example&amp;quot;cheat&amp;quot; commands =&lt;br /&gt;
Information for additional commands may be found in the [[Modding|modding-section]]&lt;br /&gt;
&lt;br /&gt;
== Use it as calculator ==&lt;br /&gt;
(see [[#Inputting commands|Inputting Commands]]: you can repeat a prior command with the &amp;quot;cursor up&amp;quot;-key!)&lt;br /&gt;
 /c game.player.print(1234 * 5678)&lt;br /&gt;
&lt;br /&gt;
== Mine faster ==&lt;br /&gt;
 /c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&lt;br /&gt;
== Craft faster ==&lt;br /&gt;
 /c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&lt;br /&gt;
== Zoom beyond normal bounds ==&lt;br /&gt;
 /c game.player.zoom = 0.1&lt;br /&gt;
&lt;br /&gt;
== Use print() instead of game.local_player.print() ==&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=41&amp;amp;t=5638 Use print() instead of game.local_player.print()] (forums)&lt;br /&gt;
 /c print = function(text) game.player.print(text) end&lt;br /&gt;
&lt;br /&gt;
== Check water level in a pipe ==&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=6066&amp;amp;p=47758#p47758 Check water level in a pipe] (forums)&lt;br /&gt;
Hold cursor over the target pipe and execute:&lt;br /&gt;
 /c game.player.print(game.player.selected.fluidbox[1].amount)&lt;br /&gt;
&lt;br /&gt;
== Inventory Manipulation ==&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource in-game&lt;br /&gt;
 /c game.player.selected.amount=7500&lt;br /&gt;
&lt;br /&gt;
=== Add 100 iron plates to your inventory ===&lt;br /&gt;
 /c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&lt;br /&gt;
== World Manipulation ==&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
 /c game.surfaces[1].always_day=true&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 5x5 patch of resources, centered on the player character. For resources other than stone, just change &amp;quot;stone&amp;quot; to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, or &amp;quot;coal&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 /c local surface = game.player.surface;&lt;br /&gt;
 for y=-2,2 do&lt;br /&gt;
  for x=-2,2 do&lt;br /&gt;
   surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=5000, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
=== Destroy rocks in sandbox-mode ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=5686 Destroy rocks in sandbox-mode (forums)] - you don&#039;t have a player here, so you can&#039;t destroy anything.&lt;br /&gt;
  /c for _,entity in pairs(game.player.surface.find_entities_filtered{&lt;br /&gt;
        area={{game.player.position.x-32, game.player.position.y-32},&lt;br /&gt;
            {game.player.position.x+32, game.player.position.y+32}},&lt;br /&gt;
            name=&amp;quot;stone-rock&amp;quot;})&lt;br /&gt;
  do&lt;br /&gt;
    entity.destroy()&lt;br /&gt;
  end&lt;br /&gt;
you need to center the rock in your vision range&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Generate a section of the world and explore it at the same time ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=14&amp;amp;t=4761&amp;amp;p=44184#p44184 Generate a section of the world and explore it at the same time] (forums)&lt;br /&gt;
 /c game.player.force.chart(game.player.surface,{lefttop = {x = -1024, y = -1024}, rightbottom = {x = 1024, y = 1024}})&lt;br /&gt;
&lt;br /&gt;
Simply change the bounding box to the size you want and it will generate the map and explore it in that area. Keep In mind that command is telling Factorio to generate 64*64 (4096) chunks so it&#039;s going to take a while before all the background entity generation (trees, resources, biters) are placed in the world.&lt;br /&gt;
&lt;br /&gt;
== Enemy/Evolution == &lt;br /&gt;
=== Check how far the biters have evolved ===&lt;br /&gt;
 /c game.player.print(game.evolution_factor)&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&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;
&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;
 /c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&lt;br /&gt;
=== Remove all enemies from the map ===&lt;br /&gt;
    /c local surface = game.player.surface&lt;br /&gt;
    for c in surface.get_chunks() do&lt;br /&gt;
        for key, entity in pairs(surface.find_entities_filtered({area={{c.x * 32, c.y * 32}, {c.x * 32 + 32, c.y * 32 + 32}}, force= &amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
            entity.destroy()&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
=== Enable peaceful mode ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=9020 Switching on peaceful mode] (forums)&lt;br /&gt;
 /c game.peaceful_mode = true&lt;br /&gt;
 /c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&lt;br /&gt;
== Player Character ==&lt;br /&gt;
=== Spawn a player character ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=19447&amp;amp;p=124039#p123991 Custom Scenario: How to spawn a character at a certain point (instead of being in god-mode] (forums)&lt;br /&gt;
 /c game.player.character = game.player.surface.create_entity{name=&amp;quot;player&amp;quot;, position = {0,0}, force = game.forces.player}&lt;br /&gt;
&lt;br /&gt;
=== Change Player color ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=9028 Player color] (forums)&lt;br /&gt;
 /c game.player.color={r=200,g=50,b=200,a=.9}&lt;br /&gt;
&lt;br /&gt;
== Research ==&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
 /c game.player.force.laboratory_speed_modifier = 1&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;
=== Enabling specific technologies ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=6633 Enabling technologies] (forums)&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;
&lt;br /&gt;
=== Finish research immediately ===&lt;br /&gt;
 /c for name,technology in pairs(game.player.force.technologies) do technology.researched=technology.enabled end&lt;br /&gt;
&lt;br /&gt;
== Get robot count within network ==&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=9867&amp;amp;p=78209#p78209 Where can I see how many Robots are in my network?] (forums)&lt;br /&gt;
&lt;br /&gt;
Note that these are no longer needed because the roboport now provides accurate robot counts.&lt;br /&gt;
&lt;br /&gt;
=== Count all &#039;&#039;&#039;active robots&#039;&#039;&#039;===&lt;br /&gt;
 /c game.player.print(game.player.force.get_entitycount(&amp;quot;logistic-robot&amp;quot;))&lt;br /&gt;
 /c game.player.print(game.player.force.get_entitycount(&amp;quot;construction-robot&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
=== Count all &#039;&#039;&#039;active and inactive robots&#039;&#039;&#039; in the network, but misses the ones flying over gaps in coverage ===&lt;br /&gt;
    /c robots = {};&lt;br /&gt;
    roboports = {};&lt;br /&gt;
    logistic = 0;&lt;br /&gt;
    construction = 0;&lt;br /&gt;
    recurse = function(r)&lt;br /&gt;
       id = r.position.x .. &amp;quot;,&amp;quot; .. r.position.y;&lt;br /&gt;
       if (roboports[id] or r.force.name ~= game.player.force.name) then return end;&lt;br /&gt;
       roboports[id] = true;&lt;br /&gt;
       logistic = logistic + r.getinventory(1).getitemcount(&amp;quot;logistic-robot&amp;quot;);&lt;br /&gt;
       construction = construction + r.getinventory(1).getitemcount(&amp;quot;construction-robot&amp;quot;);&lt;br /&gt;
       ids = {};&lt;br /&gt;
       for _, robot in ipairs(game.findentitiesfiltered{area={{r.position.x-50, r.position.y-50}, {r.position.x+50, r.position.y+50}}, name=&amp;quot;construction-robot&amp;quot;}) do;&lt;br /&gt;
          id = robot.position.x .. &amp;quot;,&amp;quot; .. robot.position.y;&lt;br /&gt;
          if ((ids[id] or not robots[id]) and robot.force.name == game.player.force.name) then;&lt;br /&gt;
             construction = construction + 1;&lt;br /&gt;
             ids[id] = true;&lt;br /&gt;
             robots[id] = true;&lt;br /&gt;
          end;&lt;br /&gt;
       end;&lt;br /&gt;
       for _, robot in ipairs(game.findentitiesfiltered{area={{r.position.x-50, r.position.y-50}, {r.position.x+50, r.position.y+50}}, name=&amp;quot;logistic-robot&amp;quot;}) do;&lt;br /&gt;
          id = robot.position.x .. &amp;quot;,&amp;quot; .. robot.position.y;&lt;br /&gt;
          if ((ids[id] or not robots[id]) and robot.force.name == game.player.force.name) then;&lt;br /&gt;
             logistic = logistic + 1;&lt;br /&gt;
             ids[id] = true;&lt;br /&gt;
             robots[id] = true;&lt;br /&gt;
          end;&lt;br /&gt;
       end;&lt;br /&gt;
       for _, roboport in ipairs(game.findentitiesfiltered{area={{r.position.x-48.5, r.position.y-48.5}, {r.position.x+48.5, r.position.y+48.5}}, name=&amp;quot;roboport&amp;quot;}) do;&lt;br /&gt;
          recurse(roboport);&lt;br /&gt;
       end;&lt;br /&gt;
    end;&lt;br /&gt;
    p = game.player.character.position;&lt;br /&gt;
    roboport = game.findentitiesfiltered{area={{p.x-48.5, p.y-48.5}, {p.x+48.5, p.y+48.5}}, name=&amp;quot;roboport&amp;quot;}[1];&lt;br /&gt;
    if (roboport) then;&lt;br /&gt;
       recurse(roboport);&lt;br /&gt;
       game.player.print(&amp;quot;Robots in network: Construction:&amp;quot; .. construction .. &amp;quot; Logistic:&amp;quot; .. logistic);&lt;br /&gt;
    else;&lt;br /&gt;
       game.player.print(&amp;quot;Not in range of a roboport.&amp;quot;);&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
&lt;br /&gt;
* [http://lua-api.factorio.com/0.13.4/ Factorio API]&lt;br /&gt;
* [http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=7981 Superspeedrun]&lt;br /&gt;
* [http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=4752 The Console: What is it and How do I use it?]&lt;br /&gt;
: Some interesting cheats or useful commands and tips.&lt;br /&gt;
* [http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=6942&amp;amp;p=543H57#p54357 Totaly new player -&amp;gt; setting up a game]:&lt;br /&gt;
 # Preface all console commands with /c in .11.0+&lt;br /&gt;
 &lt;br /&gt;
 # Set player to white&lt;br /&gt;
 game.player.color = {g=1,b=1,r=1,a=.9}&lt;br /&gt;
 &lt;br /&gt;
 # remove old player&lt;br /&gt;
 game.remove_offline_player(&amp;quot;username&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 # Technology and Recipe unlocking&lt;br /&gt;
 game.player.force.reset_technologies()&lt;br /&gt;
 game.player.force.reset_recipes()&lt;br /&gt;
 game.player.force.enable_all_technologies() # does not research them (see below)&lt;br /&gt;
 game.player.force.enable_all_recipes()&lt;br /&gt;
 game.player.force.research_all_technologies()&lt;br /&gt;
 game.player.force.technologies[&amp;quot;technology-name&amp;quot;].researched = true&lt;br /&gt;
 &lt;br /&gt;
 # cheating&lt;br /&gt;
 game.local_player.force.manual_mining_speed_modifier = 200&lt;br /&gt;
 game.local_player.force.manual_crafting_speed_modifier = 200&lt;br /&gt;
 game.speed = 2&lt;br /&gt;
 game.freeze_day_time()&lt;br /&gt;
 game.always_day = true&lt;br /&gt;
 game.peaceful_mode = true&lt;br /&gt;
 game.local_player.insert{name=&amp;quot;item-name&amp;quot;, count=1}&lt;/div&gt;</summary>
		<author><name>Sora</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=125873</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=125873"/>
		<updated>2016-07-04T17:13:43Z</updated>

		<summary type="html">&lt;p&gt;Sora: /* See also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
= Console Overview =&lt;br /&gt;
The Factorio console is the built in interface for executing Lua commands within Factorio. It works similarly to any command line interface or the JavaScript console for your browser.&lt;br /&gt;
&lt;br /&gt;
You can essentially fire any command here, just as you would from a Lua program - Factorio [[Mods]] are merely Lua commands. Therefore you don&#039;t necessarily need &amp;quot;cheats&amp;quot; per-se, as the console allows you full access to the game&#039;s internals. You only need a familiarity with the commands and types, as shown in the below examples and the [[Modding]] section.&lt;br /&gt;
&lt;br /&gt;
= Using the console =&lt;br /&gt;
== Opening the console ==&lt;br /&gt;
With default key bindings, the console is opened with the &#039;&#039;&#039; &#039;/&#039; or &#039;~&#039;&#039;&#039;&#039; keys. Like most others, this key binding may be customized within the Options Menu-&amp;gt;Keyboard&amp;gt;&amp;quot;Toggle Lua console&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Inputting commands ==&lt;br /&gt;
&lt;br /&gt;
The console is also the chat window in multiplayer. You need to type &#039;/c&#039; in front of your commands, otherwise it is just a chat message!&lt;br /&gt;
The console has an inbuilt history. You can use the &amp;quot;cursor-up&amp;quot;-key to repeat or quickly edit and re-issue previous commands.&lt;br /&gt;
&lt;br /&gt;
The game ignores newlines when pasting &amp;quot;scriptlets&amp;quot; in the console. This means they can be written in a human readable form in an editor and copy/pasted into the console, making understanding and editing a bit easier.&lt;br /&gt;
&lt;br /&gt;
On the other hand, if you want to type &#039;&#039;several commands in one line&#039;&#039; you just need to put &#039;;&#039; (semicolon) between the commands - see examples below.&lt;br /&gt;
&lt;br /&gt;
= Example&amp;quot;cheat&amp;quot; commands =&lt;br /&gt;
Information for additional commands may be found in the [[Modding|modding-section]]&lt;br /&gt;
&lt;br /&gt;
== Use it as calculator ==&lt;br /&gt;
(see [[#Inputting commands|Inputting Commands]]: you can repeat a prior command with the &amp;quot;cursor up&amp;quot;-key!)&lt;br /&gt;
 /c game.player.print(1234 * 5678)&lt;br /&gt;
&lt;br /&gt;
== Mine faster ==&lt;br /&gt;
 /c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&lt;br /&gt;
== Craft faster ==&lt;br /&gt;
 /c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&lt;br /&gt;
== Zoom beyond normal bounds ==&lt;br /&gt;
 /c game.player.zoom = 0.1&lt;br /&gt;
&lt;br /&gt;
== Use print() instead of game.local_player.print() ==&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=41&amp;amp;t=5638 Use print() instead of game.local_player.print()] (forums)&lt;br /&gt;
 /c print = function(text) game.player.print(text) end&lt;br /&gt;
&lt;br /&gt;
== Check water level in a pipe ==&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=6066&amp;amp;p=47758#p47758 Check water level in a pipe] (forums)&lt;br /&gt;
Hold cursor over the target pipe and execute:&lt;br /&gt;
 /c game.player.print(game.player.selected.fluidbox[1].amount)&lt;br /&gt;
&lt;br /&gt;
== Inventory Manipulation ==&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource in-game&lt;br /&gt;
 /c game.player.selected.amount=7500&lt;br /&gt;
&lt;br /&gt;
=== Add 100 iron plates to your inventory ===&lt;br /&gt;
 /c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&lt;br /&gt;
== World Manipulation ==&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
 /c game.surfaces[1].always_day=true&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 5x5 patch of resources, centered on the player character. For resources other than stone, just change &amp;quot;stone&amp;quot; to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, or &amp;quot;coal&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 /c local surface = game.player.surface;&lt;br /&gt;
 for y=-2,2 do&lt;br /&gt;
  for x=-2,2 do&lt;br /&gt;
   surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=5000, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
=== Destroy rocks in sandbox-mode ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=5686 Destroy rocks in sandbox-mode (forums)] - you don&#039;t have a player here, so you can&#039;t destroy anything.&lt;br /&gt;
  /c for _,entity in pairs(game.player.surface.find_entities_filtered{&lt;br /&gt;
        area={{game.player.position.x-32, game.player.position.y-32},&lt;br /&gt;
            {game.player.position.x+32, game.player.position.y+32}},&lt;br /&gt;
            name=&amp;quot;stone-rock&amp;quot;})&lt;br /&gt;
  do&lt;br /&gt;
    entity.destroy()&lt;br /&gt;
  end&lt;br /&gt;
you need to center the rock in your vision range&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Generate a section of the world and explore it at the same time ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=14&amp;amp;t=4761&amp;amp;p=44184#p44184 Generate a section of the world and explore it at the same time] (forums)&lt;br /&gt;
 /c game.player.force.chart(game.player.surface,{lefttop = {x = -1024, y = -1024}, rightbottom = {x = 1024, y = 1024}})&lt;br /&gt;
&lt;br /&gt;
Simply change the bounding box to the size you want and it will generate the map and explore it in that area. Keep In mind that command is telling Factorio to generate 64*64 (4096) chunks so it&#039;s going to take a while before all the background entity generation (trees, resources, biters) are placed in the world.&lt;br /&gt;
&lt;br /&gt;
== Enemy/Evolution == &lt;br /&gt;
=== Check how far the biters have evolved ===&lt;br /&gt;
 /c game.player.print(game.evolution_factor)&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&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;
&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;
 /c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&lt;br /&gt;
=== Remove all enemies from the map ===&lt;br /&gt;
    /c local surface = game.player.surface&lt;br /&gt;
    for c in surface.get_chunks() do&lt;br /&gt;
        for key, entity in pairs(surface.find_entities_filtered({area={{c.x * 32, c.y * 32}, {c.x * 32 + 32, c.y * 32 + 32}}, force= &amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
            entity.destroy()&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
=== Enable peaceful mode ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=9020 Switching on peaceful mode] (forums)&lt;br /&gt;
 /c game.peaceful_mode = true&lt;br /&gt;
 /c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&lt;br /&gt;
== Player Character ==&lt;br /&gt;
=== Spawn a player character ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=19447&amp;amp;p=124039#p123991 Custom Scenario: How to spawn a character at a certain point (instead of being in god-mode] (forums)&lt;br /&gt;
 /c game.player.character = game.player.surface.create_entity{name=&amp;quot;player&amp;quot;, position = {0,0}, force = game.forces.player}&lt;br /&gt;
&lt;br /&gt;
=== Change Player color ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=9028 Player color] (forums)&lt;br /&gt;
 /c game.player.color={r=200,g=50,b=200,a=.9}&lt;br /&gt;
&lt;br /&gt;
== Research ==&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
 /c game.player.force.laboratory_speed_modifier = 1&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;
=== Enabling specific technologies ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=6633 Enabling technologies] (forums)&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;
&lt;br /&gt;
=== Finish research immediately ===&lt;br /&gt;
 /c for name,technology in pairs(game.player.force.technologies) do technology.researched=technology.enabled end&lt;br /&gt;
&lt;br /&gt;
== Get robot count within network ==&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=9867&amp;amp;p=78209#p78209 Where can I see how many Robots are in my network?] (forums)&lt;br /&gt;
&lt;br /&gt;
Note that these are no longer needed because the roboport now provides accurate robot counts.&lt;br /&gt;
&lt;br /&gt;
=== Count all &#039;&#039;&#039;active robots&#039;&#039;&#039;===&lt;br /&gt;
 /c game.player.print(game.player.force.get_entitycount(&amp;quot;logistic-robot&amp;quot;))&lt;br /&gt;
 /c game.player.print(game.player.force.get_entitycount(&amp;quot;construction-robot&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
=== Count all &#039;&#039;&#039;active and inactive robots&#039;&#039;&#039; in the network, but misses the ones flying over gaps in coverage ===&lt;br /&gt;
    /c robots = {};&lt;br /&gt;
    roboports = {};&lt;br /&gt;
    logistic = 0;&lt;br /&gt;
    construction = 0;&lt;br /&gt;
    recurse = function(r)&lt;br /&gt;
       id = r.position.x .. &amp;quot;,&amp;quot; .. r.position.y;&lt;br /&gt;
       if (roboports[id] or r.force.name ~= game.player.force.name) then return end;&lt;br /&gt;
       roboports[id] = true;&lt;br /&gt;
       logistic = logistic + r.getinventory(1).getitemcount(&amp;quot;logistic-robot&amp;quot;);&lt;br /&gt;
       construction = construction + r.getinventory(1).getitemcount(&amp;quot;construction-robot&amp;quot;);&lt;br /&gt;
       ids = {};&lt;br /&gt;
       for _, robot in ipairs(game.findentitiesfiltered{area={{r.position.x-50, r.position.y-50}, {r.position.x+50, r.position.y+50}}, name=&amp;quot;construction-robot&amp;quot;}) do;&lt;br /&gt;
          id = robot.position.x .. &amp;quot;,&amp;quot; .. robot.position.y;&lt;br /&gt;
          if ((ids[id] or not robots[id]) and robot.force.name == game.player.force.name) then;&lt;br /&gt;
             construction = construction + 1;&lt;br /&gt;
             ids[id] = true;&lt;br /&gt;
             robots[id] = true;&lt;br /&gt;
          end;&lt;br /&gt;
       end;&lt;br /&gt;
       for _, robot in ipairs(game.findentitiesfiltered{area={{r.position.x-50, r.position.y-50}, {r.position.x+50, r.position.y+50}}, name=&amp;quot;logistic-robot&amp;quot;}) do;&lt;br /&gt;
          id = robot.position.x .. &amp;quot;,&amp;quot; .. robot.position.y;&lt;br /&gt;
          if ((ids[id] or not robots[id]) and robot.force.name == game.player.force.name) then;&lt;br /&gt;
             logistic = logistic + 1;&lt;br /&gt;
             ids[id] = true;&lt;br /&gt;
             robots[id] = true;&lt;br /&gt;
          end;&lt;br /&gt;
       end;&lt;br /&gt;
       for _, roboport in ipairs(game.findentitiesfiltered{area={{r.position.x-48.5, r.position.y-48.5}, {r.position.x+48.5, r.position.y+48.5}}, name=&amp;quot;roboport&amp;quot;}) do;&lt;br /&gt;
          recurse(roboport);&lt;br /&gt;
       end;&lt;br /&gt;
    end;&lt;br /&gt;
    p = game.player.character.position;&lt;br /&gt;
    roboport = game.findentitiesfiltered{area={{p.x-48.5, p.y-48.5}, {p.x+48.5, p.y+48.5}}, name=&amp;quot;roboport&amp;quot;}[1];&lt;br /&gt;
    if (roboport) then;&lt;br /&gt;
       recurse(roboport);&lt;br /&gt;
       game.player.print(&amp;quot;Robots in network: Construction:&amp;quot; .. construction .. &amp;quot; Logistic:&amp;quot; .. logistic);&lt;br /&gt;
    else;&lt;br /&gt;
       game.player.print(&amp;quot;Not in range of a roboport.&amp;quot;);&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
&lt;br /&gt;
* [http://lua-api.factorio.com/0.13.4/ Factorio API]&lt;br /&gt;
* [http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=7981 Superspeedrun]&lt;br /&gt;
* [http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=4752 The Console: What is it and How do I use it?]&lt;br /&gt;
: Some interesting cheats or useful commands and tips.&lt;br /&gt;
* [http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=6942&amp;amp;p=543H57#p54357 Totaly new player -&amp;gt; setting up a game]:&lt;br /&gt;
 # Preface all console commands with /c in .11.0+&lt;br /&gt;
 &lt;br /&gt;
 # Set player to white&lt;br /&gt;
 game.local_player.color = {g=1,b=1,r=1,a=.9}&lt;br /&gt;
 &lt;br /&gt;
 # remove old player&lt;br /&gt;
 game.remove_offline_player(&amp;quot;username&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 # Technology and Recipe unlocking&lt;br /&gt;
 game.local_player.force.reset_technologies()&lt;br /&gt;
 game.local_player.force.reset_recipes()&lt;br /&gt;
 game.local_player.force.enable_all_technologies() # does not research them (see below)&lt;br /&gt;
 game.local_player.force.enable_all_recipes()&lt;br /&gt;
 game.local_player.force.research_all_technologies()&lt;br /&gt;
 game.local_player.force.technologies[&amp;quot;technology-name&amp;quot;].researched = true&lt;br /&gt;
 &lt;br /&gt;
 # cheating&lt;br /&gt;
 game.local_player.force.manual_mining_speed_modifier = 200&lt;br /&gt;
 game.local_player.force.manual_crafting_speed_modifier = 200&lt;br /&gt;
 game.speed = 2&lt;br /&gt;
 game.freeze_day_time()&lt;br /&gt;
 game.always_day = true&lt;br /&gt;
 game.peaceful_mode = true&lt;br /&gt;
 game.local_player.insert{name=&amp;quot;item-name&amp;quot;, count=1}&lt;/div&gt;</summary>
		<author><name>Sora</name></author>
	</entry>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Console&amp;diff=125872</id>
		<title>Console</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Console&amp;diff=125872"/>
		<updated>2016-07-04T17:11:50Z</updated>

		<summary type="html">&lt;p&gt;Sora: /* Example&amp;quot;cheat&amp;quot; commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Languages}}&lt;br /&gt;
= Console Overview =&lt;br /&gt;
The Factorio console is the built in interface for executing Lua commands within Factorio. It works similarly to any command line interface or the JavaScript console for your browser.&lt;br /&gt;
&lt;br /&gt;
You can essentially fire any command here, just as you would from a Lua program - Factorio [[Mods]] are merely Lua commands. Therefore you don&#039;t necessarily need &amp;quot;cheats&amp;quot; per-se, as the console allows you full access to the game&#039;s internals. You only need a familiarity with the commands and types, as shown in the below examples and the [[Modding]] section.&lt;br /&gt;
&lt;br /&gt;
= Using the console =&lt;br /&gt;
== Opening the console ==&lt;br /&gt;
With default key bindings, the console is opened with the &#039;&#039;&#039; &#039;/&#039; or &#039;~&#039;&#039;&#039;&#039; keys. Like most others, this key binding may be customized within the Options Menu-&amp;gt;Keyboard&amp;gt;&amp;quot;Toggle Lua console&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Inputting commands ==&lt;br /&gt;
&lt;br /&gt;
The console is also the chat window in multiplayer. You need to type &#039;/c&#039; in front of your commands, otherwise it is just a chat message!&lt;br /&gt;
The console has an inbuilt history. You can use the &amp;quot;cursor-up&amp;quot;-key to repeat or quickly edit and re-issue previous commands.&lt;br /&gt;
&lt;br /&gt;
The game ignores newlines when pasting &amp;quot;scriptlets&amp;quot; in the console. This means they can be written in a human readable form in an editor and copy/pasted into the console, making understanding and editing a bit easier.&lt;br /&gt;
&lt;br /&gt;
On the other hand, if you want to type &#039;&#039;several commands in one line&#039;&#039; you just need to put &#039;;&#039; (semicolon) between the commands - see examples below.&lt;br /&gt;
&lt;br /&gt;
= Example&amp;quot;cheat&amp;quot; commands =&lt;br /&gt;
Information for additional commands may be found in the [[Modding|modding-section]]&lt;br /&gt;
&lt;br /&gt;
== Use it as calculator ==&lt;br /&gt;
(see [[#Inputting commands|Inputting Commands]]: you can repeat a prior command with the &amp;quot;cursor up&amp;quot;-key!)&lt;br /&gt;
 /c game.player.print(1234 * 5678)&lt;br /&gt;
&lt;br /&gt;
== Mine faster ==&lt;br /&gt;
 /c game.player.force.manual_mining_speed_modifier=1000&lt;br /&gt;
&lt;br /&gt;
== Craft faster ==&lt;br /&gt;
 /c game.player.force.manual_crafting_speed_modifier=1000&lt;br /&gt;
&lt;br /&gt;
== Zoom beyond normal bounds ==&lt;br /&gt;
 /c game.player.zoom = 0.1&lt;br /&gt;
&lt;br /&gt;
== Use print() instead of game.local_player.print() ==&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=41&amp;amp;t=5638 Use print() instead of game.local_player.print()] (forums)&lt;br /&gt;
 /c print = function(text) game.player.print(text) end&lt;br /&gt;
&lt;br /&gt;
== Check water level in a pipe ==&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=6066&amp;amp;p=47758#p47758 Check water level in a pipe] (forums)&lt;br /&gt;
Hold cursor over the target pipe and execute:&lt;br /&gt;
 /c game.player.print(game.player.selected.fluidbox[1].amount)&lt;br /&gt;
&lt;br /&gt;
== Inventory Manipulation ==&lt;br /&gt;
=== Refill resources (refill oil, iron etc.) ===&lt;br /&gt;
While holding the cursor over a resource in-game&lt;br /&gt;
 /c game.player.selected.amount=7500&lt;br /&gt;
&lt;br /&gt;
=== Add 100 iron plates to your inventory ===&lt;br /&gt;
 /c game.player.insert{name=&amp;quot;iron-plate&amp;quot;, count=100}&lt;br /&gt;
&lt;br /&gt;
== World Manipulation ==&lt;br /&gt;
=== Turn off night ===&lt;br /&gt;
 /c game.surfaces[1].always_day=true&lt;br /&gt;
&lt;br /&gt;
=== Add new resource patch ===&lt;br /&gt;
This creates a new 5x5 patch of resources, centered on the player character. For resources other than stone, just change &amp;quot;stone&amp;quot; to &amp;quot;iron-ore&amp;quot;, &amp;quot;copper-ore&amp;quot;, or &amp;quot;coal&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 /c local surface = game.player.surface;&lt;br /&gt;
 for y=-2,2 do&lt;br /&gt;
  for x=-2,2 do&lt;br /&gt;
   surface.create_entity({name=&amp;quot;stone&amp;quot;, amount=5000, position={game.player.position.x+x, game.player.position.y+y}})&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
=== Destroy rocks in sandbox-mode ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=5686 Destroy rocks in sandbox-mode (forums)] - you don&#039;t have a player here, so you can&#039;t destroy anything.&lt;br /&gt;
  /c for _,entity in pairs(game.player.surface.find_entities_filtered{&lt;br /&gt;
        area={{game.player.position.x-32, game.player.position.y-32},&lt;br /&gt;
            {game.player.position.x+32, game.player.position.y+32}},&lt;br /&gt;
            name=&amp;quot;stone-rock&amp;quot;})&lt;br /&gt;
  do&lt;br /&gt;
    entity.destroy()&lt;br /&gt;
  end&lt;br /&gt;
you need to center the rock in your vision range&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Generate a section of the world and explore it at the same time ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=14&amp;amp;t=4761&amp;amp;p=44184#p44184 Generate a section of the world and explore it at the same time] (forums)&lt;br /&gt;
 /c game.player.force.chart(game.player.surface,{lefttop = {x = -1024, y = -1024}, rightbottom = {x = 1024, y = 1024}})&lt;br /&gt;
&lt;br /&gt;
Simply change the bounding box to the size you want and it will generate the map and explore it in that area. Keep In mind that command is telling Factorio to generate 64*64 (4096) chunks so it&#039;s going to take a while before all the background entity generation (trees, resources, biters) are placed in the world.&lt;br /&gt;
&lt;br /&gt;
== Enemy/Evolution == &lt;br /&gt;
=== Check how far the biters have evolved ===&lt;br /&gt;
 /c game.player.print(game.evolution_factor)&lt;br /&gt;
&lt;br /&gt;
=== Disable time-based evolution &amp;amp; increases pollution-based evolution ===&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;
&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;
 /c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&lt;br /&gt;
=== Remove all enemies from the map ===&lt;br /&gt;
    /c local surface = game.player.surface&lt;br /&gt;
    for c in surface.get_chunks() do&lt;br /&gt;
        for key, entity in pairs(surface.find_entities_filtered({area={{c.x * 32, c.y * 32}, {c.x * 32 + 32, c.y * 32 + 32}}, force= &amp;quot;enemy&amp;quot;})) do&lt;br /&gt;
            entity.destroy()&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
=== Enable peaceful mode ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=9020 Switching on peaceful mode] (forums)&lt;br /&gt;
 /c game.peaceful_mode = true&lt;br /&gt;
 /c game.forces[&amp;quot;enemy&amp;quot;].kill_all_units()&lt;br /&gt;
&lt;br /&gt;
== Player Character ==&lt;br /&gt;
=== Spawn a player character ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=19447&amp;amp;p=124039#p123991 Custom Scenario: How to spawn a character at a certain point (instead of being in god-mode] (forums)&lt;br /&gt;
 /c game.player.character = game.player.surface.create_entity{name=&amp;quot;player&amp;quot;, position = {0,0}, force = game.forces.player}&lt;br /&gt;
&lt;br /&gt;
=== Change Player color ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=9028 Player color] (forums)&lt;br /&gt;
 /c game.player.color={r=200,g=50,b=200,a=.9}&lt;br /&gt;
&lt;br /&gt;
== Research ==&lt;br /&gt;
=== Enable faster research ===&lt;br /&gt;
 /c game.player.force.laboratory_speed_modifier = 1&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;
=== Enabling specific technologies ===&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=6633 Enabling technologies] (forums)&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;
&lt;br /&gt;
=== Finish research immediately ===&lt;br /&gt;
 /c for name,technology in pairs(game.player.force.technologies) do technology.researched=technology.enabled end&lt;br /&gt;
&lt;br /&gt;
== Get robot count within network ==&lt;br /&gt;
[http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=9867&amp;amp;p=78209#p78209 Where can I see how many Robots are in my network?] (forums)&lt;br /&gt;
&lt;br /&gt;
Note that these are no longer needed because the roboport now provides accurate robot counts.&lt;br /&gt;
&lt;br /&gt;
=== Count all &#039;&#039;&#039;active robots&#039;&#039;&#039;===&lt;br /&gt;
 /c game.player.print(game.player.force.get_entitycount(&amp;quot;logistic-robot&amp;quot;))&lt;br /&gt;
 /c game.player.print(game.player.force.get_entitycount(&amp;quot;construction-robot&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
=== Count all &#039;&#039;&#039;active and inactive robots&#039;&#039;&#039; in the network, but misses the ones flying over gaps in coverage ===&lt;br /&gt;
    /c robots = {};&lt;br /&gt;
    roboports = {};&lt;br /&gt;
    logistic = 0;&lt;br /&gt;
    construction = 0;&lt;br /&gt;
    recurse = function(r)&lt;br /&gt;
       id = r.position.x .. &amp;quot;,&amp;quot; .. r.position.y;&lt;br /&gt;
       if (roboports[id] or r.force.name ~= game.player.force.name) then return end;&lt;br /&gt;
       roboports[id] = true;&lt;br /&gt;
       logistic = logistic + r.getinventory(1).getitemcount(&amp;quot;logistic-robot&amp;quot;);&lt;br /&gt;
       construction = construction + r.getinventory(1).getitemcount(&amp;quot;construction-robot&amp;quot;);&lt;br /&gt;
       ids = {};&lt;br /&gt;
       for _, robot in ipairs(game.findentitiesfiltered{area={{r.position.x-50, r.position.y-50}, {r.position.x+50, r.position.y+50}}, name=&amp;quot;construction-robot&amp;quot;}) do;&lt;br /&gt;
          id = robot.position.x .. &amp;quot;,&amp;quot; .. robot.position.y;&lt;br /&gt;
          if ((ids[id] or not robots[id]) and robot.force.name == game.player.force.name) then;&lt;br /&gt;
             construction = construction + 1;&lt;br /&gt;
             ids[id] = true;&lt;br /&gt;
             robots[id] = true;&lt;br /&gt;
          end;&lt;br /&gt;
       end;&lt;br /&gt;
       for _, robot in ipairs(game.findentitiesfiltered{area={{r.position.x-50, r.position.y-50}, {r.position.x+50, r.position.y+50}}, name=&amp;quot;logistic-robot&amp;quot;}) do;&lt;br /&gt;
          id = robot.position.x .. &amp;quot;,&amp;quot; .. robot.position.y;&lt;br /&gt;
          if ((ids[id] or not robots[id]) and robot.force.name == game.player.force.name) then;&lt;br /&gt;
             logistic = logistic + 1;&lt;br /&gt;
             ids[id] = true;&lt;br /&gt;
             robots[id] = true;&lt;br /&gt;
          end;&lt;br /&gt;
       end;&lt;br /&gt;
       for _, roboport in ipairs(game.findentitiesfiltered{area={{r.position.x-48.5, r.position.y-48.5}, {r.position.x+48.5, r.position.y+48.5}}, name=&amp;quot;roboport&amp;quot;}) do;&lt;br /&gt;
          recurse(roboport);&lt;br /&gt;
       end;&lt;br /&gt;
    end;&lt;br /&gt;
    p = game.player.character.position;&lt;br /&gt;
    roboport = game.findentitiesfiltered{area={{p.x-48.5, p.y-48.5}, {p.x+48.5, p.y+48.5}}, name=&amp;quot;roboport&amp;quot;}[1];&lt;br /&gt;
    if (roboport) then;&lt;br /&gt;
       recurse(roboport);&lt;br /&gt;
       game.player.print(&amp;quot;Robots in network: Construction:&amp;quot; .. construction .. &amp;quot; Logistic:&amp;quot; .. logistic);&lt;br /&gt;
    else;&lt;br /&gt;
       game.player.print(&amp;quot;Not in range of a roboport.&amp;quot;);&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
= See also =&lt;br /&gt;
&lt;br /&gt;
* [http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=7981 Superspeedrun]&lt;br /&gt;
* [http://www.factorioforums.com/forum/viewtopic.php?f=18&amp;amp;t=4752 The Console: What is it and How do I use it?]&lt;br /&gt;
: Some interesting cheats or useful commands and tips.&lt;br /&gt;
* [http://www.factorioforums.com/forum/viewtopic.php?f=5&amp;amp;t=6942&amp;amp;p=543H57#p54357 Totaly new player -&amp;gt; setting up a game]:&lt;br /&gt;
 # Preface all console commands with /c in .11.0+&lt;br /&gt;
 &lt;br /&gt;
 # Set player to white&lt;br /&gt;
 game.local_player.color = {g=1,b=1,r=1,a=.9}&lt;br /&gt;
 &lt;br /&gt;
 # remove old player&lt;br /&gt;
 game.remove_offline_player(&amp;quot;username&amp;quot;)&lt;br /&gt;
 &lt;br /&gt;
 # Technology and Recipe unlocking&lt;br /&gt;
 game.local_player.force.reset_technologies()&lt;br /&gt;
 game.local_player.force.reset_recipes()&lt;br /&gt;
 game.local_player.force.enable_all_technologies() # does not research them (see below)&lt;br /&gt;
 game.local_player.force.enable_all_recipes()&lt;br /&gt;
 game.local_player.force.research_all_technologies()&lt;br /&gt;
 game.local_player.force.technologies[&amp;quot;technology-name&amp;quot;].researched = true&lt;br /&gt;
 &lt;br /&gt;
 # cheating&lt;br /&gt;
 game.local_player.force.manual_mining_speed_modifier = 200&lt;br /&gt;
 game.local_player.force.manual_crafting_speed_modifier = 200&lt;br /&gt;
 game.speed = 2&lt;br /&gt;
 game.freeze_day_time()&lt;br /&gt;
 game.always_day = true&lt;br /&gt;
 game.peaceful_mode = true&lt;br /&gt;
 game.local_player.insert{name=&amp;quot;item-name&amp;quot;, count=1}&lt;/div&gt;</summary>
		<author><name>Sora</name></author>
	</entry>
</feed>