def scan_inactives(empire): for galaxy in range(2, 7): for system in range(199, 500): # time.sleep(randint(3, 5)) print(f'NOS ESTÁN ATACANDO???? {empire.attacked()}') if empire.attacked() is True: sos() for planet in empire.galaxy(coordinates(galaxy, system)): if status.inactive in planet.status and status.noob not in planet.status and status.vacation not in planet.status: print('Find inactive') print(planet.position) Planet.objects.get_or_create(galaxy=galaxy, system=system, position=planet.position[2])
def pyogame(empire): succsess = True id = empire.planet_ids()[0] test(lambda: empire) test(lambda: empire.attacked()) test(lambda: empire.neutral()) test(lambda: empire.speed()) test(lambda: empire.planet_ids()) test(lambda: empire.planet_names()) test(lambda: empire.id_by_planet_name(empire.planet_names()[0])) test(lambda: empire.moon_ids()) test(lambda: empire.celestial(id)) test(lambda: empire.celestial_coordinates(id)) test(lambda: empire.resources(id)) test(lambda: empire.supply(id)) test(lambda: empire.facilities(id)) if empire.moon_ids(): test(lambda: empire.moon_facilities(empire.moon_ids()[0])) test(lambda: empire.marketplace(id, 1)) test(lambda: empire.buy_marketplace(12345, id)) test(lambda: empire.submit_marketplace(resources(metal=100), resources(crystal=60), 10, id)) test(lambda: empire.collect_marketplace()) test(lambda: empire.research()) test(lambda: empire.ships(id)) test(lambda: empire.defences(id)) test(lambda: empire.galaxy(coordinates(galaxy=1, system=1))) test(lambda: empire.ally()) test(lambda: empire.fleet()) # test(lambda: empire.phalanx(coordinates(1, 2, 3), empire.moon_ids()[0])) DANGERZONE IT GETS YOU BANNED WHEN INVALID test(lambda: empire.send_message(101175, 'Hallo'), True) test(lambda: empire.spyreports()) test(lambda: empire.send_fleet(mission=mission.transport, id=id, where=empire.celestial_coordinates( empire.planet_ids()[1]), ships=[ships.large_transporter(1)])) test(lambda: empire.return_fleet(12345)) test(lambda: empire.build(what=buildings.solar_satellite(1), id=id)) test(lambda: empire.do_research(research=research.graviton, id=id)) test(lambda: empire.collect_rubble_field(id=id)) test(lambda: empire.is_logged_in()) test(lambda: empire.logout()) test(lambda: empire.relogin()) test(lambda: empire.logout()) if succsess is True: print('All test completed') else: raise BaseException('Test was not completed')