commit 5705cd2ec34607e92341249459ce0445891d63a4 parent 1d943409c64e3a7c03ccf0459730963ce87ad589 Author: Antoine Amarilli <a3nm@a3nm.net> Date: Fri, 7 Sep 2012 19:55:18 +0200 rephrase Diffstat:
README | | | 12 | ++++++------ |
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/README b/README @@ -145,16 +145,16 @@ say to irctk in return. To do so, we will need a named FIFO: As an extremely simple interactive program, consider the following: - $ cat fifo | irctk pongbot@example.com '#chat' | + $ cat fifo | irctk pongbot@example.com '#chan' | awk '/[^<]ping/ { print "pong"; fflush() }' > fifo The awk invocation outputs "pong" whenever it sees a line containing "ping" (excluding things such as "<ping" to avoid the issue of people with a nick -starting with "ping"). Note the use of fflush(), once again to avoid buffering. -The named FIFO is used to connect irctk's stdout to awk's stdin and awk's stdout -to irctk's stdin. Note that the cat invocation is required and "<fifo" will not -work. This means that pongbot will say "pong" on chan whenever someone says -something containing "ping". +starting with "ping"). This means that pongbot will say "pong" on #chan whenever +someone says something containing "ping". Note the use of fflush(), once again +to avoid buffering. The named FIFO is used to connect irctk's stdout to awk's +stdin and awk's stdout to irctk's stdin. Note that the cat invocation is +required and "<fifo" will not work. Note that you can use your favorite programming language instead of awk. If you want to write an IRC bot in an esoteric language with no IRC library (or maybe