Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def menunode_skill_input(caller, raw_string, **kwargs):
- player_input = raw_string
- logger.log_msg(f"player_input: {player_input}")
- text = ""
- skill = ""
- amt = ""
- n = 0
- change = 0
- failed = False
- if not player_input:
- failed = True
- else:
- if not " " in player_input:
- failed = True
- else:
- for n in player_input:
- logger.log_msg(f"n is: {n}")
- if n.isnumeric():
- amt += n
- else:
- skill += n
- logger.log_msg(f"Skills: {skill} | Amt: {amt}")
- if not skill or not amt:
- failed = True
- else:
- skill = skill.strip()
- amt = amt.strip()
- if failed:
- text += (f"You must include the skill name and amount to add.\nExample: |gAcrobatics 5|n.")
- options = {"key": "Continue",
- "desc": "Add Points",
- "goto": _menunode_skills }
- return text, options
- # ........
- def _menunode_skills(caller, raw_string, **kwargs):
- # etc, stuff here...
- options = ({"key": "_default",
- "goto": (menunode_skill_input)},
- {"key":"Back",
- "desc":"Set Your stats",
- "goto": "menunode_assign_stats"})
- return text, options
- # below works fine... only difference with that node goto is it's in "" instead
- def menunode_assign_skills(caller, raw_string, **kwargs):
- # etc etc ...
- options = ( {"key": "Continue",
- "desc": "Add Points",
- "goto": ("menunode_skills") },
- {"key":"Back",
- "desc":"Set Your Stats",
- "goto": "menunode_assign_stats"})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement