mirror of
https://tildegit.org/Sunblade/Xenia.git
synced 2026-01-24 12:20:19 +00:00
Compare commits
4 Commits
6fe1ded6fa
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
faa4ee5461 | ||
|
|
a2dbd0bfb4 | ||
|
|
d54a896119 | ||
|
|
db329dfa42 |
@@ -2,4 +2,6 @@
|
|||||||
|
|
||||||
Script for Irssi.
|
Script for Irssi.
|
||||||
|
|
||||||
Functions for Xenia, my IRC bot on irc.newnet.net
|
Functions for Xenia, my IRC bot on irc.newnet.net
|
||||||
|
|
||||||
|
At some point i plan port it to Limnoria or Eggdrop.
|
||||||
74
xenia.pl
74
xenia.pl
@@ -1,37 +1,37 @@
|
|||||||
#!/usr/bin/perl use strict;
|
#!/usr/bin/perl use strict;
|
||||||
use vars qw($VERSION %IRSSI);
|
use vars qw($VERSION %IRSSI);
|
||||||
|
use Irssi;
|
||||||
use Irssi;
|
|
||||||
$VERSION = '1.00';
|
$VERSION = '1.00';
|
||||||
%IRSSI = (
|
%IRSSI = (
|
||||||
authors => 'Sunblade',
|
authors => 'Sunblade',
|
||||||
contact => 'sunblade@tilde.club',
|
contact => 'sunblade@tilde.club',
|
||||||
name => 'Xenia',
|
name => 'Xenia',
|
||||||
description => 'Functions for Xenia, my IRC bot on irc.newnet.net',
|
description => 'Functions for Xenia, my IRC bot on irc.newnet.net',
|
||||||
license => 'MIT',
|
license => 'MIT',
|
||||||
);
|
);
|
||||||
|
|
||||||
sub event_privmsg {
|
sub event_privmsg {
|
||||||
# $data = "nick/#channel :text"
|
# $data = "nick/#channel :text"
|
||||||
my ($server, $data, $nick, $address) = @_;
|
my ($server, $data, $nick, $address) = @_;
|
||||||
my ($target, $text) = split(/ :/, $data, 2);
|
my ($target, $text) = split(/ :/, $data, 2);
|
||||||
if ($target == '#Enigma') {
|
if (lc($target) eq '#enigma') {
|
||||||
if ($text eq '!try') {
|
if (lc($text) eq '!try') {
|
||||||
try($nick, $target, $data, $server, $text);
|
try($nick, $target, $data, $server, $text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sub try {
|
sub try {
|
||||||
my ($nick, $target, $data, $server, $text) = @_;
|
my ($nick, $target, $data, $server, $text) = @_;
|
||||||
my $tr = int(rand(1000000));
|
my $tr = int(rand(1000000));
|
||||||
if ($tr != 738056) {
|
if ($tr != 738056) {
|
||||||
$server->command("MSG $target $nick you have failed to find the awarded ticket - r: $tr");
|
$server->command("MSG $target $nick you have failed to find the awarded ticket - Found: #$tr");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$server->command("MSG $target $nick you have FOUND the awarded ticket...UNBELIEVABLE!");
|
$server->command("MSG $target $nick you have FOUND the awarded ticket #$tr ... UNBELIEVABLE!");
|
||||||
}
|
}
|
||||||
# Irssi::print("Debug: $target $nick - $data / $server / $text");
|
# Irssi::print("Debug: $target $nick - $data / $server / $text");
|
||||||
}
|
}
|
||||||
|
|
||||||
Irssi::signal_add("event privmsg", "event_privmsg")
|
Irssi::signal_add("event privmsg", "event_privmsg")
|
||||||
|
|||||||
Reference in New Issue
Block a user