diff options
| author | Alexander Færøy | 2014-05-31 13:10:46 +0200 | 
|---|---|---|
| committer | Alexander Færøy | 2014-05-31 13:10:46 +0200 | 
| commit | 2d0759e6ca5767b48bcc85bf38c2c43d5f0b63b1 (patch) | |
| tree | 1c5e6d817c88e67b46e216a50e0aef5428bf63df /scripts/upsidedown.pl | |
| parent | 2d080422d79d1fd49d6c5528593ccaaff9bfc583 (diff) | |
| download | scripts.irssi.org-2d0759e6ca5767b48bcc85bf38c2c43d5f0b63b1.tar.bz2 | |
Import scripts from scripts.irssi.org
Diffstat (limited to 'scripts/upsidedown.pl')
| -rw-r--r-- | scripts/upsidedown.pl | 55 | 
1 files changed, 55 insertions, 0 deletions
| diff --git a/scripts/upsidedown.pl b/scripts/upsidedown.pl new file mode 100644 index 0000000..2f60976 --- /dev/null +++ b/scripts/upsidedown.pl @@ -0,0 +1,55 @@ +#!/usr/bin/perl +#  +# Irssi plugin to place text upside down +# V0.1 - Initial script - Ivo Schooneman, 08-11-2012 +# V0.2 - usay/ume - Ivo Schooneman, 08-11-2012 +# +use strict; +use Text::UpsideDown; +use Irssi; +use vars qw($VERSION %IRSSI); + +$VERSION = "0.2"; +%IRSSI = ( +    authors     => "Ivo Schooneman", +    contact     => "ivo\@schooneman.net", +    name        => "upsidedown", +    description => "Plugin to place text upsidedown", +    license     => "GNU GPLv2", +    url         => "https://github.com/Ivo-tje/Irssi-plugin-upsidedown", +); + +sub ume { +    my ($text, $server, $dest) = @_; + +    # Check if connected to server +    if (!$server || !$server->{connected}) { +  	Irssi::print("Not connected to server"); +   	return; +    } + +    return unless $dest; + +    if ($dest->{type} eq "CHANNEL" || $dest->{type} eq "QUERY") { +        $dest->command("me " . upside_down($text)); +    } +} + +sub usay { +    my ($text, $server, $dest) = @_; + +    # Check if connected to server +    if (!$server || !$server->{connected}) { +  	Irssi::print("Not connected to server"); +   	return; +    } + +    return unless $dest; + +    if ($dest->{type} eq "CHANNEL" || $dest->{type} eq "QUERY") { +        $dest->command("msg " . $dest->{name} . " " . upside_down($text)); +    } +} + +Irssi::command_bind('usay', 'usay'); +Irssi::command_bind('ume', 'ume'); | 
