summaryrefslogtreecommitdiffstats
path: root/scripts/gimmie.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/gimmie.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/gimmie.pl')
-rw-r--r--scripts/gimmie.pl39
1 files changed, 39 insertions, 0 deletions
diff --git a/scripts/gimmie.pl b/scripts/gimmie.pl
new file mode 100644
index 0000000..df0102d
--- /dev/null
+++ b/scripts/gimmie.pl
@@ -0,0 +1,39 @@
+use strict;
+use Irssi;
+use vars qw($VERSION %IRSSI);
+
+$VERSION = "1.0";
+%IRSSI = (
+ authors => 'PrincessLeia2',
+ contact => 'lyz\@princessleia.com ',
+ name => 'gimmie',
+ description => 'a bot script, using ! followed by anything the script will say (as an action): gets nickname anything',
+ license => 'GNU GPL v2 or later',
+ url => 'http://www.princessleia.com/'
+);
+
+sub event_privmsg {
+my ($server, $data, $nick, $mask, $target) =@_;
+my ($target, $text) = $data =~ /^(\S*)\s:(.*)/;
+ return if ( $text !~ /^!/i );
+ if ( $text =~ /^!coffee$/i ) {
+ $server->command ( "action $target hands $nick a steaming cup of coffee" );
+ }
+ elsif ($text =~ /^!chimay$/i ) {
+ $server->command ( "action $target hands $nick a glass of Chimay" );
+ }
+ elsif ($text =~ /^!pepsi$/i ) {
+ $server->command ( "action $target gives $nick a can of Star Wars Pepsi" );
+ }
+ elsif ($text =~ /^!ice cream$/i ) {
+ $server->command ( "action $target gives $nick a chocolate ice cream with lots of cherries" );
+ }
+ elsif ($text =~ /^!$nick$/i ) {
+ $server->command ( "msg $target get yourself?" );
+ }
+ else {
+ my ($gimmie) = $text =~ /!(.*)/;
+ $server->command ( "action $target Gets $nick $gimmie \0032<\%)");
+ }
+}
+Irssi::signal_add('event privmsg', 'event_privmsg');