-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (22 loc) · 697 Bytes
/
main.py
File metadata and controls
29 lines (22 loc) · 697 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
27
28
29
from SocketManager import SocketManager
import appleBot
import cursor
import logging
# CONFIG
IP = "127.0.0.1"
PORT = 3490
RETRY_INTERVAL = 1
BOT_VERSION = 9
RECV_TIMEOUT = 0.1
logging.basicConfig(format='[%(asctime)s] [%(levelname)-8s] --- [%(module)-14s]: %(message)s',
level=logging.INFO,
force=True)
if __name__ == "__main__":
cursor.hide()
# initialize connection and wait for it to establish
sock_manager = SocketManager(IP, PORT, RETRY_INTERVAL, BOT_VERSION, RECV_TIMEOUT)
# initialize bot object
bot = appleBot.AppleBot(sock_manager)
# loop until connection breaks
while sock_manager.connected:
bot.loop()