fix interactive selection

This commit is contained in:
Mylloon 2023-04-01 16:26:55 +02:00
parent 342b07e6ea
commit efc3a07ee2
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

14
main.py
View file

@ -23,7 +23,6 @@ if __name__ == "__main__":
# Interactive selection
if (c_id == []):
# Cheat list
print("Enter 0 to exit.")
print("You can run multiples cheat at once, separate your choices with a space.")
print("Available cheats:")
for idx, cheat in enumerate(c.cheats_list):
@ -33,17 +32,14 @@ if __name__ == "__main__":
try:
response = [int(i) for i in input("Enter ID: ").split(" ")]
for i in response:
match i:
case 0:
exit(0)
case j if j > len(c.cheats_list):
raise IndexError
case _:
c_id.append(i - 1)
if (i > len(c.cheats_list) or i <= 0):
raise IndexError
c_id.append(i - 1)
except KeyboardInterrupt:
print("??\nBye.")
print("Bye")
exit(1)
except:
c_id = []
print("Invalid ID.")
# Instanciate and run threads