Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use Xchat ':all';
- use warnings;
- use strict;
- Xchat::register('xHilight', '0.1', 'Script made for Tabibibles', &init);
- Xchat::hook_print('Channel Message', 'chanhook');
- my %hilights;
- sub init {
- Xchat::print('K');
- open my $fh, '<', (Xchat::get_info('xchatdir') . '/.xhilight');
- my $scope;
- while (<$fh>) {
- chomp;
- if (/^\[(.+?)\]/) {
- my $result = $1;
- $result =~ s/\s+|\t+//g;
- $scope = $result;
- $hilights{$scope} = {};
- next;
- }
- m/^(.+?)=(.+?)$/ or next;
- $1 =~ s/\s+|\t+//g;
- $hilights{$scope}->{$1} = $2;
- }
- }
- sub chanhook {
- foreach my $key (keys(%hilights)) {
- $_[0][0] =~ s/\s|\t//g;
- if($_[0][0] eq $key) {
- Xchat::print(keys(%{$hilights{$key}}));
- my $format = $hilights{$key}{CHANNEL};
- $format =~ s/\%C/\x03/g;
- $format =~ s/\%prefix\%/$_[0][2]/g;
- $format =~ s/\%nick\%/$key/g;
- $format =~ s/\%div\%/\t/g;
- $format =~ s/\%message\%/$_[0][1]/g;
- Xchat::print( $format );
- return Xchat::EAT_ALL;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement