I'm not good at python, help

Yeah so I have this code, and when it can spawn encryptors it does, but it doesn’t spawn the filters surrounding it, only the encryptors, can someone help, or tell me what other information I need to give?

firewall_locations = [[5, 11], [22, 11], [4, 12], [23, 12]]
for location in firewall_locations:
    if (game_state.get_resource(game_state.CORES)) >= 20:
        #Encrypters
        if game_state.can_spawn(ENCRYPTOR, location):
            game_state.attempt_spawn(ENCRYPTOR, location)
        #Filters
        firewall_locations = [[3, 13], [4, 13], [23, 13], [24, 13]]
        if game_state.can_spawn(FILTER, location):
            game_state.attempt_spawn(FILTER, location)

You need another for loop. Your variable for location isn’t being updated with your new set of firewall locations. You want something like this:

if (game_state.get_resource(game_state.CORES)) >= 20:
    # Encryptors    
    encryptor_locations = [[5, 11], [22, 11], [4, 12], [23, 12]]
    for location in encryptor_locations :
        if game_state.can_spawn(ENCRYPTOR, location):
            game_state.attempt_spawn(ENCRYPTOR, location)
    # Filters
    filter_locations = [[3, 13], [4, 13], [23, 13], [24, 13]]
    for location in filter_locations:        
        if game_state.can_spawn(FILTER, location):
            game_state.attempt_spawn(FILTER, location)
3 Likes