Code: Select all
local surface = game.player.surface
local pos=game.player.position
local size = 10
local entities = surface.find_entities({{pos.x-size, pos.y-size},{pos.x+size, pos.y+size}})
local count = 0
for key, entity in pairs(entities) do
if entity.type == "tile-ghost" and (entity.ghost_name == "stone-brick" or entity.ghost_name == "concrete") then
count = count + 1
end
end
game.player.print(count)