shithead-ng/README.md

93 lines
2.6 KiB
Markdown
Raw Permalink Normal View History

2020-05-22 00:24:51 +02:00
## cool new stuff
shithead-ng has been superseded by [shithead-X](https://github.com/albino/shithead-X), which uses very fancy GPT-2 instead of old and boring Markov chains. but if you submit an issue to shithead-ng I will still answer it.
2016-09-03 13:10:43 +02:00
## important
2016-09-04 12:39:30 +02:00
recent config changes:
- target_words option
- irc_channel changed to irc_channels
2020-05-21 02:02:44 +02:00
- respond_on_highlight option
2016-09-04 12:39:30 +02:00
If you do not update your config.yml file to reflect these changes, shithead-ng will not work!
2016-09-03 13:10:43 +02:00
2016-02-25 23:39:06 +01:00
# shithead-ng
2016-06-04 22:16:56 +02:00
next generation markov chain irc shitposting bot
2016-07-04 23:17:20 +02:00
### The problem
The original shithead uses far too much ram and is badly implemented.
### The solution
Let's reimplement it and get redis to do all the heavy lifting.
## Getting Started
2016-07-06 15:56:00 +02:00
First, set up dependencies. You need a redis server and the necessary perl modules:
2016-07-05 13:50:49 +02:00
```bash
# install cpanminus with your package manager of choice (preferred), or install it through cpan:
cpan App::cpanminus
# clone the git repo if you haven't already, then install the perl modules
git clone https://neetco.de/albino/shithead-ng
2016-09-03 13:15:48 +02:00
cd shithead-ng
cpanm --installdeps .
2016-07-05 13:50:49 +02:00
# or, to avoid setting up local::lib:
2016-09-03 13:15:48 +02:00
cpanm --sudo --installdeps .
2016-07-05 13:50:49 +02:00
```
Next, you need a brainfile. A brainfile is simply an irc log with all joins, parts, timestamps and nicknames stripped. In other words, it contains only what was said.
2016-07-04 23:17:20 +02:00
```bash
# if you have an old brainfile, import it into redis
perl import-brain.pl /home/you/brainfile
# this can take a long time (about ten minutes for me), so be patient
```
```bash
# now, you need a config file
cp config.default.yml config.yml
# edit the values in config.yml to your choosing
```
Now, just run `perl MarkovBot.pl`.
## Commands
* .shitposting - controls the % of messages the bot will reply to
```
< user> .shitposting 1.5
< shithead-ng> OK
```
* .ignore - make the bot totally ignore a user (useful for bots)
```
< user> .ignore bot
< shithead-ng> Now ignoring bot.
```
* .unignore - removes a user from the ignore list
```
< user> .unignore bot
< shithead-ng> No longer ignoring bot.
```
* .ping - check that shithead-ng is still alive
```
< user> .ping
< shithead-ng> Pong!
```
2016-07-06 12:56:49 +02:00
2016-09-05 13:26:10 +02:00
## Command line options
```text
-f: specify a YAML config file for shithead-ng to use. Defaults to /path/to/shithead-ng/config.yml.
```
2016-07-06 12:56:49 +02:00
## Exporting the brainfile
```bash
perl export-brain.pl > brain
```
This produces a shithead-ng brainfile which cannot (currently) be read by other programs. This is because the redis database does not contain enough information to reconstruct the brainfile it was created from. This file can, however, be read by shithead-ng's import-brain.pl.