diff options
| author | Alexander Færøy | 2014-06-14 14:48:47 +0200 | 
|---|---|---|
| committer | Alexander Færøy | 2014-06-14 14:48:47 +0200 | 
| commit | 1777b5bab4b92f6eebd7269c2657ac824b61b067 (patch) | |
| tree | 8ee3bc64b59d43d19e0cd5796dbedc43b4ccfbf5 | |
| parent | ff37cef2ceca771d4a8478a2823cd8772afaf399 (diff) | |
| parent | eca6050dc2eb24cdb569501ba5ea1b8affbe8b67 (diff) | |
| download | scripts.irssi.org-1777b5bab4b92f6eebd7269c2657ac824b61b067.tar.bz2 | |
Merge pull request #6 from palei/emo
Add emo.pl
| -rw-r--r-- | _data/scripts.yaml | 9 | ||||
| -rw-r--r-- | scripts/emo.pl | 91 | 
2 files changed, 100 insertions, 0 deletions
| diff --git a/_data/scripts.yaml b/_data/scripts.yaml index ab0d5d9..9c6d05f 100644 --- a/_data/scripts.yaml +++ b/_data/scripts.yaml @@ -1289,6 +1289,15 @@    url: "http://www.holmnilsen.com/"    version: "1.2" +- authors: "Ilkka Pale" +  contact: "ilkka.pale@gmail.com" +  description: "Outputs various unicode emoticons." +  filename: "emo.pl" +  modified: "2014-06-12 19:06:00" +  license: "Public Domain" +  name: "emo" +  version: "0.0.1"   +  - authors: "Ilya Cassina"    contact: "icassina@gmail.com"    description: "This script allow advanced parametrization  .                   of the /list command. Accepted parameters are  .                   -minusers <#users> and -maxusers <#users>. " diff --git a/scripts/emo.pl b/scripts/emo.pl new file mode 100644 index 0000000..c1772fa --- /dev/null +++ b/scripts/emo.pl @@ -0,0 +1,91 @@ +#!/usr/bin/env perl +# +# Irssi script for easy usage of unicode emoticons. +# +# Package `unifont` should have to be installed so that  +# some of these display correctly. Depending on the font, some +# of them may not really work anyway.  +# +# Feel free to add your own. +# +# Enjoy! (⌐■_■)ノ♪♬ + +use strict; +use utf8; +use vars qw($VERSION %IRSSI %EMOTICONS); + +$VERSION = "0.0.1"; + +%IRSSI = ( +    authors      =>     "Ilkka Pale", +    contact      =>     "ilkka.pale\@gmail.com", +    name         =>     "emo", +    description  =>     "Outputs various unicode emoticons", +    commands     =>     "emo", +    licence      =>     "Public Domain" +); + +use Irssi; +use Irssi::Irc; + +%EMOTICONS = ( +    happy         => 'ʘ‿ʘ', +    smile         => '◔ ⌣ ◔', +    flex          => 'ᕙ(⇀‸↼‶)ᕗ', +    shrug         => '¯\_(ツ)_/¯', +    wave          => '(•◡•)/', +    bear          => 'ʕ•ᴥ•ʔ', +    love          => '♥‿♥', +    shock         => '⊙▃⊙', +    wink          => '◕‿↼', +    what          => '☉_☉', +    worried       => '⊙﹏⊙', +    fingers       => '╭∩╮(-_-)╭∩╮', +    tableflip     => '(╯°□°)╯︵ ┻━┻', +    tableback     => '┬──┬ ノ(゜-゜ノ)', +    heart         => '❤', +    lenny         => '(͡° ͜ʖ ͡°)', +    gift          => '(´・ω・)っ由', +    disapprove    => 'ಠ_ಠ', +    tired         => 'ب_ب', +    handsup       => '╚(•⌂•)╝', +    dance         => '(⌐■_■)ノ♪♬', +    sad           => '⊙︿⊙', +    ohplease      => 'ヘ( ̄ω ̄ヘ)', +    kiss          => '(っ˘з(˘⌣˘ )', +    owl           => '◎▼◎', +    hrm           => '눈_눈', +    success       => '(•̀ᴗ•́)و', +    whatever      => '◔_◔', +    amazed        => '\(◎o◎)/', +    suave         => '〜( ̄△ ̄〜)', +    eyes          => 'Ծ_Ծ', +    ghost         => '༼✷ɷ✷༽', +    stoned        => '{◕ ◡ ◕}', +    angry         => '►_◄', +); + +sub emolist { +    foreach my $key (sort keys %EMOTICONS) { +        Irssi::print($key . " = " . $EMOTICONS{$key}); +    }  +} + +sub emo { +    my ($key, $server, $dest) = @_; +     +    if (!$server || !$server->{connected}) { +        Irssi::print("Not connected to server."); +        return; +    } +    return unless $dest; + +    if (!exists $EMOTICONS{$key}) { +        return; +    } + +    $dest->command("msg " . $dest->{name} . " " . $EMOTICONS{$key}); +} + +Irssi::command_bind('emo', 'emo'); +Irssi::command_bind('emolist', 'emolist'); | 
