summaryrefslogtreecommitdiffstats
path: root/scripts/bestoiber.pl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:19:02 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 20:19:02 +0000
commit03929dac2a29664878d2c971648a4fe1fb698462 (patch)
tree02c5e2b3e006234aa29545f7a93a1ce01b291a8b /scripts/bestoiber.pl
parentInitial commit. (diff)
downloadirssi-scripts-03929dac2a29664878d2c971648a4fe1fb698462.tar.xz
irssi-scripts-03929dac2a29664878d2c971648a4fe1fb698462.zip
Adding upstream version 20231031.upstream/20231031upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/bestoiber.pl')
-rw-r--r--scripts/bestoiber.pl61
1 files changed, 61 insertions, 0 deletions
diff --git a/scripts/bestoiber.pl b/scripts/bestoiber.pl
new file mode 100644
index 0000000..7d9f68f
--- /dev/null
+++ b/scripts/bestoiber.pl
@@ -0,0 +1,61 @@
+#!/usr/bin/perl
+#
+# by Stefan 'tommie' Tomanek
+
+use strict;
+
+use vars qw($VERSION %IRSSI);
+$VERSION = "2003020801";
+%IRSSI = (
+ authors => "Stefan 'tommie' Tomanek",
+ contact => "stefan\@pico.ruhr.de",
+ name => "BeStoiber",
+ description => "stoibers your messages",
+ license => "GPLv2",
+ url => "",
+ modules => "",
+ changed => "$VERSION",
+ commands => "bestoiber"
+);
+
+
+use Irssi 20020324;
+
+sub stoibern ($) {
+ my ($text) = @_;
+ my $result;
+ my $buffer;
+ foreach (split / /, $text) {
+ if (int(rand(4)) == 1) {
+ $result .= ' eehh, ';
+ } else {
+ $result .= ' ';
+ }
+ if (substr($_, 0,1) =~ /[A-Z]+/ && int(rand(2)) == 1) {
+ my @buzzwords = split(/,/, Irssi::settings_get_str('bestoiber_buzzwords'));
+ $result .= $buzzwords[rand(scalar(@buzzwords))].", ";
+ }
+ if (int(rand(6)) == 1) {
+ $result =~ s/,?\ $//;
+ $result .= ", ".$buffer." " if $buffer;
+ }
+
+ $result .= $_;
+ $buffer = $_;
+ }
+ $result =~ s/^ //;
+ return $result;
+}
+
+sub cmd_bestoiber ($$$) {
+ my ($arg, $server, $witem) = @_;
+ if ($witem && ($witem->{type} eq 'CHANNEL' || $witem->{type} eq 'QUERY')) {
+ $witem->command('MSG '.$witem->{name}.' '.stoibern($arg));
+ } else {
+ print CLIENTCRAP "%B>>%n ".stoibern($arg);
+ }
+}
+
+Irssi::settings_add_str($IRSSI{name}, 'bestoiber_buzzwords', 'Arbeitslose,Fr. Merkel,Schröder');
+
+Irssi::command_bind('bestoiber', \&cmd_bestoiber);