So, I have a challenge.
I kinda maybe lost my chest with blue prints (specifically power generation blue prints) somewhere on the map.
After having run around the entire know world 3 times and power demand growing steadily, i'm getting desperate to find all the designs.
is there a way to actually locate a specific box on a map? (maybe through the lua?)
I could obviously remake the blueprints but I would rather save the time and effort and use the ones I already have.
Hope anyone can help.
Challenge
Re: Challenge
Code: Select all
local p = game.local_player
local s = p.surface
for chunk in s.get_chunks() do
local entities = s.find_entities_filtered{area={{chunk.x*32, chunk.y*32}, {(chunk.x+1)*32, (chunk.y+1)*32}}, force=p.force}
for _, e in pairs(entities) do
local count = e.get_item_count("blueprint")
if count > 0 then
p.print(e.name.." containing "..count.." blueprint(s) at "..e.position.x.."x"..e.position.y)
end
end
end
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: Challenge
Looks great, just doesn't return anything.
Even if I put a test blueprint in a box next to me.
I copied the code directly into the lua, was that ok?
Even if I put a test blueprint in a box next to me.
I copied the code directly into the lua, was that ok?
Re: Challenge
You're actually executing the code with /c?
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: Challenge
No sorry for the misunderstanding.
I copied the code into the game by going into the console with ~
I copied the code into the game by going into the console with ~
Re: Challenge
Right, now just prefix it with /c so it gets executed instead of resulting in a chat message.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: Challenge
YAY
Found it, thank you so much.
Found it, thank you so much.