Scripts for IRSSI
Author: Paige Thompson


IRC BubbleTea

This one just adds an alias /m <text>:

/alias m exec -o python3 -c 'import itertools, textwrap, sys, random\; print("".join(["\x03{}{}".format(x, y) for x, y in zip(itertools.cycle([61, 85, 83, 59, 58, 69, 81, 80]), itertools.chain.from_iterable([(lambda t, tt: t + list(" " + tt + " ") + t)(random.sample([chr(y) for y in range(0x2580, 0x2585)] * 128, 8), "".join(a).strip()) for a in textwrap.wrap(" ".join(sys.argv[1:]), 50) ])) ]))' \"$*\"

If you like weird code / color interpolation shit, run this command in IRSSI:

/exec -o python -c 'import sys; [sys.stdout.write("\x03{a}A {a} \x03{b}B {b} \x03{c}C {c} \x03{d}D {d} \x03{e}E {e} \x03{f}F {f} \x03{g}G {g} \x03{h}H {h}\n".format(a=a, b=b, c=c, d=d, e=e, f=f, g=g, h=h)) for a, b, c, d, e, f, g, h in [(a, b, c, d, e, f, g, g + a) for a, b, c, d, e, f, g in [(a, b, c, d, e, f, f + a) for a, b, c, d, e, f in [(a, b, c, d, e, e + a) for a, b, c, d, e in [(a, b, c, d, d + a) for a, b, c, d in [(b, a, c, c + b) for a, b, c in [(b, a, b + a) for a, b in zip([12] * 87, list(range(0, 87))) if b >= 16] if c < 87] if d < 87] if e < 87] if f < 87] if g < 87]]'

fullwidth.pl


use strict;
use Irssi;
use vars qw($VERSION %IRSSI);

$VERSION = "1.1";
%IRSSI = (
    authors     => "Grok (fixed for IRC)",
    contact     => "https://x.ai",
    name        => "fullwidth",
    description => "Converts ALL your outgoing plain text to full-width letters (full width style). Normal spaces are kept so they don't break. Commands starting with / are untouched.",
    license     => "Public Domain",
    url         => "https://scripts.irssi.org",
);

Irssi::settings_add_bool('misc', 'fullwidth_enabled', 1);

# FIXED full-width function:
#   • Only converts ! to ~  →  full-width equivalents
#   • Leaves regular spaces alone (this was the "ã@@" garbage you saw)
sub fullwidth {
    my $text = shift // '';
    $text =~ s/([\x21-\x7E])/chr(ord($1) + 0xFEE0)/ge;
    return $text;
}

sub sig_send_text {
    my ($text, $server, $witem) = @_;

    return unless Irssi::settings_get_bool('fullwidth_enabled');
    return if $text =~ /^\s*\//;
    return unless $witem && ($witem->{type} eq 'CHANNEL' || $witem->{type} eq 'QUERY');

    my $converted = fullwidth($text);

    Irssi::signal_stop();
    $server->command("MSG " . $witem->{name} . " " . $converted);
}

sub cmd_fullwidth {
    my ($data) = @_;
    my $current = Irssi::settings_get_bool('fullwidth_enabled');

    if ($data eq 'on') {
        Irssi::settings_set_bool('fullwidth_enabled', 1);
        Irssi::print('%GFull-width is now ON%n');
    } elsif ($data eq 'off') {
        Irssi::settings_set_bool('fullwidth_enabled', 0);
        Irssi::print('%RFull-width is now OFF%n');
    } else {
        my $new = !$current;
        Irssi::settings_set_bool('fullwidth_enabled', $new);
        Irssi::print('%GFull-width is now ' . ($new ? 'ON' : 'OFF') . '%n');
    }
}

Irssi::signal_add('send text', 'sig_send_text');
Irssi::command_bind('fullwidth', 'cmd_fullwidth');

Irssi::print('%Gfullwidth.pl v1.1 loaded!%n Spaces are now fixed — messages will look like: ok thats better');

masshl.pl


use strict;
use Irssi;
use Irssi::Irc;

use vars qw($VERSION %IRSSI);

$VERSION = "1.4";
%IRSSI = (
    authors     => "Grok",
    name        => "mass_highlighter",
    description => "Mass highlight commands: /masshl (single message), /masshl_each (one message per user)",
    license     => "Public Domain",
);

########################################
# /masshl — one message with all nicks
########################################
sub cmd_masshl {
    my ($data, $server, $witem) = @_;
    return unless $witem && $witem->{type} eq "CHANNEL";

    my @parts = split(/\s+/, $data);
    my %exclude;
    my @message_parts;
    my $collecting_excludes = 1;

    foreach my $part (@parts) {
        if ($part =~ /^-(.+)/) {
            $exclude{lc($1)} = 1;
        } else {
            $collecting_excludes = 0;
        }
        push @message_parts, $part unless $collecting_excludes;
    }

    my $channel = $witem->{name};
    my $rec = $server->channel_find($channel) or return;

    my @nicks;
    foreach my $nickrec ($rec->nicks()) {
        my $nick = $nickrec->{nick};
        next if $exclude{lc($nick)};
        push @nicks, $nick;
    }

    return unless @nicks;

    my $message = join(" ", @message_parts);
    my $full_msg = join(" ", @nicks) . " " . $message;

    $witem->command("MSG $channel $full_msg");
    Irssi::print("masshl: sent to " . scalar(@nicks) . " users");
}

########################################
# /masshl_each — one message per user
########################################
sub cmd_masshl_each {
    my ($data, $server, $witem) = @_;
    return unless $witem && $witem->{type} eq "CHANNEL";

    my @parts = split(/\s+/, $data);
    my %exclude;
    my @message_parts;
    my $collecting_excludes = 1;

    foreach my $part (@parts) {
        if ($part =~ /^-(.+)/) {
            $exclude{lc($1)} = 1;
        } else {
            $collecting_excludes = 0;
        }
        push @message_parts, $part unless $collecting_excludes;
    }

    # Always exclude yourself
    $exclude{lc($server->{nick})} = 1;

    my $channel = $witem->{name};
    my $rec = $server->channel_find($channel) or return;

    my @nicks;
    foreach my $nickrec ($rec->nicks()) {
        my $nick = $nickrec->{nick};
        next if $exclude{lc($nick)};
        push @nicks, $nick;
    }

    return unless @nicks;

    my $message = join(" ", @message_parts);
    Irssi::print("masshl_each: sending to " . scalar(@nicks) . " users");

    foreach my $nick (@nicks) {
        $witem->command("MSG $channel $nick: $message");
    }
}

########################################
# Command bindings
########################################
Irssi::command_bind('masshl', 'cmd_masshl');
Irssi::command_bind('masshl_each', 'cmd_masshl_each');

Irssi::print("mass_highlighter v$VERSION loaded: /masshl, /masshl_each");