Skip to content

Instantly share code, notes, and snippets.

@justarandomgeek
Last active October 16, 2022 09:49
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save justarandomgeek/2c47b4aaee12f717227f867a4c030fae to your computer and use it in GitHub Desktop.
Save justarandomgeek/2c47b4aaee12f717227f867a4c030fae to your computer and use it in GitHub Desktop.
Factorio Command: Remove all trees in 5000 tile radius
/c
pos = game.player.position
area = {{pos.x - 5000, pos.y - 5000}, {pos.x + 5000, pos.y + 1.5}}
for _, entity in pairs(game.player.surface.find_entities_filtered{area = area, type = "tree"}) do
entity.die()
end
@arye321
Copy link

arye321 commented Oct 26, 2020

bless you

edit: this worked better

/c for _, entity in ipairs(game.player.surface.find_entities_filtered{ area={{game.player.position.x-1000, game.player.position.y-1000}, {game.player.position.x+1000, game.player.position.y+1000}}, type="tree"}) do entity.destroy() end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment