diff options
| author | adedomin | 2017-04-11 22:11:42 -0400 |
|---|---|---|
| committer | adedomin | 2017-04-11 22:11:42 -0400 |
| commit | 7e3bf55cc6923cd7eec478c04a2ae03a2b547aae (patch) | |
| tree | 8cc9b30095ec9198003b86dc4c313ae046a7caf5 /scripts | |
| parent | e96d7d23747e7eb3d882b31c45c3e1dbf58e43c4 (diff) | |
| download | scripts.irssi.org-7e3bf55cc6923cd7eec478c04a2ae03a2b547aae.tar.bz2 | |
updated fullwidth
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/fullwidth.pl | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/scripts/fullwidth.pl b/scripts/fullwidth.pl index 261aa5a..4d17b70 100644 --- a/scripts/fullwidth.pl +++ b/scripts/fullwidth.pl @@ -14,8 +14,8 @@ # limitations under the License. use strict; -use Irssi qw(command_bind active_win); -our $VERSION = '1.1.0'; +use Irssi qw(command_bind active_win signal_stop); +our $VERSION = '1.2.0'; our %IRSSI = ( authors => 'prussian', contact => 'genunrest@gmail.com', @@ -25,7 +25,15 @@ our %IRSSI = ( license => 'Apache 2.0', ); -command_bind(fullwidth => sub { +my $help = '/fullwidth your cool text here +-> your cool text here + +you can also use stars to only fullwidth text between them + +/fullwidth do *you* know *the* way *to* San *Jose* +-> do you know the way to San Jose'; + +sub fullwidth { my $msg = $_[0]; my $say = ""; foreach my $char (split //, $msg) { @@ -39,5 +47,24 @@ command_bind(fullwidth => sub { } } } + return $say; +} + +command_bind(fullwidth => sub { + my $arg = $_[0]; + my $say = ''; + if ($arg =~ /\*[^*]*\*/) { + $say = $_[0] =~ s/\*([^*]*)\*/fullwidth($1)/reg; + } + else { + $say = fullwidth($arg); + } active_win->command("say $say"); }); + +command_bind(help => sub { + if ($_[0] eq $IRSSI{name}) { + Irssi::print($help, MSGLEVEL_CLIENTCRAP); + signal_stop(); + } +}); |
