All pastes #986944 Raw Edit

Something

public text v1 · immutable
·published 2008-04-16 02:24 UTC
rendered paste body
use strict;
use vars qw($VERSION %IRSSI);
 
use Irssi;
$VERSION = '1.00';
%IRSSI = (
    authors     => 'Peter Greenwood',
    contact     => 'pjgat09@gmail.com',
    name        => 'Highlight Code',
    license     => 'Public Domain',
);

sub server_msgs {
  my ($server, $data2, $nick, $address) = @_;
  my ($target, $text) = split(/ :/, $data2, 2);
  my $me = $server->{nick};
  if ( ($text =~ /$me/i) ) {
    $text =~ s/$me/($me)/g;
    my $place;
    if ($target =~ /^\#/) { $place = $target; } else { $place = "a PM"; }
    system("screen -d -m ~/.irssi/scripts/tk.pl " . "\"In " . $place . " " . $nick . " Wrote:  " . $text . "\"");
#    $server->command("msg #testing123 " . "In " . $place . " " . $nick . " Wrote:  " . $text);
    
  }
}

Irssi::signal_add("event privmsg", "server_msgs");






tk.pl:


#!/usr/bin/perl

use English;
require Tk;
use Tk;

my $Version = "1.0";

my $main = MainWindow->new();
$main->minsize(qw(250 50));
$main->title("Highlight");
$main->configure(-background=>'white');

my $top = $main->Frame(-background=>'white',)->pack(-side=>'top',-fill=>'x');

my $left1 = $top->Frame(-background=>'white',)->pack(-side=>'left',-pady=>9,-padx=>8);

my $t1 = $left1->Label(-text=>$ARGV[0],-background=>'white')->pack();

MainLoop();