Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def craft_item(input_text): # example modification to adjust to AIDungeon input
- parts = input_text.lower().split() #Convert the input to lowercase, and then split it into a list of words.
- if len(parts) < 2 || len(parts) > 2: #if the player input is not two parts (the item to craft and a number)
- return "Invalid crafting command. Use /craft <craftItem> <material> <material2> ... <amountToCraft>"
- number_crafts = parts[-1]
- requested_item = parts[0:-1]
- crafted_item = parts[1]
- # Milly what is the correct syntax here to get the second inputted numeric?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement