Eigenbahn / ai-dungeon-cli

:european_castle: A cli client to play.aidungeon.io
MIT License
149 stars 33 forks source link

Crash when input is empty #22

Closed otreblan closed 4 years ago

otreblan commented 4 years ago
 ▄▄▄       ██▓   ▓█████▄  █    ██  ███▄    █   ▄████ ▓█████  ▒█████   ███▄    █
▒████▄    ▓██▒   ▒██▀ ██▌ ██  ▓██▒ ██ ▀█   █  ██▒ ▀█▒▓█   ▀ ▒██▒  ██▒ ██ ▀█   █
▒██  ▀█▄  ▒██▒   ░██   █▌▓██  ▒██░▓██  ▀█ ██▒▒██░▄▄▄░▒███   ▒██░  ██▒▓██  ▀█ ██▒
░██▄▄▄▄██ ░██░   ░▓█▄   ▌▓▓█  ░██░▓██▒  ▐▌██▒░▓█  ██▓▒▓█  ▄ ▒██   ██░▓██▒  ▐▌██▒
 ▓█   ▓██▒░██░   ░▒████▓ ▒▒█████▓ ▒██░   ▓██░░▒▓███▀▒░▒████▒░ ████▓▒░▒██░   ▓██░
 ▒▒   ▓▒█░░▓      ▒▒▓  ▒ ░▒▓▒ ▒ ▒ ░ ▒░   ▒ ▒  ░▒   ▒ ░░ ▒░ ░░ ▒░▒░▒░ ░ ▒░   ▒ ▒
  ▒   ▒▒ ░ ▒ ░    ░ ▒  ▒ ░░▒░ ░ ░ ░ ░░   ░ ▒░  ░   ░  ░ ░  ░  ░ ▒ ▒░ ░ ░░   ░ ▒░
  ░   ▒    ▒ ░    ░ ░  ░  ░░░ ░ ░    ░   ░ ░ ░ ░   ░    ░   ░ ░ ░ ▒     ░   ░ ░
      ░  ░ ░        ░       ░              ░       ░    ░  ░    ░ ░           ░
                  ░

Pick a setting...

1) fantasy
2) mystery
3) apocalyptic
4) zombies
5) cyberpunk
6) custom
7) archive
8) madlib
> 1
Select a character...

1) noble
2) knight
3) squire
4) wizard
5) ranger
6) peasant
7) rogue
> 1
Enter your character's name...

> 1
Generating story... Please wait...

 You are 1, a noble living in the kingdom of Larion. You have a pouch of gold
and a small dagger. You are awakened by one of your servants who tells you that
your keep is under attack. You look out the window and see the enemy
approaching.  "Run!" you shout, but there is no time to run now. The soldiers
surround your keep and begin firing their muskets at it as well as throwing
stones from the walls. They are relentless and soon all that remains is for you
to make a choice...

> 
Traceback (most recent call last):
  File "/usr/bin/ai-dungeon-cli", line 11, in <module>
    load_entry_point('ai-dungeon-cli==0.3.0', 'console_scripts', 'ai-dungeon-cli')()
  File "/usr/lib/python3.8/site-packages/ai_dungeon_cli/__init__.py", line 589, in main
    ai_dungeon.start_game()
  File "/usr/lib/python3.8/site-packages/ai_dungeon_cli/__init__.py", line 278, in start_game
    self.process_next_action()
  File "/usr/lib/python3.8/site-packages/ai_dungeon_cli/__init__.py", line 545, in process_next_action
    self.process_regular_action(user_input)
  File "/usr/lib/python3.8/site-packages/ai_dungeon_cli/__init__.py", line 491, in process_regular_action
    (action, user_input) = self.find_action_type(user_input)
  File "/usr/lib/python3.8/site-packages/ai_dungeon_cli/__init__.py", line 482, in find_action_type
    elif user_input[0] == '"' and user_input[-1] == '"':
IndexError: string index out of range
p3r7 commented 4 years ago

Hey!

Thanks for reporting. Now fixed with 0.3.1.

They seems to be quite aggressive with the API changes lately. I've observed 2 total API overhaul in a week time.

The one currently in use by ai-dungeon-cli seems to have been replaced with a new one in GraphQL since yesterday it seems.