I am trying to fix a Text RPG I made and I just need to know how to get a value out of an error.
I need to do this so I can make a system that allows you to put in a string and output some data for the game.
if VauleError == True:
retry()
So what I'm using it for is this.
while do == "" or do.len(4):
cls()
do = input("Data? (Press enter if nothing.)")
if do == "":
while " " in name:
name = input("Name the hero. ")
if " " in name:
input("Please don't use spaces")
cls()
else:
try:
name = str(do.split()[0])
kills = int(do.split()[1])
extra_hp = int(do.split()[2])
extra_dmg = int(do.split()[3])
gold = int(do.split()[4])
except ValueError:
input("Invalid Save.")
cls()
else:
input("Save Loaded.")
I don't know how i would do it. The cls() is clear screen.