Example updates
This commit is contained in:
parent
1d0645b490
commit
b8d7cc8d7c
@ -29,7 +29,7 @@ def _battle_launcher(player: Citizen):
|
|||||||
"""
|
"""
|
||||||
global CONFIG
|
global CONFIG
|
||||||
finished_war_ids = {*[]}
|
finished_war_ids = {*[]}
|
||||||
war_data = CONFIG.get('start_battles', {})
|
war_data = CONFIG.get('battle_launcher', {})
|
||||||
war_ids = {int(war_id) for war_id in war_data.keys()}
|
war_ids = {int(war_id) for war_id in war_data.keys()}
|
||||||
next_attack_time = player.now
|
next_attack_time = player.now
|
||||||
next_attack_time = next_attack_time.replace(minute=next_attack_time.minute // 5 * 5, second=0)
|
next_attack_time = next_attack_time.replace(minute=next_attack_time.minute // 5 * 5, second=0)
|
||||||
@ -45,7 +45,7 @@ def _battle_launcher(player: Citizen):
|
|||||||
|
|
||||||
status = player.get_war_status(war_id)
|
status = player.get_war_status(war_id)
|
||||||
if status.get('ended', False):
|
if status.get('ended', False):
|
||||||
CONFIG['start_battles'].pop(war_id, None)
|
CONFIG['battle_launcher'].pop(war_id, None)
|
||||||
finished_war_ids.add(war_id)
|
finished_war_ids.add(war_id)
|
||||||
continue
|
continue
|
||||||
elif not status.get('can_attack'):
|
elif not status.get('can_attack'):
|
||||||
@ -64,7 +64,15 @@ def _battle_launcher(player: Citizen):
|
|||||||
player.update_war_info()
|
player.update_war_info()
|
||||||
battle_id = player.get_war_status(war_id).get("battle_id")
|
battle_id = player.get_war_status(war_id).get("battle_id")
|
||||||
if battle_id is not None and battle_id in player.all_battles:
|
if battle_id is not None and battle_id in player.all_battles:
|
||||||
player.fight(battle_id, player.details.citizenship, hits)
|
battle = player.all_battles.get(battle_id)
|
||||||
|
for division in battle.div.values():
|
||||||
|
if division.div == player.division:
|
||||||
|
div = division
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
player.report_error("Players division not found in the first round!")
|
||||||
|
break
|
||||||
|
player.fight(battle, div, battle.invader, hits)
|
||||||
break
|
break
|
||||||
player.sleep(1)
|
player.sleep(1)
|
||||||
if attacked:
|
if attacked:
|
||||||
|
@ -6,7 +6,11 @@ CONFIG = {
|
|||||||
'email': 'player@email.com',
|
'email': 'player@email.com',
|
||||||
'password': 'Pa$5w0rd!',
|
'password': 'Pa$5w0rd!',
|
||||||
'interactive': True,
|
'interactive': True,
|
||||||
'debug': True
|
'debug': True,
|
||||||
|
'work': True,
|
||||||
|
'ot': True, # Work OverTime
|
||||||
|
'wam': True, # WorkAsManager
|
||||||
|
'train': True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -14,7 +18,10 @@ CONFIG = {
|
|||||||
def main():
|
def main():
|
||||||
player = Citizen(email=CONFIG['email'], password=CONFIG['password'], auto_login=False)
|
player = Citizen(email=CONFIG['email'], password=CONFIG['password'], auto_login=False)
|
||||||
player.config.interactive = CONFIG['interactive']
|
player.config.interactive = CONFIG['interactive']
|
||||||
player.config.fight = CONFIG['fight']
|
player.config.work = CONFIG['work']
|
||||||
|
player.config.train = CONFIG['train']
|
||||||
|
player.config.ot = CONFIG['ot']
|
||||||
|
player.config.wam = CONFIG['wam']
|
||||||
player.set_debug(CONFIG.get('debug', False))
|
player.set_debug(CONFIG.get('debug', False))
|
||||||
player.login()
|
player.login()
|
||||||
now = player.now.replace(second=0, microsecond=0)
|
now = player.now.replace(second=0, microsecond=0)
|
||||||
@ -76,7 +83,7 @@ def main():
|
|||||||
tasks.update({'eat': next_time})
|
tasks.update({'eat': next_time})
|
||||||
|
|
||||||
if tasks.get('ot', dt_max) <= now:
|
if tasks.get('ot', dt_max) <= now:
|
||||||
player.write_log("Doing task: ot")
|
player.write_log("Doing task: work overtime")
|
||||||
if now > player.my_companies.next_ot_time:
|
if now > player.my_companies.next_ot_time:
|
||||||
player.work_ot()
|
player.work_ot()
|
||||||
next_time = now + timedelta(minutes=60)
|
next_time = now + timedelta(minutes=60)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user