First you need to create a character:
Code: Select all
/c game.player.character = game.player.surface.create_entity{name="player", position = {0,0}, force = game.forces.player}
Code: Select all
/c game.player.cheat_mode=true
Code: Select all
/c game.player.surface.peaceful_mode = true
Optional!
Eternal day:
Code: Select all
/c game.surfaces[1].always_day=true
Code: Select all
/c for _, entity in ipairs(game.player.surface.find_entities_filtered{
area={{game.player.position.x-BLOCKS, game.player.position.y-BLOCKS},
{game.player.position.x+BLOCKS, game.player.position.y+BLOCKS}},
type="resource"})
do
entity.destroy()
end