Command to pick up all items on floor

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
NosajDraw
Inserter
Inserter
Posts: 32
Joined: Mon May 12, 2014 11:36 am
Contact:

Command to pick up all items on floor

Post 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?

Aeternus
Filter Inserter
Filter Inserter
Posts: 835
Joined: Wed Mar 29, 2017 2:10 am
Contact:

Re: Command to pick up all items on floor

Post 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?

NosajDraw
Inserter
Inserter
Posts: 32
Joined: Mon May 12, 2014 11:36 am
Contact:

Re: Command to pick up all items on floor

Post 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.

Aeternus
Filter Inserter
Filter Inserter
Posts: 835
Joined: Wed Mar 29, 2017 2:10 am
Contact:

Re: Command to pick up all items on floor

Post 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.

NosajDraw
Inserter
Inserter
Posts: 32
Joined: Mon May 12, 2014 11:36 am
Contact:

Re: Command to pick up all items on floor

Post by NosajDraw »

I left it too long, items on the floor in all 3 auto saves.

NosajDraw
Inserter
Inserter
Posts: 32
Joined: Mon May 12, 2014 11:36 am
Contact:

Re: Command to pick up all items on floor

Post 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.

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: Command to pick up all items on floor

Post 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
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!

NosajDraw
Inserter
Inserter
Posts: 32
Joined: Mon May 12, 2014 11:36 am
Contact:

Re: Command to pick up all items on floor

Post by NosajDraw »

@prg Thank you so much :)

Post Reply

Return to “Technical Help”