next generation markov chain irc shitposting bot
Go to file
Al Beano 845e419089 cool new stuff 2020-05-21 23:24:51 +01:00
MarkovBot -f option 2016-09-05 12:26:10 +01:00
.gitignore experimental export function 2016-07-06 11:56:49 +01:00
LICENSE initial commit 2016-02-25 22:39:06 +00:00
MarkovBot.pl Respond when highlighted 2020-05-21 01:01:34 +01:00
README.md cool new stuff 2020-05-21 23:24:51 +01:00
config.default.yml Respond when highlighted 2020-05-21 01:01:34 +01:00
cpanfile choice between two RNGs 2016-07-19 14:14:11 +01:00
export-brain.pl bugfixes and fine tuning for import/export 2016-07-06 14:31:28 +01:00
import-brain.pl bugfixes and fine tuning for import/export 2016-07-06 14:31:28 +01:00

README.md

cool new stuff

shithead-ng has been superseded by 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.

important

recent config changes:

  • target_words option
  • irc_channel changed to irc_channels
  • respond_on_highlight option

If you do not update your config.yml file to reflect these changes, shithead-ng will not work!

shithead-ng

next generation markov chain irc shitposting bot

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

First, set up dependencies. You need a redis server and the necessary perl modules:

# 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
cd shithead-ng
cpanm --installdeps .
# or, to avoid setting up local::lib:
cpanm --sudo --installdeps .

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.

# 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
# 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!

Command line options

-f: specify a YAML config file for shithead-ng to use. Defaults to /path/to/shithead-ng/config.yml.

Exporting the brainfile

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.