Advertisement
Aquashift108

Modified

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