shithead-ng/README.md

65 lines
1.7 KiB
Markdown
Raw Normal View History

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-05 13:50:49 +02:00
First, set up dependencies. You need a redis server running locally (currently, AUTH and remote servers are not supported, this will be supported in the future) and the necessary perl modules:
```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
cpanm --installdeps shithead-ng
# or, to avoid setting up local::lib:
cpanm --sudo --installdeps shithead-ng
```
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!
```