Code: Select all
/c game.onevent(defines.events.ontick, function(event) if game.tick % 60 == 0 then game.player.selected.amount=30000010 end end)
After that I tried this code:
Code: Select all
/c defines.events.on_gui_click, function() game.player.selected.amount = 30000010 end
After this I tried several different things, most of which were completely misguided to begin with such as game.player.surface.get_tile() which of course wouldn't work since resources aren't tiles. I eventually stumbled across game.player.surface.find_entities() and game.player.surface.find_entities_filtered{area = {{-10, -10}, {10, 10}}, type= "resource"} which seemed promising. I can't actually tell whether these commands actually work though because they return absolutely no info in the console despite not erroring out and trying to print them doesn't return anything at all either. This, for example:
Code: Select all
/c game.player.print(game.player.surface.find_entities_filtered{area = {{-10, -10}, {10, 10}}, type= "resource"})
while adding .name to the end (which appears to be valid according to the documentation) just returns a nil value.
It doesn't really matter to me what sort of method I'd need to really use but it would be extremely helpful if someone could help me figure out some way to make this a lot easier than having to do /c game.player.selected.amount =### for each and every tile.