From 03929dac2a29664878d2c971648a4fe1fb698462 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 22:19:02 +0200 Subject: Adding upstream version 20231031. Signed-off-by: Daniel Baumann --- scripts/smiley.pl | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 scripts/smiley.pl (limited to 'scripts/smiley.pl') diff --git a/scripts/smiley.pl b/scripts/smiley.pl new file mode 100644 index 0000000..d81437b --- /dev/null +++ b/scripts/smiley.pl @@ -0,0 +1,43 @@ +use Irssi; +use strict; +use vars qw($VERSION %IRSSI); +$VERSION = '0.69'; + +%IRSSI = ( + authors => 'Jonne Piittinen', + contact => 'jip@loota.org', + name => 'Smiley', + description => 'Very useful smiley-flooder', + license => 'Public Domain', +); + +print "<--------[------------------------------]-------->"; +print "<--------[ smiley-script v. $VERSION. ]-------->"; +print "<--------[ /smiley to generate a smiley ]-------->"; +print "<--------[------------------------------]-------->"; + +sub gen_smiley { + + my ($data, $server, $witem) = @_; + my @smilies; + my $string; + my $i; + + @smilies = (':)',':D',';D',':P',':>','=D','=)',':E',':]'); + + for ($i = 0; $i < 100; $i++) { + if (rand(4) > 2 && $i > 0 && $string !~ / $/) { + $string .= " "; + } else { + $string .= @smilies[rand($#smilies-1)]; + } + } + + if ($witem) { + $witem->command("MSG ".$witem->{name}." ".$string); + } else { + Irssi::print("No active channel or query in this window."); + } +} + +Irssi::command_bind('smiley', 'gen_smiley'); -- cgit v1.2.3