]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
[cubes] add cubes script
authorAilin Nemui <redacted>
Tue, 2 Oct 2018 14:00:23 +0000 (16:00 +0200)
committerAilin Nemui <redacted>
Tue, 2 Oct 2018 14:00:23 +0000 (16:00 +0200)
scripts/cubes.pl [new file with mode: 0644]

diff --git a/scripts/cubes.pl b/scripts/cubes.pl
new file mode 100644 (file)
index 0000000..6c1c11e
--- /dev/null
@@ -0,0 +1,50 @@
+use strict;
+use warnings;
+use Irssi 20140603;
+
+our $VERSION = '1.0';
+our %IRSSI = (
+    authors     => 'Irssi staff',
+    contact     => 'staff@irssi.org',
+    url         => 'https://irssi.org',
+    name        => 'cubes',
+    description => '256 colour test script for Irssi.',
+    license     => 'Public Domain',
+);
+
+Irssi::command_bind 'cubes' => sub {
+    my $w = Irssi::active_win;
+    my $C = MSGLEVEL_CLIENTCRAP;
+    my $N = MSGLEVEL_NEVER | $C;
+    my $P = sub {
+       $w->print(@_)
+    };
+    $P->("%_bases", $C);
+    $P->( do {
+       join '', map { "%x0${_}0$_" } '0' .. '9', 'A' .. 'F'
+    }, $N);
+    $P->("%_cubes", $C);
+    $P->( do {
+       my $y = $_*6;
+       join '', map {
+           my $x = $_;
+           map { "%x$x$_$x$_" } @{['0' .. '9', 'A' .. 'Z']}[$y .. $y+5]
+       } 1 .. 6
+    }, $N)
+       for 0 .. 5;
+    $P->("%_grays", $C);
+    $P->( do {
+       join '', map { "%x7${_}7$_" } 'A' .. 'X'
+    }, $N);
+    $P->("%_mIRC extended colours", $C);
+    my $x;
+    $x .= sprintf "\cC99,%02d%02d", $_, $_
+       for 0 .. 15;
+    $P->($x, $N);
+    for my $z (0 .. 6) {
+       my $x;
+       $x .= sprintf "\cC99,%02d%02d", $_, $_
+           for 16 + ($z * 12) .. 16 + ($z * 12) + 11;
+       $P->($x, $N);
+    }
+};
git clone https://git.99rst.org/PROJECT