diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:19:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-15 20:19:02 +0000 |
commit | 03929dac2a29664878d2c971648a4fe1fb698462 (patch) | |
tree | 02c5e2b3e006234aa29545f7a93a1ce01b291a8b /scripts/smiley.pl | |
parent | Initial commit. (diff) | |
download | irssi-scripts-upstream/20231031.tar.xz irssi-scripts-upstream/20231031.zip |
Adding upstream version 20231031.upstream/20231031upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/smiley.pl')
-rw-r--r-- | scripts/smiley.pl | 43 |
1 files changed, 43 insertions, 0 deletions
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'); |