| summaryrefslogtreecommitdiff |
diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 101 |
1 files changed, 41 insertions, 60 deletions
@@ -1,68 +1,49 @@ -# zero-of-one -(Yet another) Markov chain based IRC reply bot. +# zero-of-one-server +Server for Zero of One, a K-order Markov chain reply bot. + +## WARNING +This is an alpha version, both the software and the protocol are subject to +changes. There is currently no stable version. + +## Description +This is a multi-threaded K-order Markov chain reply bot. It uses its own +text-based protocol over UNIX sockets as only interface, meaning that it cannot +directly connect to IRC/Discord/Twitch/etc servers. Instead, it relies on +gateway applications to be the actual clients. This allows the same Zero of One +server to talk to any number of gateways (e.g. you can use the same instance of +the bot on both IRC and Discord). Moreover, it can be used while loading input +files, as those are simply considered to be gateways. + +Following the UNIX philosophy, it allows for any number of filter programs to be +set up between any number of gateway and the server, as long as they use the +protocol. + +This particular implementation of a Zero of One server keeps all its knowledge +in RAM and stores learned inputs into a text file. + +Learning multiple times the exact same input is supported, it strengthens the +links between the involved words. ## Dependencies - POSIX compliant OS. - C compiler (with C99 support). - CMake. -## Quick setup guide -``` -$ git clone https://github.com/nsensfel/zero-of-one.git -$ cd zero-of-one -$ mkdir build -$ cd build -$ cmake .. -$ make -$ ./zero_of_one -h -Usage: ./zero_of_one [option_1 option_2 ...] NICKNAME [ALIAS_1 ALIAS_2 ...] -NICKNAME is used as the IRC nickname value. -If NICKNAME or any ALIAS is found in an event, the program will reply. +## How to use? +The ZoO protocol uses text based exchanges over UNIX sockets. If you were to +use this server for an IRC bot, you'd have to at least get a Zero of One to IRC +gateway, then connect it to the server. You may also want to add filter programs +between the gateway and the server. -Available options: - [--data-filename | -df] FILENAME - Learn content from FILENAME before connecting. - Default: ./memory.txt. - [--new-data-filename | -ndf] FILENAME - Store new data learned in FILENAME. - Default: value of the --data-filename param. - [--irc-server-addr | -isa] IRC_SERVER_ADDR - Connect to this server address. - Default: irc.foonetic.net. - [--irc-server-port | -isp] IRC_SERVER_PORT - Connect to this server port. - Default: 6667. - [--irc-server-channel | -isc] IRC_SERVER_CHANNEL - Connect to this server's channel. - Default: #theborghivemind. - [--irc-username | -iu] USERNAME - Connect using this as 'username' (shown in WHOIS). - Default: zeroofone. - [--irc-realname | -ir] REALNAME - Connect using this as 'realname' (shown in WHOIS). - Default: Zero of One (bot). - [--reply-rate | -rr] REPLY_RATE - Chance to reply to an event (integer, range [0, 100]). - Default: 8. +### Starting the server. +### Adding filters. +### Adding a gateway. +### Loading data. +The recommended method of loading previously learned data into the server is to +use the Zero of One CLI gateway: +```$ cat my_storage_file | sed -e 's/^/?RL /' | ./ZoO_cli SERVER_SOCKER_NAME +``` +To load new data, it would be preferable to go through the filters instead, +and to also request the storing of the newly learned lines: +```$ cat my_new_file | sed -e 's/^/?RLS /' | ./ZoO_cli FILTER_SOCKER_NAME ``` -Note that if the NICKNAME has a uppercase character, it will never be matched by -any inputs, as all inputs are converted to lowercase. A simple solution is to -have a lowercase version of NICKNAME in the ALIAS list. - -## Main Objectives -- POSIX compliance. -- Paranoia levels of error checking. -- Low RAM usage. -- Giggles. - -## Behavior -- Replies when it reads messages containing a word matching its NICKNAME or one - of its ALIASes. -- Replies to messages with a REPLY_RATE percent chance. The word used to - construct the reply is the less known one. -- Reacts to user joining in. If the username is in enough samples, it is used - to construct the greeting, otherwise a random word is selected as starting - point. -- Repetition is taken into account and augments the strength of the links. -- Some punctuation symbols are identified (e.g. "example." will be understood - as "example" followed by "."). |


