-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·26 lines (25 loc) · 796 Bytes
/
Copy pathmain.py
File metadata and controls
executable file
·26 lines (25 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import threading
import logging
import config
import utils.helpers.log_color
from gui.master import MasterGUI
from network.game_state import GameState
from utils.helpers.admin import *
from network.network_sniffer import NetworkSniffer
from ai.player import Player
if __name__ == '__main__':
logging.basicConfig(level=config.LOGGING_LEVEL)
# ask_admin_access()
gui = MasterGUI()
gui.onAfter()
game_state = GameState(gui, config.PLAYERS[0]['name'])
lock = threading.Lock()
ns = NetworkSniffer(game_state, lock)
logging.info("Starting bot")
ns.start()
player = Player(config.PLAYERS[0], game_state)
gui.attach(player)
player.start()
gui.mainloop()
if ns in threading.enumerate():
interrupt_thread(ns.ident)