rjb25 / 5e-dm-assistant

An assistant python script to be run for keeping track of health and automatically running attacks in combat for dnd 5e
1 stars 1 forks source link

CLI loop closes after normal command #8

Closed v6 closed 3 years ago

v6 commented 3 years ago

Output:


5e-dm-assistant[develop-nathan-argparse !?]$ python3 basic.py 
initiative name type hp/max_hp
22 giant-rat giant-rat 3/3
12 sahuagin#1 sahuagin 11/11
9 goblin goblin 9/9
3 druid druid 21/23
Command?giant-rat
incorrect command
initiative name type hp/max_hp
22 giant-rat giant-rat 3/3
12 sahuagin#1 sahuagin 11/11
9 goblin goblin 9/9
3 druid druid 21/23
Command?action --times 2 --sender goblin --do Multiattack --target druid 
This combatant cannot multiattack
This combatant cannot multiattack
initiative name type hp/max_hp
22 giant-rat giant-rat 3/3
12 sahuagin#1 sahuagin 11/11
9 goblin goblin 9/9
3 druid druid 21/23
Command?action --times 2 --sender goblin --do Bite --target druid       
Invalid action for this combatant
Invalid action for this combatant
5e-dm-assistant[develop-nathan-argparse !?]$ action --times 2 --sender sahuagin#1 --do Multiattack --target druid

Command 'action' not found, did you mean:

  command 'actiona' from deb actiona (3.10.1-1)

Try: sudo apt install <deb name>

5e-dm-assistant127[develop-nathan-argparse !?]$ python3 basic.py
initiative name type hp/max_hp
22 giant-rat giant-rat 3/3
12 sahuagin#1 sahuagin 11/11
9 goblin goblin 9/9
3 druid druid 21/23
Command?action --times 2 --sender sahuagin#1 --do Multiattack --target druid
invalid advantage type
1d20
1d4+1
invalid advantage type
1d20
1d6+1
invalid advantage type
1d20
invalid advantage type
1d20
1d4+1
5e-dm-assistant[develop-nathan-argparse !?]$ action --times 2 --sender sahuagin#1 --do Multiattack --target druid --advantage 0

Command 'action' not found, did you mean:

  command 'actiona' from deb actiona (3.10.1-1)

Try: sudo apt install <deb name>

5e-dm-assistant127[develop-nathan-argparse !?]$ python3 basic.py 
initiative name type hp/max_hp
22 giant-rat giant-rat 3/3
12 sahuagin#1 sahuagin 11/11
9 goblin goblin 9/9
3 druid druid 21/23
Command?action --times 2 --sender sahuagin#1 --do Multiattack --target druid --advantage 0
1d20
1d20
1d20
1d20
5e-dm-assistant[develop-nathan-argparse !?]$ python3 basic.py 
initiative name type hp/max_hp
22 giant-rat giant-rat 3/3
12 sahuagin#1 sahuagin 11/11
9 goblin goblin 9/9
3 druid druid 21/23
Command?action --times 2 --sender sahuagin#1 --do Multiattack --target druid --advantage 0
1d20
1d20
1d20
1d20
1d4+1
5e-dm-assistant[develop-nathan-argparse !?]$ 

Expected behavior is that I will get another prompt, but the program just returns to the regular Terminal.

rjb25 commented 3 years ago

Resolved. Issue was '' equating to False when evaluating if we are running.