TriPlBot - An Eliza ChatBot Script for TrillPerl

Heres a simple perl script that will enable the Eliza bot to respond to incoming Trillian messages

What you would need

  1. Active Perl 5.8.0.806
  2. TrillPerl plugin
  3. Eliza.pm

The bot script

  # This code is provided as is - in other words do whatever you like with it.

use Chatbot::Eliza;
use TrillianPlugin;
TrillianPlugin::DispatchEvent;

$mybot = new Chatbot::Eliza;
my $alias_id_bot;
my $boton = 0;

sub incoming_privateMessage
{
    if ($boton eq 1)
   {
        my ($SELF,$medium,$cid,$sender,$body,$location) = @_;
        my ($self,undef,$window_id,$event_id,$text,undef) = @_;

        $mybot->transform($text);
        my $output = $mybot->transform($text);

        TrillianPlugin::SendMessage($medium,$cid,$sender, $output);
    }
}

sub action_botswitch
{
    if ($boton eq 0)
   {
        $boton = 1;
        TrillianPlugin::OutputDebug("TriplBot is now on");
    }
    else
    {
        $boton = 0;
        TrillianPlugin::OutputDebug("TriplBot is now off");
    }
    TrillianPlugin::TextAliasZap;
}

sub script_onLoad
{
        my(undef,undef,$SELF,undef,$FILE,undef) = @_;
        $alias_id_bofh = TrillianPlugin::CreateTextAlias("/bot","action_botswitch" ,$SELF);
}


sub script_OnUnload
{
        TrillianPlugin::OutputDebug("The TriplBot script is being unloaded!");
        TrillianPlugin::DeleteTextAlias($alias_id_bot);
}

 
You can download the .pl file from here
and the response data file from here
 
The final install should look something like this
 
If you run in to any troubles msg me