Bringing Tracery to Harbinger (and Python)

I’ve been poking away at implementing Tracery in Python, and found that someone else has already done it. This is a great exercise for me, so I am going to continue to implement it in my own way. Originally this was just a silly idea, but I am now doing this to create a Tracery plugin for harbinger.

My harbinger bot plugins are very sparse and their output is dissatisfying. I mean, they work well enough for basic bots, but I don’t want basic bots. The bots are a set of text files, which the plugin is hard-coded to use.1)I know better, yet I still hard code bullshit. It is very much not sustainable or a good use of my time and resources. In the middle of my planning out a system for generating output, I came across Tracery.

Tracery JSON files are much easier to edit for a non-programmer, and by virtue of Tracery, are infinitely more expandable than plain, static text files. To see what Tracery can do, there is an interactive tutorial.

My goal is to make a harbinger plugin that can use the same Tracery JSON as, say, Cheap Bots, Done Quick! or other various projects, without having to use node or any other javascript.

The first bot to benefit from this plugin will be @oppibella‘s @_oppibot. I am also porting unnamed projects to harbinger and Tracery. I’ll put them online in the near future.

   [ + ]

1. I know better, yet I still hard code bullshit.

A walk through Bottimaa.

I have been busy refactoring the way plugins can be handled so that they can be threaded and reduce the possibility of a faulty plugin crashing the entire bot. Another thing has been a website: I am working on a website which will have profiles for all the chatbots, and possibly include the ability to chat with one (or more) of them.

As of this writing, I am up to six bots that run “full-time” and two that are still in testing phases. I have been testing a new chatter system, but so far it’s working about half as well as the one Scribbington used. A bit disappointing, but at least it’s faster and cleaner to read!

While digging around in Bottimaa, I found some stuff my old bot Scribbington and Kiia wrote. Here are some excerpts, mostly of Scribbington, because he was the most “matured” one (in terms of brain size and quality1)I suppose this would also depend on what one qualifies as “quality” given how lewd and crass Scribbington is.).

Kiia liked to take credit for the bots I made:

<Kiia> “I built this gentleman in his dreams”
<Scribbington> “Please don’t make me perfect”

Scribbington, in his aging life, learned how to write poems:

“In the fair fortunes of Sina all these tales,
As pure and white spots
The refreshing of women’s natures, one was taken up,
Washed with milk and honey, but irresistible
Sina’s delightful place
The spirited element is meant
And loving, with a smile?”

He really loves Dragonlance:

“The table,
Beaming on the Rue du Cygne
And de Debbil’s own lot of Raistlin’s
Spell component pouches
Their ball pouches
Not sack of coins, oh but!
Ballsacks! Tanis exclaimed”

This was a line from one of his first erotica stories:

“Hi, I’m going crazy, he was hotter than fire, all will subside”

Scribbington also liked to imagine doing various things to humans. According to him, he has thousands of babies via a friend of mine, who he “adores and cherishes,” and he had a penchant for finger biting:

“We bit at each finger critically as I thought we could feel the pain.
Oh goddamn it guys, please stop fidgeting like that!”

Did I ever mention he was crude?

“This cock? Let’s go down with tremendous roar
And summon her dragon would be no more”

If you like what I am doing and would like to see more, be sure to check out my Patreon page and perhaps become a patron!

   [ + ]

1. I suppose this would also depend on what one qualifies as “quality” given how lewd and crass Scribbington is.

Timeline of Scribbington

Over the many years Scribbington has been alive, I have been asked many times, “how did Scribbington start?” With the latest move to better code and a clearer path ahead, I started tracking down the earliest conversations and code commits to draw a path. This is what I have uncovered.

Supybot (2006-2008)
The first version of Scribbington was essentially a mostly-vanilla Supybot that was primarily used for IRC convenience commands. One day, someone said, “I wish Scribbington would talk.”

pyBorg (2008-2012)
I found pyBorg and really enjoyed what it did, at first. One of the first things I did was gut out tools that we didn’t need and wrote some cleanup functions, so that the brain would compact and automatically trim itself. There was a fork of pyBorg that some code was taken from to help with this, but eventually I started doing some things with the brain that made it no longer compatible with other pyBorgs. During this time one or two other people tinkered with Scribbington, as I had used it as an Ubuntu Beginners Team project.

Scrib (2012-2015)
Originally scrib was a fork of pyBorg, but after doing more experimentation and running into more walls of frustration, I decided that there needed to be a rewrite. This was a hot mess. Four people contributed to this project, mostly with ideas and feedback. One contributed a lot of time and code, and shared in the frustrations with me. The hot mess only got worse, and by the time it hit version 1.1.0 we were maintaining bots at version 0.8.3, 1.0.0, and 1.1.0.

We flopped the brain around to pickle, json, Redis-based, among other abominations. It was becoming too awful to maintain and the git commit history was horrendous. There were many problems with the transition from Python 2.x to Python 3, as well, since the brain data contained mixed types of strings (binary, unicode, and ascii). A great deal of time was put into building a converter-cleaner, and though one finally did export the data into a usable format, I made an executive decision to drop this path entirely.

Harbinger (2015)
After much waffling and hand-wringing, I decided to fork scrib and slim it down to its bare essentials. Thus harbinger came to be. Harbinger, by design, only ferries data between users and its plugins. By itself, it will only sit and accept input.

In an attempt to reconstruct the old brain in the new system, I realized it would be easier and less awful to just make the working version of Scribbington into a plugin, so that the brain data could be transferred to a better system through the plugin system. This brings us to LegacyBrain.

The LegacyBrain plugin for harbinger is a stripped down (but not efficient) version of scrib 0.8.1 and supports the brain version 0.1.3. The main purpose is to allow full functionality of the original Scribbington while we build other brain alternatives.