diff --git a/xenia.pl b/xenia.pl index 4d73c3f..d4b833e 100644 --- a/xenia.pl +++ b/xenia.pl @@ -1,37 +1,37 @@ -#!/usr/bin/perl use strict; -use vars qw($VERSION %IRSSI); - -use Irssi; -$VERSION = '1.00'; -%IRSSI = ( - authors => 'Sunblade', - contact => 'sunblade@tilde.club', - name => 'Xenia', - description => 'Functions for Xenia, my IRC bot on irc.newnet.net', - license => 'MIT', -); - -sub event_privmsg { - # $data = "nick/#channel :text" - my ($server, $data, $nick, $address) = @_; - my ($target, $text) = split(/ :/, $data, 2); - if ($target == '#Enigma') { - if ($text eq '!try') { - try($nick, $target, $data, $server, $text); - } - } -} - -sub try { -my ($nick, $target, $data, $server, $text) = @_; -my $tr = int(rand(1000000)); -if ($tr != 738056) { - $server->command("MSG $target $nick you have failed to find the awarded ticket - r: $tr"); -} -else { - $server->command("MSG $target $nick you have FOUND the awarded ticket...UNBELIEVABLE!"); -} -# Irssi::print("Debug: $target $nick - $data / $server / $text"); -} - -Irssi::signal_add("event privmsg", "event_privmsg") +#!/usr/bin/perl use strict; +use vars qw($VERSION %IRSSI); +use Irssi; + +$VERSION = '1.00'; +%IRSSI = ( + authors => 'Sunblade', + contact => 'sunblade@tilde.club', + name => 'Xenia', + description => 'Functions for Xenia, my IRC bot on irc.newnet.net', + license => 'MIT', +); + +sub event_privmsg { + # $data = "nick/#channel :text" + my ($server, $data, $nick, $address) = @_; + my ($target, $text) = split(/ :/, $data, 2); + if ($target eq '#Enigma') { + if ($text eq '!try') { + try($nick, $target, $data, $server, $text); + } + } +} + +sub try { + my ($nick, $target, $data, $server, $text) = @_; + my $tr = int(rand(1000000)); + if ($tr != 738056) { + $server->command("MSG $target $nick you have failed to find the awarded ticket #$tr"); +} +else { + $server->command("MSG $target $nick you have FOUND the awarded ticket #tr ... UNBELIEVABLE!"); + } +# Irssi::print("Debug: $target $nick - $data / $server / $text"); +} + +Irssi::signal_add("event privmsg", "event_privmsg")