help with console
help with console
looking for more info on using the console commands, i have the bobs mod for better logistic robots, but i already have over 26k standard ones and over 500 robo ports so going to each one to remove any vanila robots isnt an option, is there a command/commands i could run to kill off all flying and or docked vanila robots, something better than the best i could do wich didnt work /c game.forces["neutral"].kill_all_units(construction-robot)
Re: help with console
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: help with console
this is usefull except for one thing the bobs logistics changes the names of the roboports so it cant find the inventory and i dont no how to find the new name,
Re: help with console
Hover over a roboport with the mouse and run
Code: Select all
/c game.local_player.print(game.local_player.selected.name)
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: help with console
attemped this, didnt work, any help would be apprieciated
Code: Select all
local original = "construction-robot"
local replacement = "bob-construction-robot-4"
local s = game.local_player.surface
for chunk in s.get_chunks() do
local entities = s.find_entities_filtered{name="roboport", area={{chunk.x*32, chunk.y*32}, {(chunk.x+1)*32, (chunk.y+1)*32}}}
for _, entity in pairs(entities) do
local inv = entity.get_inventory(1)
local count = inv.get_contents()[original]
if count then
inv.remove{name=original, count=count}
inv.insert{name=replacement, count=count}
end
Re: help with console
and that is the correct name the code returned the name roboport
Re: help with console
With this code I can turn construction robots that are sitting in roboports into logistic robots and vice-versa just fine. Those are unmodded though. Any kind of error message?
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: help with console
nope thats whats wierd, it just doesnt do anything but it acts like its trying to,
Re: help with console
Does unmodded logistic <-> construction work for you?
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: help with console
tried this
didnt work eithr,
Code: Select all
local original = "construction-robot"
local replacement = "logistic-robot"
local s = game.local_player.surface
for chunk in s.get_chunks() do
local entities = s.find_entities_filtered{name="roboport", area={{chunk.x*32, chunk.y*32}, {(chunk.x+1)*32, (chunk.y+1)*32}}}
for _, entity in pairs(entities) do
local inv = entity.get_inventory(1)
local count = inv.get_contents()[original]
if count then
inv.remove{name=original, count=count}
inv.insert{name=replacement, count=count}
end
end
end
Re: help with console
https://gyazo.com/f7db8e6db5e31fad23cefc93287b499b
https://gyazo.com/b7cfee56e4bdc2508cd570ed71e62298
https://gyazo.com/a9e41cfd88464a53e48b6f38ce297366
^^ results of the code to find names,
https://gyazo.com/27d13428de11f52c8b596b0a979b04d0
^^result of the code, was nothing changed, my roboport was still full of vanilla construction robots,
https://gyazo.com/b7cfee56e4bdc2508cd570ed71e62298
https://gyazo.com/a9e41cfd88464a53e48b6f38ce297366
^^ results of the code to find names,
https://gyazo.com/27d13428de11f52c8b596b0a979b04d0
^^result of the code, was nothing changed, my roboport was still full of vanilla construction robots,
Re: help with console
You need to actually execute that command with /c, like all the other commands.
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
Re: help with console
omg am i really that dumb,,,
Re: help with console
thank you so much, it never occoured to me to check if the /c was at the start of the code, i feel really dumb now,