def settings_menu(): all_settings = list(setting_info.keys()) while True: list_items([ pad_text(k, 19) + v[0] + (" " if v[0] else "") + "Default: " + str(v[1]) + " | " "Current: " + settings.get(k) for k, v in setting_info.items() ] + ["(Finish)"]) i = input_number(len(all_settings), default=-1) if i == len(all_settings): output("Done editing settings. ", "menu") return else: key = all_settings[i] output(key + ": " + setting_info[key][0], "menu") output("Default: " + str(setting_info[key][1]), "menu", beg='') output("Current: " + str(settings[key]), "menu", beg='') new_value = input_line("Enter the new value: ", "query") if len(new_value.strip()) == 0: output("Invalid value; cancelling. ", "error") continue output(key + ": " + setting_info[key][0], "menu") output("Current: " + str(settings[key]), "menu", beg='') output("New: " + str(new_value), "menu", beg='') output("Saving an invalid option will corrupt file! ", "message") if input_bool("Change setting? (y/N): ", "selection-prompt"): settings[key] = new_value try: with open("config.ini", "w", encoding="utf-8") as file: config.write(file) except IOError: output( "Permission error! Changes will not be saved for next session.", "error")
def instructions(): print('\n' + 'AID2: Clover Edition Instructions: \n' + ' Enter actions starting with a verb ex. "go to the tavern" or "attack the orc."\n' + ' To speak enter say "(thing you want to say)" or just "(thing you want to say)"\n' + ' To insert your own text into the story, enter !(thing you want to insert)') print('The following commands can be entered for any action:') print(' "/revert" Reverts the last action allowing you to pick a different action.') print(' "/quit" Quits the game and saves') print(' "/menu" Starts a new game and saves your current one') print(' "/retry" Retries the last action') print(' "/restart" Restarts the current story') print(' "/print" Prints a transcript of your adventure (without extra newline formatting)') print(' "/alter" Edit the last prompt from the AI') print(' "/altergen" Edit the last result from the AI and have it generate the rest') print(' "/context" Edit the story\'s permanent context paragraph') print(' "/remember [SENTENCE]" Commits something permanently to the AI\'s memory') print(' "/forget" Opens a menu allowing you to remove permanent memories') print(' "/save" Saves your game to a file in the game\'s save directory') print(' "/load" Loads a game from a file in the game\'s save directory') print(' "/summarize" Create a new story using by summarizing your previous one') print(' "/help" Prints these instructions again') print(' "/set [SETTING] [VALUE]" Sets the specified setting to the specified value.:') for k, v in setting_info.items(): print(pad_text(' ' + k, 27) + v[0] + (" " if v[0] else "") + "Default: " + str(v[1]) + " | " "Current: " + settings.get(k))
def instructions(): print( '\n' + 'AID2: Инструкции \n' + ' Описывай действия с глагола т.е. "идешь в таверну", "взмахнул мечом""\n' + ' Для описания диалога используй конструкцию ">ты говоришь что-то" или "" для прямой речи"\n' + ' Чтобы вставить свою историю в текст введи !(сюжетный_текст)\n' + ' Если кажется, что модель не договорила и оборвалась на полуслове то отправь пустой текст (просто enter нажми) и модель допишет текст' ) print('The following commands can be entered for any action:') print( ' "/revert" Reverts the last action allowing you to pick a different action.' ) print(' "/quit" Quits the game and saves') print( ' "/menu" Starts a new game and saves your current one' ) print(' "/retry" Retries the last action') print(' "/restart" Restarts the current story') print( ' "/print" Prints a transcript of your adventure (without extra newline formatting)' ) print(' "/alter" Edit the last prompt from the AI') print( ' "/altergen" Edit the last result from the AI and have it generate the rest' ) print( ' "/context" Edit the story\'s permanent context paragraph' ) print( ' "/remember [SENTENCE]" Commits something permanently to the AI\'s memory' ) print( ' "/forget" Opens a menu allowing you to remove permanent memories' ) print( ' "/save" Saves your game to a file in the game\'s save directory' ) print( ' "/load" Loads a game from a file in the game\'s save directory' ) print( ' "/summarize" Create a new story using by summarizing your previous one' ) print(' "/help" Prints these instructions again') print( ' "/set [SETTING] [VALUE]" Sets the specified setting to the specified value.:' ) for k, v in setting_info.items(): print( pad_text(' ' + k, 27) + v[0] + (" " if v[0] else "") + "Default: " + str(v[1]) + " | " "Current: " + settings.get(k))