Advertisement
swarley

Untitled

Jan 30th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. use Xchat ':all';
  2. use warnings;
  3. use strict;
  4.  
  5. Xchat::register('xHilight', '0.1', 'Script made for Tabibibles', 'init');
  6.  
  7. my %hilights = ();
  8.  
  9. sub init {
  10. open my $fh, '<', (Xchat::get_info('xchatdir') . '/.xhilight');
  11. my $scope;
  12. while(my $text = <$fh>) {
  13. chomp($text);
  14. if($text =~ m/^\[(.+?)\]/) {
  15. $scope =~ s/(\s+|\t+)//g;
  16. $hilights{$scope} = {};
  17. next;
  18. }
  19. elsif($text) {
  20. $text =~ m/^(.+?)=(.+?)/;
  21. $hilights{$scope}->{$1} = $2;
  22. next;
  23. }
  24. else {
  25. next;
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement