def go(self):
run_counter = 0
#lets you get mouse over dota
while run_counter < self.max_runs:
run_counter += 1
self.run = Run(self.db.get_num_results() + 1)
print("Hi")
time.sleep(2.5)
self.run.start_game()
self.run.set_logs() # Shouldnt matter that this occurs after game launch. I only care about logs around pull
self.run.follow_bot()
self.run.wait_for_pull() # ASYNCIO time?
self.run.dump_console()
self.run.restart()
self.run.delay(pa.click, 282, 748, delay_secs=3) # click the skip button
# At this point the bot script sends the new result to database
new_result = self.run.read_log()
self.db.add_run(self.run.id, new_result)
time.sleep(0.01) # this is only because I expected game to send result to elastic search. not python
result = Result(self.db.get_run(self.run.id))
self.neural_net.add_result(result)
self.neural_net.iterate_weights_2(100)
# print(self.neural_net.weights)
logger.info(self.neural_net)
self.neural_net.update_params()
#self.run.read_log() # TODO this bit can be async whilst we are starting the next game
评论列表
文章目录