Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
added voting by name
Browse files Browse the repository at this point in the history
  • Loading branch information
TimShaw1 committed Jun 25, 2023
1 parent 35b0942 commit 06006ec
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions chatGPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ def get_dead_players():
line = f.readline().rstrip()
return [translatePlayerColorID(int(x)) for x in line.strip('][').split(", ")[:-1]]

names_dict = {}
def get_names_dict():
with open(MEETING_PATH) as f:
f.readline().rstrip()
f.readline().rstrip()
big_long_input = f.readline().rstrip().strip('][').split(", ")
for item in big_long_input:
item = item.split("/")
names_dict[item[0]] = int(item[1])
return names_dict

def get_last_task():
with open("last_task.txt") as f:
line = f.readline().rstrip()
Expand Down Expand Up @@ -226,6 +237,8 @@ def vote(color : str = "SKIP"):
print("Rate limit reached")
break

get_names_dict()

while time.time() - meeting_start_time < get_meeting_time() - 4:
time.sleep(1/15)

Expand All @@ -240,6 +253,10 @@ def vote(color : str = "SKIP"):
for color1 in col_array:
if color1 in res.upper() and color1 != color:
c = color1
if c == "skip":
for name in names_dict:
if name.lower() in res.lower() and translatePlayerColorID(names_dict[name]) != color:
c = translatePlayerColorID(names_dict[name])
print("Vote: " + res)
print(c)
vote(c.upper())
2 changes: 1 addition & 1 deletion last_area.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Security
Cafeteria
2 changes: 1 addition & 1 deletion last_task.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Divert Power in Security
nothing. No tasks completed yet

0 comments on commit 06006ec

Please sign in to comment.