Translations of this page:
  • English (USA)
  • Deutsch (German)

Vordefinierte Antworten mit ANSWERS.txt

Siehe auch: ”answer” and ”dia

Ausführliches Beispiel

Nach dem Hinsetzen erscheint ein Dialog, der eine Eingabe erfordert:


"Please choose your dance below..."

    [Randomize]            [Dance01]

Was tun?

Datei c:\…\PikkuBot\config\ANSWERS.txt:

Möglichkeit 1

Mittels der Dialog-Funktion ist dies ausgesprochen einfach zu bewerkstelligen:

Einzige Vorbereitung ist das Kommando dia , welches den Dialog Modus einschaltet.
Weiterhin schaltet bitte eine instant-answer mit answer- aus.

Nun noch mit remember 1 dem bot sagen, dass er sich die Auswahl merken soll,
sofern das gewünscht ist.

Es erscheint der Dialog in der Bot GUI, analog zu dem Standard-Viewer:

Nun einfach den entsprechenden Knopf gedrückt,
und es erscheint die Meldung:

> 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


Die Antwort ist also gespeichert, und der bot hat seine Antwortliste auch gleich neu eingeladen.
Auch verschachtelte Dialoge sind so natürlich möglich.
Ein upndown Test zeigt:

> [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

Anzumerken ist lediglich, dass, sofern die ANSWERS.txt schon einmal per Hand bearbeitet habt,
sich der Cursor in einer neuen Zeile befinden muss, bevor die “dia” Funktion genutzt wird,
also gegebenenfalls die ANSWERS.txt noch einmal mit einem Text-Editor öffnen
und hinter der letzten Zeile einmal ENTER drücken.

Möglichkeit 2

Eine Zeile in der Datei ANSWERS.txt anlegen mit folgenden Spalten:
(Die Spalten werden voneinander mit Tab getrennt!)

1. Spalte
   Text anhand dessen dieser Eintrag identifiziert wird, bei unserem Beispiel also
   "Please choose" (ohne Anführungszeichen)
   oder
   "your dance below..." (auch ohne Anführungszeichen)

TAB

2. Spalte
   Der Text der Antwort, in diesem Fall also
   "Randomize" (ohne Anführungszeichen)

Datei

Datei ANSWERS.txt:

#
# ANSWERS.txt Example-File
# 

#
# Marki Young's Sunbathing Towel v1.02 test
#
# 1. The sentence to look for is "Click right anti Bot button"
# 2. We start to count at the Substring "button "
# 3. We count 4 columns after the beginning of "button"
#                                                1234567
#                                                      ^
#                                                      here is the Answer!
# 4. We have a one char answer
#
#
Click right anti Bot button 	button 	7	1

#
# Marki Young's Camping Cart
#
# 1. The sentence to look for is "otherweise you be auto kicked after"
# 2. We start to count at the Substring "Button "
# 3. We count 4 columns after the beginning of "Button"
#                                                1234567
#                                                      ^
#                                                      here is the Answer!
# 4. We have a one char answer
#
#
otherweise you be auto kicked after	Button 	7	1

#
# Some Camping towels
#
# 1. The sentence to look for is "As a protection against camping"
# 2. We start to count at the Substring "following"
# 3. We count 18 columns after the beginning of "following word..."
#                                                 123456789012345678
#                                                                  ^
#                                                                  here begins the Answer!
# 4. We have a multi char answer
#
#
As a protection against camping	following word...	18



de/topics/answers.txt.txt · Last modified: 2009/09/03 19:07 by rebekka
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0