Console code to regenerate a resource patch
Posted: Fri Apr 15, 2016 12:29 am
Hello, so I was wondering if it was possible to use console commands to set a area of resource around you using console commands to a certain value: I can see for 1 patch it is :
So I was wondering why this following code does not work:
Code: Select all
/c game.local_player.selected.amount=7500
Code: Select all
/c local pos=game.local_player.position
for k,v in pairs(game.surfaces.nauvis.find_entities_filtered{area={{pos.x-10,pos.y-10},{pos.x+10,pos.y+10}}, type="resource"}) do
v.amount=2500+math.random(0,2500)
end