System administrator, part-time Perl hacker, full-time POE [perl.org] evangelist. One day he will be made to pay for his crimes.
He has some modules on CPAN [cpan.org]. They may or may not be useful
A little while ago, I related how I'd been playing with Irssi and POE, well today I've been playing some more >:o)
Since my first journal entry on this subject, Martijn van Beers has released POE::Session::Irssi which makes the whole business of integrating Irssi and POE that little bit easier.
I wanted to see if I could run a POE::Component::IRC bot inside Irssi.
I had a bot called flibblebot that I have been playing with on Freenode for a while. So I took the source to that and started fiddling.
First I switched the POE::Session to use POE::Session::Irssi. Then had to change all my handlers to inline_state from package, as POE::Session::Irssi currently doesn't support object or package state handlers. Suck.
Then I started the script up in Irssi and it worked! Hurrah!
Except that I had left in print statements that spat debug info into my active Irssi window
Try to unload the script to find, that bot won't die. Damn it, POE::Component::IRC is not Irssi aware and is holding the POE::Session::Irssi open. Then I remembered that one can send PoCo-IRC a 'POCOIRC_SHUTDOWN' signal to tell it to
Right, I need to bind an Irssi command to terminate the bot
The final bot code is here
Postscript:
I have since been corrected about package_states. Irssi wraps scripts as Irssi::Script::scriptname-minus-pl I have adjusted the bot code accordingly
More Irssi+POE madness 0 Comments More | Login | Reply /