Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 02, 2016, 12:11:14 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Irssi Bot Using Blowssi  (Read 1518 times)

TheReign

  • Participant
  • Joined in 2014
  • *
  • default avatar
  • Posts: 3
    • View Profile
    • Donate to Member
Irssi Bot Using Blowssi
« on: February 02, 2014, 10:43:41 AM »
I have an Irssi bot that needs to be able to understand encrypted channels using Mircryption.  After getting Blowssi installed and set-up on my Irssi bot, I noticed that my triggers like !ep for TvRage only worked on unencrypted messages.  After fiddling with Blowssi for a while, I finally came up with this workaround:

At the bottom of "sub decrypt {}" change:
Code: Perl [Select]
  1. Irssi::signal_stop();
  2.   return 1;
to
Code: Perl [Select]
  1. if ($event_type eq 'message_public') {
  2.     Irssi::signal_continue($params[1], $result, $params[3], $params[4], $params[5]);
  3.   }
  4.   else {
  5.     Irssi::signal_stop();
  6.   }
  7.   return 1;

Is there a better option to retain the ability of my other scripts working from the decrypted text after Blowssi decrypts it?

As a clarification for my problem:

My triggers are currently set to
Code: Perl [Select]
  1. Irssi::signal_add("message public", \&handle_message_public_sub);

So, when I do "!ep <tvshow>" in unencrypted text from another account, it responds normally, however, when I run the same command in encrypted text, Blowssi decrypts it just fine, but my !ep trigger never fires.

My solution above posts double on my bot's screen (which isn't really an issue, since it's a bot and no human is going to look at it very often):

18:40:46 <MyNick:#chan> !ep <tvshow>
18:40:46 <!MyNick> !ep <tvshow>

I thought about adding a custom signal to be emitted by Blowssi for when Blowssi decrypted a message_public type.  However, I'm going to need to be decrypting up to 30 times per second and handling the public messages once I get all of my bot scripts written, so I wasn't sure on how good adding another signal emit would be.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,405
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Irssi Bot Using Blowssi
« Reply #1 on: February 02, 2014, 10:54:42 AM »
I'm afraid i don't have irssi experience so you are way ahead of me.  But just wanted to say, Nice work  :up: