Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Perl & xChat: Highlight Logger with On/Off option
#1
Wrote another Perl script for xChat. It logs all Highlights to a query window while you are away so it's easy to see all of them when you're back. You can set it On or Off by just typing command "/hilight_on" or "/hilight_off".

I find it very useful because I usually leave my computer running for the night and with this script I can see all the highlights in the morning.

Code:
#!/usr/bin/perl

use strict;
use warnings;

# Highlight logger by B22stard
# Visit http://punkz0r.planet.ee

my $away = 0; # Automatically on = 1
Xchat::register("Highlight Logger", "1.0", "Highlight Logger");

Xchat::hook_print("Channel Msg Hilight", "highlight");
Xchat::hook_print("Channel Action Hilight", "actionhighlight");
Xchat::hook_command("hilight_on", "hilight_on");
Xchat::hook_command("hilight_off", "hilight_off");

Xchat::print("Loaded: Perl HighLight logger script by B22stard.");

sub hilight_on {
    $away = 1;
    Xchat::print("Will now log Highlights");
    return 1;
}

sub hilight_off {
    $away = 0;
    Xchat::print("Will no longer log Highlights");
    return 1;
}

sub highlight {
    if ($away) {
      my $whom = $_[0][0];
      my $text = $_[0][1];
      my $chan = Xchat::get_info('channel');
      my $serv = Xchat::get_info('server');

      Xchat::command("query (HighLights)", "", "$serv");
      Xchat::print("$whom\t$text (7$chan, 7$serv)", "(HighLights)", "$serv");
    return Xchat::EAT_NONE;
    }
}

sub actionhighlight {
  if ($away) {
    my $whom = $_[0][0];
    my $text = $_[0][1];
    my $chan = Xchat::get_info('channel');
    my $serv = Xchat::get_info('server');

    Xchat::command("query (HighLights)", "", "$serv");
    Xchat::print("$whom\t$text (7$chan, 7$serv)", "(HighLights)", "$serv");
  return Xchat::EAT_NONE;
  }
}

Pastebin: http://pastebin.com/f5bb602a3
Originally posted on Punkz0r Blog by me
Reply
#2
nice! that is useful! good job.
Support the best of ideas ----->

- http://www.vinceking69.blogspot.com -
Reply
#3
Pro!

Thanks!
Reply
#4
Thanks bro nice tut
[Image: 2d75599e9a.png]:superman:
Reply
#5
This is why php is my next language. lol. Tongue
Reply
#6
thank you!
sir!
CHINAMAN
Quote:i like to make myself belie
[Image: 2n7ehx4.jpg]
[Image: save_banner.asp?file=HWHERMJMMH.jpg]
Reply
#7
I started using this on my mac....Thanks, it is particularly helpful at work.
Reply
#8
very useful.... thanks!! :-)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Compile Error in Perl liveproject101 0 1,304 04-12-2013, 03:08 AM
Last Post: liveproject101
  [Perl] IRC Bot wchar_t 26 14,636 08-20-2012, 01:40 PM
Last Post: Trump
  Perl Ebook ven0m 2 1,834 05-04-2012, 08:14 AM
Last Post: ven0m
  Help with a program written in perl Rodman42866 1 1,689 03-09-2012, 03:16 AM
Last Post: AceInfinity
  HTML perl script AceInfinity 5 2,743 12-03-2011, 11:35 PM
Last Post: Closed Account

Forum Jump:


Users browsing this thread: 3 Guest(s)