forked from Pbatch/ClashRoyaleBuildABot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (22 loc) · 786 Bytes
/
main.py
File metadata and controls
30 lines (22 loc) · 786 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
30
from datetime import datetime
import sys
import threading
import time
from clashroyalebuildabot.bot.example.custom_bot import CustomBot
start_time = datetime.now()
def update_terminal_title():
while True:
elapsed_time = datetime.now() - start_time
hours, remainder = divmod(elapsed_time.total_seconds(), 3600)
minutes, seconds = divmod(remainder, 60)
formatted_time = f"{int(hours):02}:{int(minutes):02}:{int(seconds):02}"
sys.stdout.write(f"\x1b]2;{formatted_time} | BuildABot\x07")
sys.stdout.flush()
time.sleep(1)
def main():
bot = CustomBot(debug=False)
bot.run()
if __name__ == "__main__":
title_thread = threading.Thread(target=update_terminal_title, daemon=True)
title_thread.start()
main()