From 8eb0967848ff53e086d8c079754090b28fa5ab49 Mon Sep 17 00:00:00 2001 From: martmists Date: Thu, 14 Mar 2019 19:17:50 +0100 Subject: [PATCH] Update the packet more often This will improve accuracy in overlay --- rlbot_gui/gui.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/rlbot_gui/gui.py b/rlbot_gui/gui.py index 79292038..da9f991f 100644 --- a/rlbot_gui/gui.py +++ b/rlbot_gui/gui.py @@ -1,4 +1,6 @@ import os +import time +from threading import Thread import webbrowser import eel @@ -254,8 +256,17 @@ def start(): eel.start('main.html', size=(1000, 800), block=False, callback=on_websocket_close, options=options, disable_cache=True) + def reload_packet(): + while True: + global game_tick_packet + game_tick_packet = packet_reader.get_packet() + time.sleep(1/120) + + th = Thread(target=reload_packet) + th.start() + while not should_quit: - global game_tick_packet - game_tick_packet = packet_reader.get_packet() do_infinite_loop_content() eel.sleep(1.0) + + th.join()