]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
Add emo.pl
authorIlkka Pale <redacted>
Thu, 12 Jun 2014 20:05:08 +0000 (22:05 +0200)
committerIlkka Pale <redacted>
Thu, 12 Jun 2014 20:05:08 +0000 (22:05 +0200)
_data/scripts.yaml
scripts/emo.pl [new file with mode: 0644]

index 9769b900bf8be367a14cd03f0df01cc9b83d15ac..18791e60ef992fca70cb2bde786096fa31875292 100644 (file)
   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 (file)
index 0000000..cc2629c
--- /dev/null
@@ -0,0 +1,81 @@
+#!/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.
+#
+# 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         => 'ʘ‿ʘ',
+    flex          => 'ᕙ(⇀‸↼‶)ᕗ',
+    shrug         => '¯\_(ツ)_/¯',
+    wave          => '(•◡•)/',
+    bear          => 'ʕ•ᴥ•ʔ',
+    love          => '♥‿♥',
+    shock         => '⊙▃⊙',
+    wink          => '◕‿↼',
+    what          => '☉_☉',
+    worried       => '⊙﹏⊙',
+    fingers       => '╭∩╮(-_-)╭∩╮',
+    tableflip     => '(╯°□°)╯︵ ┻━┻',
+    tableback     => '┬──┬ ノ(゜-゜ノ)',
+    heart         => '❤',
+    lenny         => '(͡° ͜ʖ ͡°)',
+    gift          => '(´・ω・)っ由',
+    disapprove    => 'ಠ_ಠ',
+    flex          => 'ᕙ( ͡° ʖ͡°)ᕗ',
+    tired         => 'ب_ب',
+    handsup       => '╚(•⌂•)╝',
+    dance         => '(⌐■_■)ノ♪♬',
+    sad           => '⊙︿⊙',
+    ohplease      => 'ヘ( ̄ω ̄ヘ)',
+    kiss          => '(っ˘з(˘⌣˘ )',
+    owl           => '◎▼◎',
+    hrm           => '눈_눈',
+    success       => '(•̀ᴗ•́)و'
+);
+
+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');
\ No newline at end of file
git clone https://git.99rst.org/PROJECT