Stargate IRC bot
A small IRC bot, written in Perl, that dials random Stargate addresses and draws the gate. It exists in two versions with the same commands. The copy running in ##aussies on Rizon is the ZNC-module version, fartbot (see the Solar and fartbot guide for what it does there).
| Command | Does |
|---|---|
!dial |
Dials a random seven-glyph gate address |
!gate |
Posts the gate picture from gate.txt, at most once a minute per channel |
!help |
Lists the commands |
1. Standalone bot (Bot::BasicBot::Pluggable)
sudo apt install libbot-basicbot-pluggable-perl libpoe-component-sslify-perl
cp sgbot.conf.example sgbot.conf # then edit it
perl sgbot.pl
It can connect straight to the IRC server or go through ZNC (see the example config). When connecting directly with invite = 1, it identifies to NickServ, asks ChanServ for an invite and then joins. Its nick needs ChanServ access on the channel.
2. ZNC module (modperl)
sudo apt install znc znc-perl
cp znc/stargate.pm ~/.znc/modules/
Then, from your IRC client connected to ZNC:
/msg *status loadmod --type=global modperl (once, as a ZNC admin)
/msg *status loadmod stargate /full/path/to/gate.txt
The module answers as the ZNC user it's loaded on. To make it a separate bot, create a dedicated ZNC user, for example sgbot, and load it there.
Notes
- The gate picture is plain text in
gate.txt(about 35 lines); replace it with any ASCII art you like. - Cooldown:
!gateis limited so the bot cannot flood a channel. - Perl strings that go through ZNC's modperl are encoded to UTF-8 on output, so read any text file with
:encoding(UTF-8).