This shows you the differences between the selected revision and the current version of the page.
topics:answers.txt 2009/01/18 14:43 | topics:answers.txt 2009/05/29 12:57 current | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Predefined answers with ANSWERS.txt ====== | ====== Predefined answers with ANSWERS.txt ====== | ||
See also: "[[:documentation:all_commands_premium#answer_text|answer]]" and "[[:documentation:all_commands_premium#dia|dia]]"\\ | See also: "[[:documentation:all_commands_premium#answer_text|answer]]" and "[[:documentation:all_commands_premium#dia|dia]]"\\ | ||
+ | |||
+ | ===== Explicit example ===== | ||
+ | After sitting down a dialog appears: | ||
+ | <code> | ||
+ | |||
+ | "Please choose your dance below..." | ||
+ | |||
+ | [Randomize] [Dance01] | ||
+ | |||
+ | </code> | ||
+ | |||
+ | **What to do?** | ||
+ | |||
+ | |||
+ | File c:\...\PikkuBot\config\**ANSWERS.txt**: | ||
+ | |||
+ | |||
+ | ===== Option 1 ===== | ||
+ | |||
+ | Using the dialogue-function is a very easy way to do this: \\ | ||
+ | |||
+ | Just activate the dialogue modus with command **dia**. \\ | ||
+ | Disable the instant-answer with **answer-** \\ | ||
+ | And enable saving of your answers with **remember 1** \\ | ||
+ | \\ | ||
+ | The dialogue modus looks like the one from your standard-viewer: \\ | ||
+ | {{blog:botview-dia.jpg|}} | ||
+ | |||
+ | __Just press the corresponding answer button:__, \\ | ||
+ | and bot answers with: | ||
+ | |||
+ | <code> | ||
+ | > OK: Answering the dialog with Randomize on channel -58541 to objectid 4c3ff1e8-d5a8-3f97-4090-d1f96c740b0e | ||
+ | > **REC: Ok, i have recorded this Question & Answer to ANSWERS.txt** | ||
+ | > OK: Trying to reload ANSWERS.txt, DYNAMIC.txt, MACROS.txt, ROBOT.txt, \\ | ||
+ | > SUPPORT.txt, RANDOM.txt, TELEPORTS.txt, AUTOSTART.txt, DANCES.txt & DONTSHOOT.txt | ||
+ | </code> \\ | ||
+ | |||
+ | So, the answer is saved, and the bot has reloaded its answer-list. | ||
+ | Test with **upndown** : | ||
+ | |||
+ | <code> | ||
+ | > [12:45:11] INFO: Your bot IS sitting now! | ||
+ | > | ||
+ | > [12:45:12] INFO: Found pre-defined Question/Answer "035d2b5790edf21370230048bffd1eea", "Randomize" is in the answer-list *g* | ||
+ | > **[12:45:13] INFO: Answering the dialog with => Randomize** | ||
+ | </code> | ||
+ | |||
+ | Just note that if you already edited the **ANSWERS.txt** by hand, \\ | ||
+ | the cursor must be placed in a new line, so edit it again, move to last line, and press ENTER once. \\ | ||
+ | |||
+ | ===== Option 2 ===== | ||
+ | <code> | ||
+ | make a line in the file **ANSWERS.txt** with the following content: | ||
+ | (seperate with a TAB !) | ||
+ | |||
+ | 1. column | ||
+ | A text which indetifies the question: | ||
+ | "Please choose" (without "") | ||
+ | or | ||
+ | "your dance below..." (also without "") | ||
+ | |||
+ | TAB | ||
+ | |||
+ | 2. column | ||
+ | the Text of the answer, in this case | ||
+ | "Randomize" (again without "") | ||
+ | |||
+ | </code> | ||
+ | |||
+ | |||
+ | |||
File c:\...\PikkuBot\config\**ANSWERS.txt**: | File c:\...\PikkuBot\config\**ANSWERS.txt**: | ||