weechat-opal/scripts/banner.pl

333 lines
4.6 KiB
Perl
Raw Normal View History

2016-10-23 03:14:15 +00:00
use strict;
use warnings;
no strict 'subs';
my $SCRIPT_NAME = 'banner';
my $SCRIPT_AUTHOR = 'The Krusty Krab <wowaname@volatile.ch>';
my $SCRIPT_VERSION = '1.0';
my $SCRIPT_LICENCE = 'Public domain';
my $SCRIPT_DESC = 'Banner text';
our (%queue, %timer);
2016-10-23 03:24:37 +00:00
if (weechat::register($SCRIPT_NAME, $SCRIPT_AUTHOR, $SCRIPT_VERSION,
$SCRIPT_LICENCE, $SCRIPT_DESC, '', '')) {
weechat::hook_command('banner', 'Banner text',
"[-nick|-key|-limit] text",
"-nick: send to /nick command\n".
"-key: send as /mode +k (doesn't work on all ircds)\n".
"-limit: send as /mode +l\n",
'', 'cmd_banner', '');
}
sub cmd_banner
{
my ($buffer, $cmd) = ($_[1], $_[2]);
my ($flag, $text) = $cmd =~ /^(-nick|-key|-limit|) *(.*)$/;
my @output;
my $prefix = '/msg *';
my $nick = weechat::info_get('irc_nick',
weechat::buffer_get_string($buffer, 'localvar_server'));
my @chars = ('````````^',
'XX``XXXXX',
'``````XXX
2016-10-23 03:14:15 +00:00
`````````
``````XXX',
2016-10-23 03:24:37 +00:00
'``X```X``
2016-10-23 03:14:15 +00:00
XXXXXXXXX
``X```X``
XXXXXXXXX
``X```X``',
2016-10-23 03:24:37 +00:00
'`````XX``
2016-10-23 03:14:15 +00:00
`X``X``X`
XX``X``XX
`X``X``X`
``XX`````',
2016-10-23 03:24:37 +00:00
'```X```XX
2016-10-23 03:14:15 +00:00
XX``X``XX
XX```X```',
2016-10-23 03:24:37 +00:00
'```X`X```
2016-10-23 03:14:15 +00:00
X`X`X`X`X
``X```X``',
2016-10-23 03:24:37 +00:00
'``````XXX',
'`XXXXXXX`
2016-10-23 03:14:15 +00:00
X```````X',
2016-10-23 03:24:37 +00:00
'X```````X
2016-10-23 03:14:15 +00:00
`XXXXXXX`',
2016-10-23 03:24:37 +00:00
'``````X`X
2016-10-23 03:14:15 +00:00
```````X`
``````X`X',
2016-10-23 03:24:37 +00:00
'````X````
2016-10-23 03:14:15 +00:00
```XXX```
````X````',
2016-10-23 03:24:37 +00:00
'X````````
2016-10-23 03:14:15 +00:00
`XX``````',
2016-10-23 03:24:37 +00:00
'````X```^
2016-10-23 03:14:15 +00:00
````X````',
2016-10-23 03:24:37 +00:00
'X````````',
'XXX``````
2016-10-23 03:14:15 +00:00
```XXX```
``````XXX',
2016-10-23 03:24:37 +00:00
'`XXXXXXX`
2016-10-23 03:14:15 +00:00
X```````X
`XXXXXXX`',
2016-10-23 03:24:37 +00:00
'X``````X`
2016-10-23 03:14:15 +00:00
XXXXXXXXX
X````````',
2016-10-23 03:24:37 +00:00
'XXX````X`
2016-10-23 03:14:15 +00:00
X``XX```X
X````XXX`',
2016-10-23 03:24:37 +00:00
'`X`````X`
2016-10-23 03:14:15 +00:00
X```X```X
`XXX`XXX`',
2016-10-23 03:24:37 +00:00
'````XXX``
2016-10-23 03:14:15 +00:00
````X``X`
XXXXXXXXX',
2016-10-23 03:24:37 +00:00
'X```XXXXX
2016-10-23 03:14:15 +00:00
X```X```X
`XXX````X',
2016-10-23 03:24:37 +00:00
'`XXXXXXX`
2016-10-23 03:14:15 +00:00
X```X```X
`XXX`````',
2016-10-23 03:24:37 +00:00
'XXX`````X
2016-10-23 03:14:15 +00:00
```XXX``X
``````XXX',
2016-10-23 03:24:37 +00:00
'`XXX`XXX`
2016-10-23 03:14:15 +00:00
X```X```X
`XXX`XXX`',
2016-10-23 03:24:37 +00:00
'`````XXX`
2016-10-23 03:14:15 +00:00
X```X```X
`XXXXXXX`',
2016-10-23 03:24:37 +00:00
'``XX`XX``',
'`X```````
2016-10-23 03:14:15 +00:00
``XX`XX``',
2016-10-23 03:24:37 +00:00
'````X````
2016-10-23 03:14:15 +00:00
```X`X```
``X```X``',
2016-10-23 03:24:37 +00:00
'```X`X```
2016-10-23 03:14:15 +00:00
```X`X``^
```X`X```',
2016-10-23 03:24:37 +00:00
'``X```X``
2016-10-23 03:14:15 +00:00
```X`X```
````X````',
2016-10-23 03:24:37 +00:00
'```````X`
2016-10-23 03:14:15 +00:00
XX``X```X
`````XXX`',
2016-10-23 03:24:37 +00:00
'`XXXXXXX`
2016-10-23 03:14:15 +00:00
X``XXX``X
X`X```X`X
X`XXXXXXX',
2016-10-23 03:24:37 +00:00
'XXXXXXXX`
2016-10-23 03:14:15 +00:00
````X```X
XXXXXXXX`',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
X```X```X
`XXX`XXX`',
2016-10-23 03:24:37 +00:00
'`XXXXXXX`
2016-10-23 03:14:15 +00:00
X```````X
`X`````X`',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
X```````X
`XXXXXXX`',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
X```X```X
X```````X',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
````X```X
````````X',
2016-10-23 03:24:37 +00:00
'`XXXXXXX`
2016-10-23 03:14:15 +00:00
X```````X
`XXX```X`',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
````X````
XXXXXXXXX',
2016-10-23 03:24:37 +00:00
'X```````X
2016-10-23 03:14:15 +00:00
XXXXXXXXX
X```````X',
2016-10-23 03:24:37 +00:00
'`X``````X
2016-10-23 03:14:15 +00:00
X```````X
`XXXXXXXX',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
````X````
```X`X```
XXX```XXX',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
X````````',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
``````XX`
``XXXX```
``````XX`
XXXXXXXXX',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
``````XX`
```XXX```
`XX``````
XXXXXXXXX',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
X```````X
XXXXXXXXX',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
````X```X
`````XXX`',
2016-10-23 03:24:37 +00:00
'`XXXXXXXX
2016-10-23 03:14:15 +00:00
XX``````X
XXXXXXXXX
X````````',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
````X```X
XXXX`XXX`',
2016-10-23 03:24:37 +00:00
'`X```XXX`
2016-10-23 03:14:15 +00:00
X```X```X
`XXX```X`',
2016-10-23 03:24:37 +00:00
'````````X
2016-10-23 03:14:15 +00:00
XXXXXXXXX
````````X',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
X````````
XXXXXXXXX',
2016-10-23 03:24:37 +00:00
'```XXXXXX
2016-10-23 03:14:15 +00:00
XXX``````
```XXXXXX',
2016-10-23 03:24:37 +00:00
'`XXXXXXXX
2016-10-23 03:14:15 +00:00
X````````
`XXXX````
X````````
`XXXXXXXX',
2016-10-23 03:24:37 +00:00
'XXX```XXX
2016-10-23 03:14:15 +00:00
```XXX```
XXX```XXX',
2016-10-23 03:24:37 +00:00
'`````XXXX
2016-10-23 03:14:15 +00:00
XXXXX````
`````XXXX',
2016-10-23 03:24:37 +00:00
'XXX`````X
2016-10-23 03:14:15 +00:00
X``XXX``X
X`````XXX',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
X```````X',
2016-10-23 03:24:37 +00:00
'``````XXX
2016-10-23 03:14:15 +00:00
```XXX```
XXX``````',
2016-10-23 03:24:37 +00:00
'X```````X
2016-10-23 03:14:15 +00:00
XXXXXXXXX',
2016-10-23 03:24:37 +00:00
'```````X`
2016-10-23 03:14:15 +00:00
````````X
```````X`',
2016-10-23 03:24:37 +00:00
'X````````
2016-10-23 03:14:15 +00:00
X```````^
X````````',
2016-10-23 03:24:37 +00:00
'````````X
2016-10-23 03:14:15 +00:00
```````X`',
2016-10-23 03:24:37 +00:00
'`X``X````
2016-10-23 03:14:15 +00:00
X`X`X````
XXXX`````',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
X```X````
`XXX`````',
2016-10-23 03:24:37 +00:00
'`XXX`````
2016-10-23 03:14:15 +00:00
X```X````
X```X````',
2016-10-23 03:24:37 +00:00
'`XXX`````
2016-10-23 03:14:15 +00:00
X```X````
XXXXXXXXX',
2016-10-23 03:24:37 +00:00
'`XXX`````
2016-10-23 03:14:15 +00:00
X`X`X````
X`XX`````',
2016-10-23 03:24:37 +00:00
'XXXXXXXX`
2016-10-23 03:14:15 +00:00
````X```X',
2016-10-23 03:24:37 +00:00
'X``X`````
2016-10-23 03:14:15 +00:00
X`X`X````
`XXXX````',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
````X````
XXXX`````',
2016-10-23 03:24:37 +00:00
'XXXXX``X`',
'X````````
2016-10-23 03:14:15 +00:00
`XXXX``X`',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX
2016-10-23 03:14:15 +00:00
````X````
XXXX`X```',
2016-10-23 03:24:37 +00:00
'X```````X
2016-10-23 03:14:15 +00:00
XXXXXXXXX
X````````',
2016-10-23 03:24:37 +00:00
'XXXXX````
2016-10-23 03:14:15 +00:00
````X````
XXXX`````
````X````
XXXX`````',
2016-10-23 03:24:37 +00:00
'XXXXX````
2016-10-23 03:14:15 +00:00
````X````
XXXX`````',
2016-10-23 03:24:37 +00:00
'XXXXX````
2016-10-23 03:14:15 +00:00
X```X````
XXXXX````',
2016-10-23 03:24:37 +00:00
'XXXXX````
2016-10-23 03:14:15 +00:00
`X``X````
``XX`````',
2016-10-23 03:24:37 +00:00
'``XX`````
2016-10-23 03:14:15 +00:00
`X``X````
XXXXX````',
2016-10-23 03:24:37 +00:00
'XXXXX````
2016-10-23 03:14:15 +00:00
````X````',
2016-10-23 03:24:37 +00:00
'X``X`````
2016-10-23 03:14:15 +00:00
X`X`X````
`X``X````',
2016-10-23 03:24:37 +00:00
'`XXXXXXX`
2016-10-23 03:14:15 +00:00
X```X````',
2016-10-23 03:24:37 +00:00
'`XXXX````
2016-10-23 03:14:15 +00:00
X````````
XXXXX````',
2016-10-23 03:24:37 +00:00
'``XXX````
2016-10-23 03:14:15 +00:00
XX```````
``XXX````',
2016-10-23 03:24:37 +00:00
'`XXXX````
2016-10-23 03:14:15 +00:00
X````````
`XXX`````
X````````
`XXXX````',
2016-10-23 03:24:37 +00:00
'XX`XX````
2016-10-23 03:14:15 +00:00
``X``````
XX`XX````',
2016-10-23 03:24:37 +00:00
'X``XX````
2016-10-23 03:14:15 +00:00
X`X``````
`XXXX````',
2016-10-23 03:24:37 +00:00
'XX``X````
2016-10-23 03:14:15 +00:00
X`X`X````
X``XX````',
2016-10-23 03:24:37 +00:00
'````X````
2016-10-23 03:14:15 +00:00
XXXX`XXXX
X```````X',
2016-10-23 03:24:37 +00:00
'XXXXXXXXX',
'X```````X
2016-10-23 03:14:15 +00:00
XXXX`XXXX
````X````',
2016-10-23 03:24:37 +00:00
' ```````X`
2016-10-23 03:14:15 +00:00
````````X
```````X`
````````X');
for ($flag) {
/-nick/ and $prefix = '/nick', last;
/-key/ and $prefix = '/mode +k', last;
/-limit/ and $prefix = '/mode +l', last;
}
2016-10-23 03:24:37 +00:00
if ($flag eq '-limit') { $chars[$_] =~ y/`X/18/ for (0 .. (@chars - 1)) }
2016-10-23 03:14:15 +00:00
for my $char (split //, $text) {
push @output, $flag eq '-limit' ? '111111111' : '`````````';
push @output, split /\n/, $chars[ord($char) - 0x20];
}
weechat::command($buffer, "$prefix $_") for @output;
for ($flag) {
/-nick/ and weechat::command($buffer, "/nick $nick"), last;
/-key/ and weechat::command($buffer, "/mode +k `````````"),
weechat::command($buffer, "/mode -k `````````"),
last;
/-limit/ and weechat::command($buffer, "/mode -l"), last;
}
return weechat::WEECHAT_RC_OK;
}