Jump to content

Xchat [style] Stripper


err0r

Recommended Posts

Thanks to LifeIsPain there is now a snippet to strip the style tags for the users that prefer to chat with xchat on buzzen.

 

Save the following as stripstyle.pl in your xchat profile directory and load it.

use Xchat qw(:all); 
use strict; 
use warnings; 
  
register('Strip Style', '001', 'Strip [style][/style] tags'); 
  
hook_server('PRIVMSG', sub { 
    my $instring = $_[1][0]; 
    my $edited = 0; 
    # using a while loop instead of /g due to embedded styles 
    while ($instring =~ s/\[style [^\]]*\](.*?)\[\/style\]/$1/i) { 
       $edited = 1; 
    } 
    if ($edited) { 
       command('recv '.$instring); 
       return EAT_ALL; 
    } 
    else { 
       return EAT_NONE; 
    } 
});

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...