Page 1 of 1

Command to pick up all items on floor

Posted: Fri Jun 02, 2017 3:55 pm
by NosajDraw
I did a stupid thing, and now there are thousands upon thousand of items on the floor all over my base.

I need a command to pick them all up, or if needs be, a command to despawn them.

Anyone can help me with this?

Re: Command to pick up all items on floor

Posted: Fri Jun 02, 2017 3:58 pm
by Aeternus
Use the Deconstruction Planner. Marking a ground item for deconstruction will cause construction bots to collect them. If neccesary, first blueprint whatever buildings are there and rebuild them afterward.

But might it not be easier to just load an autosave?

Re: Command to pick up all items on floor

Posted: Fri Jun 02, 2017 4:02 pm
by NosajDraw
:( not that far into the game.

Although, yeah, autosave, perhaps, hadn't thought about that, and been in game for a while looking for a solution, will check to see if one goes back far enough.

Re: Command to pick up all items on floor

Posted: Fri Jun 02, 2017 4:03 pm
by Aeternus
Then how did you get thousands of items? Your player inventory can only hold a few hundred... Suppose the easiest way then is to hold the ground pickup (default "F") and run around to vacuum up the items.

Re: Command to pick up all items on floor

Posted: Fri Jun 02, 2017 4:04 pm
by NosajDraw
I left it too long, items on the floor in all 3 auto saves.

Re: Command to pick up all items on floor

Posted: Fri Jun 02, 2017 4:05 pm
by NosajDraw
Aeternus wrote:Then how did you get thousands of items? Your player inventory can only hold a few hundred... Suppose the easiest way then is to hold the ground pickup (default "F") and run around to vacuum up the items.
Using Angels mod Warehouse, broke it thinking it was empty, boom 38000 items on the floor.

Re: Command to pick up all items on floor

Posted: Fri Jun 02, 2017 4:19 pm
by prg

Code: Select all

for _, entity in pairs(game.player.surface.find_entities_filtered{type="item-entity", name="item-on-ground"}) do
    game.player.insert(entity.stack)
    entity.destroy()
end

Re: Command to pick up all items on floor

Posted: Fri Jun 02, 2017 4:26 pm
by NosajDraw
@prg Thank you so much :)