lua command question

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Lappy
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Mar 03, 2016 1:11 am
Contact:

lua command question

Post by Lappy »

not sure where this question belongs, hope this is the right forum.

i recently found out about the lua command and that you can spawn items in your inventory. is it possible to spawn multiple items at once?
for example; i want 100 copper plate and 100 iron plate. i am currently using 2 seperate commands for this;
/c game.local_player.insert{name='copper-plate', count=100}
/c game.local_player.insert{name='iron-plate', count=100}

it is possible to ask both items in 1 command?
i've tried to place several things in between like '' + '', the '' , '' and '' and '' but with no luck.

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5150
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: lua command question

Post by Klonan »

Not really, but you can make it one command and make it shorter like this

Code: Select all

/c local p = game.local_player p.insert{name = "iron-stick", count = 10} p.insert{name = "copper-cable", count = 50} p.insert{name = "stone", count = 50}

Lappy
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Mar 03, 2016 1:11 am
Contact:

Re: lua command question

Post by Lappy »

thank you!
this will save me a lot of copy-paste if i just make one long command.
nothing better than 6 exoskeletons early to find the perfect spot to begin :mrgreen:

Post Reply

Return to “Gameplay Help”