Install an ircbot that handles greetings of certain users

480 views Asked by At

I want to greet a certain user ffki-besucher in a certain IRC channel. Whenever that user logs in, it should get a special message written directly into the channel. I heard weechat is a good solution, but how can I achieve this?

How do I install weechat on debian wheezy?

I already installed some packages:

apt-get install weechat-curses weechat-plugins weechat-scripts perl

I use this cool guide at https://weechat.org/files/doc/stable/weechat_quickstart.en.html

Then I start weechat as user (not root):

weechat-curses

(in case you want to quit, use /quit)

Now I need the scripts, but I am stuck how to get this command running:

/script install buffers.pl

I also tried to load the script plugin again with

/plugin autoload script

The script plugin seems to be missing on debian! weechat in debian wheezy is quite old (0.3.8 which has a bug that the script plugin is not included in the debian package)

(I tried to install weechat from jessie, but that would give dependencie problems with some pelrl libs, that go down to the kernel)

2

There are 2 answers

0
rubo77 On BEST ANSWER

Install irssi instead:

apt-get install irssi

su into your user and add the trigger.pl script. create:

mkdir -p ~/.irssi/scripts
cd ~/.irssi/scripts
git clone https://github.com/coekie/irssi-scripts/ coeki-irssi-scripts
ln -s coeki-irssi-scripts/trigger.pl
mkdir autorun
cd autorun
ln -s ../trigger.pl

Now start irssi as user

/connect irc.hackint.org
/join #ffki
/nick bot-rubo77

You can later edit your ~/.irssi/config file to autojoin your server and channel with a certain nick:

{ address = "irc.hackint.net"; chatnet = "hackint"; port = "6697"; use_ssl="yes"; autoconnect="yes"; },
...
chatnets = {
  hackint = {
    type = "IRC";
    nick="bot-rubo77";
  };
};

change to the status window (ESC 1) and create the trigger:

/trigger add -joins -channels "#ffki" -masks "*ffki-b*@*" -command "msg #ffki Hi $N! Please be patient! Not everyone is at the keyboard but you will be noticed in a few minutes ..." 
/trigger save

some tips:

  • ESC 1 - switch to status window
  • ESC 2 - switch to window 2 (usually your first chat window) ...
  • /names shows all users in the channel
  • you can change the trigger in ~/.irssi/triggers and then type /trigger reload in the status window
0
rubo77 On

Uninstall the repository packages with

apt-get remove weechat*

and install the new packages directly from the weechat download site which are version 1.0.1-1:

cd /tmp/
wget https://weechat.org/debian/dists/stable/main/binary-amd64/weechat-core_1.0.1-1_amd64.deb
wget https://weechat.org/debian/dists/stable/main/binary-amd64/weechat-curses_1.0.1-1_amd64.deb
wget https://weechat.org/debian/dists/stable/main/binary-amd64/weechat-plugins_1.0.1-1_amd64.deb

install guile:

aptget install guile-2.0-libs

then install the packages:

dpkg -i weechat-*

Now you can start weechat as user (not as root) and install the scripts:

/script install buffers.pl
/script install jnotify.pl

Connect to your server:

/server add oftc irc.oftc.net/6667

further set your connection like described here: https://weechat.org/files/doc/stable/weechat_quickstart.en.html#irc_server_options

some tips:

  • autocomplete with TAB or Shift-TAB
  • change buffer with Alt+1 or Alt+2,...
  • install beep.pl to send a notification through screen to your desktop (needs some configuration)
  • use /help jnotify to achieve the auto notifications to certain users, etc