Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
51f30e6346 | ||
|
|
82c0201c34 | ||
|
|
3da9a98feb | ||
|
|
ee1bf65766 | ||
|
|
69927a21de | ||
|
|
bb10d54844 | ||
|
|
1adcd0323b | ||
|
|
743bee7424 | ||
|
|
56b55d8370 | ||
|
|
8ec0a389d5 | ||
|
|
a9d6e3482b | ||
|
|
ae9401bf7d | ||
|
|
c818d13e04 | ||
|
|
cf6a99e170 | ||
|
|
516d11a5f7 | ||
|
|
dc96422598 | ||
|
|
e525af97a7 | ||
|
|
60e9bca86d | ||
|
|
8b3f287a49 | ||
|
|
da15ed72e8 | ||
|
|
76e903bb87 | ||
|
|
36b3761977 | ||
|
|
a6da576144 | ||
|
|
a2975d4859 | ||
|
|
a328fc45cd | ||
|
|
38015434e1 | ||
|
|
fe353984c2 | ||
|
|
d31b16200e | ||
|
|
9a526e1427 | ||
|
|
8ddd4f5bae | ||
|
|
1ef6814e9b | ||
|
|
37030d7a55 | ||
|
|
94db7280ff | ||
|
|
50f577470e | ||
|
|
6dd9ab5322 | ||
|
|
1e45c53d38 | ||
|
|
07d9c19b53 | ||
|
|
a79e6f3801 | ||
|
|
1bcc849083 | ||
|
|
31428c8089 | ||
|
|
8f58cb3c9f | ||
|
|
bc287589bb | ||
|
|
de3e914e3d | ||
|
|
e868892f51 | ||
|
|
ce8ef76363 | ||
|
|
06f22be92b | ||
|
|
d12c139829 | ||
|
|
3a8c2f31ba | ||
|
|
051c189fe8 | ||
|
|
6035a0fdb5 | ||
|
|
6539bd5fed | ||
|
|
8780cf5b93 | ||
|
|
a357eab962 | ||
|
|
e2038ed983 | ||
|
|
2469d636f5 | ||
|
|
176f861d2c | ||
|
|
68e9f59267 | ||
|
|
48864ee9fb | ||
|
|
e833309c4e | ||
|
|
3c81f0587a | ||
|
|
5366855f96 | ||
|
|
caf9b36b8c | ||
|
|
789cec8f80 | ||
|
|
ed72b5e444 | ||
|
|
3cfe22e5c1 | ||
|
|
ea775d4c98 | ||
|
|
153084f808 | ||
|
|
637db6bae4 | ||
|
|
7f4ea8d196 | ||
|
|
8ee16eb39b |
No files matched your search
@@ -2,3 +2,5 @@ auto.conf
|
||||
build/*
|
||||
*.swp
|
||||
autodoc/*
|
||||
*.db
|
||||
var/*
|
||||
@@ -7,34 +7,30 @@
|
||||
|
||||
3.0
|
||||
|
||||
|
||||
The future of IRC bots is here! Xelhua gives to you, Auto 3.0, a new version of
|
||||
the popular Auto IRC bot.
|
||||
|
||||
In this alpha8 release, we have added:
|
||||
In this alpha10 release, we have added:
|
||||
|
||||
* A module to get information on a package in AUR (AUR).
|
||||
* Support for installs to custom locations.
|
||||
* Support for system-wide installs. (/usr or /usr/local)
|
||||
* The `wizard` utility, for creating local Auto config directories.
|
||||
* EightBall rewritten to be much nicer.
|
||||
* A module to translate English into LOLCAT (LOLCAT).
|
||||
* Command aliasing via aliases blocks in the config.
|
||||
* Added optional uno:english and required uno:msg options. See documentation for UNO.
|
||||
* Added fastest/slowest game, most cards and most players records to UNO.
|
||||
* German translation for AUR command help.
|
||||
* German translation for Bitly command help.
|
||||
* German translation for Calc command help.
|
||||
* German translation for Dictionary command help.
|
||||
* German translation for EightBall command help.
|
||||
* German translation for Eval command help.
|
||||
* German translation for FML command help.
|
||||
* German translation for Greet command help.
|
||||
* Aliases now work in PM's to the bot too.
|
||||
|
||||
Bug fixes:
|
||||
|
||||
* Fixed an issue in auto --help that incorrectly displayed the binary name.
|
||||
* Fixed an exploit in QDB that allowed users to use services fantasy commands
|
||||
with the bot's account.
|
||||
* Fixed a bug in LinkTitle that caused multi-line <title>'s to display wrong.
|
||||
* Fixed a bug in UNO that allowed users to join more than once.
|
||||
* Fixed parsing of host masks with a / in them.
|
||||
* Security exploit (causes fatal error) in the HELP command.
|
||||
* Security exploit (wide characters) in plaintext socket management.
|
||||
|
||||
Incompatibilities:
|
||||
|
||||
* UNO has a uno:msg config option. See documentation for UNO.
|
||||
* Must be re-installed, run ./install [options]
|
||||
None
|
||||
|
||||
We thank you for choosing Auto. Please remember that he is coming to late
|
||||
development stages soon, and testers are needed! But we hope we've piqued
|
||||
@@ -44,4 +40,4 @@ created by anyone and uploaded there for everyone to use.
|
||||
Auto's goal is to create an efficient, stable and highly customizable IRC bot
|
||||
in Perl. To offer an alternative to other platforms.
|
||||
|
||||
Enjoy Auto 3.0.0 Alpha 8!
|
||||
Enjoy Auto 3.0.0 Alpha 10!
|
||||
@@ -38,7 +38,8 @@ Contributors - Non-developers who contribute to the project greatly.
|
||||
|
||||
3. HOW TO INSTALL
|
||||
|
||||
Installation documentation is at: http://wiki.xelhua.org/index.php/Auto:Install
|
||||
Installation documentation is at:
|
||||
http://wiki.xelhua.org/index.php/Auto:Installation_guide
|
||||
|
||||
|
||||
4. HOW TO UPGRADE
|
||||
|
||||
@@ -42,7 +42,7 @@ greatly.
|
||||
|
||||
## 3. HOW TO INSTALL
|
||||
|
||||
Installation documentation can be found [here](http://wiki.xelhua.org/index.php/Auto:Install).
|
||||
Installation documentation can be found [here](http://wiki.xelhua.org/index.php/Auto:Installation_guide).
|
||||
|
||||
|
||||
## 4. HOW TO UPGRADE
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
:: auto.bat - Launcher for Microsoft Windows.
|
||||
:: Copyright (C) 2010-2011 Xelhua Development Group, et al.
|
||||
:: Released under the terms stated in doc/LICENSE.
|
||||
:: Clone of `auto`, since Windows likes Batch, not sh.
|
||||
|
||||
@echo off
|
||||
|
||||
set pidfile=bin/auto.pid
|
||||
|
||||
if "%1" == "" goto errparams
|
||||
if "%1" == "start" goto start
|
||||
if "%1" == "status" goto status
|
||||
else goto errparams
|
||||
|
||||
:errparams
|
||||
echo.
|
||||
echo Usage: auto.bat (start|status) [force]
|
||||
:end
|
||||
|
||||
:start
|
||||
echo.
|
||||
if exist "%pidfile" (
|
||||
if "%2" == "force" (
|
||||
echo Starting Auto. . .
|
||||
perl bin/auto
|
||||
)
|
||||
else (
|
||||
echo Auto appears to be running already. Run `auto.bat start force` to start anyway.
|
||||
)
|
||||
)
|
||||
else (
|
||||
echo Starting Auto. . .
|
||||
perl bin/auto
|
||||
)
|
||||
:end
|
||||
|
||||
:status
|
||||
echo.
|
||||
if exist "%pidfile" (
|
||||
echo Status: Auto appears to be running.
|
||||
)
|
||||
else (
|
||||
echo Status: Auto appears to not be running.
|
||||
)
|
||||
:end
|
||||
@@ -9,7 +9,6 @@ use strict;
|
||||
use warnings;
|
||||
no feature qw(state);
|
||||
use POSIX;
|
||||
use locale;
|
||||
use English qw(-no_match_vars);
|
||||
use Sys::Hostname;
|
||||
use IO::Socket;
|
||||
@@ -147,15 +146,11 @@ API::Std::event_add('on_sighup');
|
||||
our ($DEBUG, $NUC);
|
||||
my ($opt_help, $opt_version, $USECONFIG);
|
||||
GetOptions(
|
||||
'nuc' => \$NUC,
|
||||
'c=s' => \$USECONFIG,
|
||||
'config=s' => \$USECONFIG,
|
||||
'h' => \$opt_help,
|
||||
'help' => \$opt_help,
|
||||
'd' => \$DEBUG,
|
||||
'debug' => \$DEBUG,
|
||||
'v' => \$opt_version,
|
||||
'version' => \$opt_version
|
||||
'nuc' => \$NUC,
|
||||
'config|c=s' => \$USECONFIG,
|
||||
'h|help' => \$opt_help,
|
||||
'debug|d' => \$DEBUG,
|
||||
'version|v' => \$opt_version,
|
||||
);
|
||||
|
||||
# If we were passed -h, print help.
|
||||
@@ -235,8 +230,8 @@ undef $USECONFIG;
|
||||
if (conf_get('die')) {
|
||||
if ((conf_get('die'))[0][0] == 1) {
|
||||
say '!!! You didn\'t read the whole config.';
|
||||
say '!!! Insert new user then try again.';
|
||||
exit;
|
||||
say '!!! Insert new user then try again.';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,11 +239,11 @@ if (conf_get('die')) {
|
||||
my @REQCVALS = qw(locale expire_logs server fantasy_pf ratelimit database:format bantype);
|
||||
foreach my $REQCVAL (@REQCVALS) {
|
||||
if (!conf_get($REQCVAL)) {
|
||||
my $err = 2;
|
||||
if ($REQCVAL eq 'expire_logs') {
|
||||
$err = 1;
|
||||
}
|
||||
err($err, "Missing required configuration value: $REQCVAL", 1);
|
||||
my $err = 2;
|
||||
if ($REQCVAL eq 'expire_logs') {
|
||||
$err = 1;
|
||||
}
|
||||
err($err, "Missing required configuration value: $REQCVAL", 1);
|
||||
}
|
||||
}
|
||||
undef @REQCVALS;
|
||||
@@ -306,18 +301,6 @@ given (lc((conf_get('database:format'))[0][0])) {
|
||||
(conf_get('database:username'))[0][0], (conf_get('database:password'))[0][0]) or err(2, 'Failed to connect to database!', 1);;
|
||||
}
|
||||
}
|
||||
# CSV no work. :(
|
||||
#when ('csv') {
|
||||
# # CSV.
|
||||
# if ($ENFEAT !~ /csv/) { err(2, 'Auto not built with CSV support.', 1) }
|
||||
# if (!conf_get('database:dir')) { err(2, 'Missing required configuration value database:dir. Aborting.', 1) }
|
||||
#
|
||||
# # Import DBD::CSV.
|
||||
# require DBD::CSV;
|
||||
#
|
||||
# # Connect to database.
|
||||
# $DB = DBI->connect("dbi:CSV:f_dir=$bin{etc}/".(conf_get('database:dir'))[0][0]) or err(2, 'Failed to connect to database!', 1);
|
||||
#}
|
||||
when ('pgsql') {
|
||||
# PostgreSQL.
|
||||
if ($ENFEAT !~ /pgsql/) { err(2, 'Auto not built with PostgreSQL support. Aborting.', 1) }
|
||||
@@ -356,44 +339,44 @@ if (conf_get('privset')) {
|
||||
my %tcprivs = conf_get('privset');
|
||||
|
||||
foreach my $tckpriv (keys %tcprivs) {
|
||||
# For each privset, get the inner values.
|
||||
my %mcprivs = conf_get("privset:$tckpriv");
|
||||
# For each privset, get the inner values.
|
||||
my %mcprivs = conf_get("privset:$tckpriv");
|
||||
|
||||
# Iterate through them.
|
||||
foreach my $mckpriv (keys %mcprivs) {
|
||||
# Switch statement for the values.
|
||||
given ($mckpriv) {
|
||||
# If it's 'priv', save it as a privilege.
|
||||
when ('priv') {
|
||||
if (defined $PRIVILEGES{$tckpriv}) {
|
||||
# If this privset exists, push to it.
|
||||
push @{ $PRIVILEGES{$tckpriv} }, ($mcprivs{$mckpriv})[0][0];
|
||||
}
|
||||
else {
|
||||
# Otherwise, create it.
|
||||
@{ $PRIVILEGES{$tckpriv} } = (($mcprivs{$mckpriv})[0][0]);
|
||||
}
|
||||
}
|
||||
# If it's 'inherit', inherit the privileges of another privset.
|
||||
when ('inherit') {
|
||||
# If the privset we're inheriting exists, continue.
|
||||
if (defined $PRIVILEGES{($mcprivs{$mckpriv})[0][0]}) {
|
||||
# Iterate through each privilege.
|
||||
foreach (@{ $PRIVILEGES{($mcprivs{$mckpriv})[0][0]} }) {
|
||||
# And save them to the privset inheriting them
|
||||
if (defined $PRIVILEGES{$tckpriv}) {
|
||||
# If this privset exists, push to it.
|
||||
push @{ $PRIVILEGES{$tckpriv} }, $_;
|
||||
}
|
||||
else {
|
||||
# Otherwise, create it.
|
||||
@{ $PRIVILEGES{$tckpriv} } = ($_);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach my $mckpriv (keys %mcprivs) {
|
||||
# Switch statement for the values.
|
||||
given ($mckpriv) {
|
||||
# If it's 'priv', save it as a privilege.
|
||||
when ('priv') {
|
||||
if (defined $PRIVILEGES{$tckpriv}) {
|
||||
# If this privset exists, push to it.
|
||||
push @{ $PRIVILEGES{$tckpriv} }, ($mcprivs{$mckpriv})[0][0];
|
||||
}
|
||||
else {
|
||||
# Otherwise, create it.
|
||||
@{ $PRIVILEGES{$tckpriv} } = (($mcprivs{$mckpriv})[0][0]);
|
||||
}
|
||||
}
|
||||
# If it's 'inherit', inherit the privileges of another privset.
|
||||
when ('inherit') {
|
||||
# If the privset we're inheriting exists, continue.
|
||||
if (defined $PRIVILEGES{($mcprivs{$mckpriv})[0][0]}) {
|
||||
# Iterate through each privilege.
|
||||
foreach (@{ $PRIVILEGES{($mcprivs{$mckpriv})[0][0]} }) {
|
||||
# And save them to the privset inheriting them
|
||||
if (defined $PRIVILEGES{$tckpriv}) {
|
||||
# If this privset exists, push to it.
|
||||
push @{ $PRIVILEGES{$tckpriv} }, $_;
|
||||
}
|
||||
else {
|
||||
# Otherwise, create it.
|
||||
@{ $PRIVILEGES{$tckpriv} } = ($_);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,9 +406,9 @@ if (!$DEBUG) {
|
||||
my $pidfile;
|
||||
if ($UPREFIX) { $pidfile = "$bin{cwd}/auto.pid" }
|
||||
else { $pidfile = "$Bin/auto.pid" }
|
||||
open my $FPID, '>', $pidfile or exit;
|
||||
print {$FPID} "$APID\n" or exit;
|
||||
close $FPID or exit;
|
||||
open my $FPID, '>', $pidfile or exit;
|
||||
print {$FPID} "$APID\n" or exit;
|
||||
close $FPID or exit;
|
||||
exit;
|
||||
}
|
||||
POSIX::setsid() or err(2, "Can't start a new session: $ERRNO", 1);
|
||||
@@ -448,7 +431,7 @@ if (conf_get('module')) {
|
||||
alog '* Loading modules...';
|
||||
dbug '* Loading modules...';
|
||||
foreach (@{ (conf_get('module'))[0] }) {
|
||||
mod_load($_);
|
||||
mod_load($_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -498,38 +481,38 @@ if (conf_get('aliases:alias')) {
|
||||
while (1) {
|
||||
# Timer check.
|
||||
foreach my $tk (keys %TIMERS) {
|
||||
if ($TIMERS{$tk}{time} <= time) {
|
||||
&{ $TIMERS{$tk}{sub} }();
|
||||
if ($TIMERS{$tk}{type} == 1) {
|
||||
# If it's type 1, delete from memory.
|
||||
delete $TIMERS{$tk};
|
||||
}
|
||||
elsif ($TIMERS{$tk}{type} == 2) {
|
||||
# If it's type 2, reset timer.
|
||||
$TIMERS{$tk}{time} = time + $TIMERS{$tk}{secs};
|
||||
}
|
||||
else {
|
||||
# This should never happen.
|
||||
delete $TIMERS{$tk};
|
||||
}
|
||||
}
|
||||
if ($TIMERS{$tk}{time} <= time) {
|
||||
&{ $TIMERS{$tk}{sub} }();
|
||||
if ($TIMERS{$tk}{type} == 1) {
|
||||
# If it's type 1, delete from memory.
|
||||
delete $TIMERS{$tk};
|
||||
}
|
||||
elsif ($TIMERS{$tk}{type} == 2) {
|
||||
# If it's type 2, reset timer.
|
||||
$TIMERS{$tk}{time} = time + $TIMERS{$tk}{secs};
|
||||
}
|
||||
else {
|
||||
# This should never happen.
|
||||
delete $TIMERS{$tk};
|
||||
}
|
||||
}
|
||||
}
|
||||
# Socket check.
|
||||
foreach my $sock ($SELECT->can_read(1)) {
|
||||
# Figure out what network is sending us data.
|
||||
my $sockid;
|
||||
foreach (keys %SOCKET) {
|
||||
if ($SOCKET{$_} eq $sock) { $sockid = $_ }
|
||||
}
|
||||
# Read the data.
|
||||
my $idata;
|
||||
sysread $sock, $idata, POSIX::BUFSIZ, 0;
|
||||
# Figure out what network is sending us data.
|
||||
my $sockid;
|
||||
foreach (keys %SOCKET) {
|
||||
if ($SOCKET{$_} eq $sock) { $sockid = $_ }
|
||||
}
|
||||
# Read the data.
|
||||
my $idata;
|
||||
sysread $sock, $idata, POSIX::BUFSIZ, 0;
|
||||
|
||||
# Check for the data.
|
||||
if (!defined $idata || length($idata) == 0) {
|
||||
# Got EOF, close socket
|
||||
err(2, "Lost connection to $sockid!", 0);
|
||||
$SELECT->remove($sock);
|
||||
# Check for the data.
|
||||
if (!defined $idata || length($idata) == 0) {
|
||||
# Got EOF, close socket
|
||||
err(2, "Lost connection to $sockid!", 0);
|
||||
$SELECT->remove($sock);
|
||||
delete $SOCKET{$sockid};
|
||||
API::Std::event_run('on_disconnect', $sockid);
|
||||
if (!keys %SOCKET) {
|
||||
@@ -541,21 +524,21 @@ while (1) {
|
||||
exit;
|
||||
}
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
# Read the buffer.
|
||||
my $data .= $idata;
|
||||
while ($data =~ s/(.*\n)//) {
|
||||
my $line = $1;
|
||||
my $data .= $idata;
|
||||
while ($data =~ s/(.*\n)//) {
|
||||
my $line = $1;
|
||||
|
||||
# Remove the newlines.
|
||||
chomp $line;
|
||||
# Debug.
|
||||
dbug $sockid.' >> '.$line;
|
||||
chomp $line;
|
||||
# Debug.
|
||||
dbug $sockid.' >> '.$line;
|
||||
|
||||
# Parse data.
|
||||
Proto::IRC::ircparse($sockid, $line);
|
||||
}
|
||||
Proto::IRC::ircparse($sockid, $line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -568,12 +551,12 @@ sub socksnd {
|
||||
my ($svr, $data) = @_;
|
||||
|
||||
if (defined $SOCKET{$svr}) {
|
||||
syswrite $SOCKET{$svr}, $data."\r\n", POSIX::BUFSIZ, 0;
|
||||
dbug "$svr << $data";
|
||||
return 1;
|
||||
syswrite $SOCKET{$svr}, "$data\r\n", POSIX::BUFSIZ, 0;
|
||||
dbug "$svr << $data";
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,44 @@ Auto IRC Bot 3.0: Change Log
|
||||
===============================================================================
|
||||
|
||||
|
||||
3.0 Alpha 10
|
||||
===============================================================================
|
||||
* Werewolf moved to unstable/ for exclusion from alpha10.
|
||||
* Werewolf: Fixed a bug causing double lynches occasionally.
|
||||
* Werewolf: One bug fix and multiple bullets.
|
||||
* Werewolf: Fixed timeout bug.
|
||||
* Werewolf: Fixed various warnings.
|
||||
* Werewolf: Handful of bugs fixed, timeouts rewritten, wolf assignment
|
||||
rewritten. (see ROLES:Werewolf)
|
||||
* Werewolf: Fixed an annoyance in VOTES.
|
||||
* Werewolf: Fixed another round of bugs.
|
||||
* Werewolf: Fixed a grammatical error. Thanks TAD!
|
||||
* Werewolf: Fixed a bug that occasionally caused a person to get wolf
|
||||
twice in the same game.
|
||||
* Werewolf: Fixed a typo that broke the gun on occasion.
|
||||
* Fixed a minor retract bug in Werewolf.
|
||||
* Fixed two major bugs in Werewolf that messed up game play.
|
||||
* Fixed several bugs and changed around JOIN/START/BEGIN in Werewolf.
|
||||
* Fixed parsing of host masks with / in them. (if it was broken)
|
||||
* Werewolf: Fixed a leave before game begin bug.
|
||||
* Aliases now work in PM's to the bot too.
|
||||
* Added an epic, Werewolf module.
|
||||
* Made slog() saner.
|
||||
* Syntax for mod_init() changed. Package name is no longer required.
|
||||
* Added German translation to Greet help hash. - nridley
|
||||
* Added German translation to FML help hash. - nridley
|
||||
* Added German translation to Eval help hash. - nridley
|
||||
* Added German translation to EightBall help hash. - nridley
|
||||
* Added German translation to Dictionary help hash. - nridley
|
||||
* Added German translation to Calc help hash. - nridley
|
||||
* Added German translation to Bitly help hash. - nridley
|
||||
* Added German translation to AUR help hash. - nridley
|
||||
|
||||
3.0 Alpha 9
|
||||
===============================================================================
|
||||
* Bug fix: Fixed an exploit in QDB RAND.
|
||||
* UNO: Fixed a formatting issue in duration.
|
||||
|
||||
3.0 Alpha 8
|
||||
===============================================================================
|
||||
* Full support for custom PREFIX installs (including global installs) has
|
||||
|
||||
@@ -9,6 +9,10 @@ Chazz "Alexandria" Wolcott <alyx@woomoo.org>
|
||||
|
||||
Matthew "Mab879" Burket <matthew@assignitapp.com>
|
||||
- Spanish translations
|
||||
Noah "nridley" Ridley <nridley44@gmail.com>
|
||||
- Various.
|
||||
Eitan "variable" Adler <lists@eitanadler.com>
|
||||
- Werewolf improvements.
|
||||
|
||||
-----------------------------------------------
|
||||
|
||||
|
||||
@@ -42,18 +42,18 @@ Legend:
|
||||
|
||||
[!] Features
|
||||
[X] Weather module
|
||||
[!] Urban Dictionary module
|
||||
[ ] Urban Dictionary module
|
||||
[X] UNO module
|
||||
[ ] Google Search module
|
||||
[ ] IRC Relay module
|
||||
[ ] (Google?) News module
|
||||
[X] QDB module
|
||||
[ ] Tumblr module
|
||||
[!] Tumblr module
|
||||
[X] Google Calculator module
|
||||
[ ] YouTube Search module
|
||||
[ ] Twitter module
|
||||
[X] Advanced Topics module
|
||||
[ ] Custom Triggers module
|
||||
[!] Custom Triggers module
|
||||
[X] Shorten URL (bit.ly?) module
|
||||
[?] Bot Talk module
|
||||
[O] Minecraft<->IRC module
|
||||
|
||||
+2
-1
@@ -216,9 +216,10 @@ sub match_mask {
|
||||
$mh =~ s/\./\\\./gxsm;
|
||||
$mh =~ s/\?/\./gxsm;
|
||||
$mh =~ s/\*/\.\*/gxsm;
|
||||
$mh =~ s/\//\\\//gxsm;
|
||||
$mh = q{^}.$mh.q{$};
|
||||
|
||||
# Let's grep the user's mask.
|
||||
# Let's match the user's mask.
|
||||
if ($mu =~ m/$mh/xsm) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -113,6 +113,9 @@ sub slog
|
||||
if (conf_get('logchan')) {
|
||||
# It is, continue.
|
||||
|
||||
# Don't even bother with continuing if there are *NO* connections.
|
||||
if (!keys %Auto::SOCKET) { return }
|
||||
|
||||
# Split the network and channel.
|
||||
my ($net, $chan) = split m/[\/]/xsm, (conf_get('logchan'))[0][0];
|
||||
$chan = lc $chan;
|
||||
|
||||
+3
-2
@@ -17,7 +17,8 @@ our @EXPORT_OK = qw(conf_get trans err awarn timer_add timer_del cmd_add
|
||||
|
||||
# Initialize a module.
|
||||
sub mod_init {
|
||||
my ($name, $author, $version, $autover, $pkg) = @_;
|
||||
my ($name, $author, $version, $autover) = @_;
|
||||
my $pkg = caller 0;
|
||||
|
||||
# Log/debug.
|
||||
API::Log::dbug('MODULES: Attempting to load '.$name.' (version '.$version.') by '.$author.'...');
|
||||
@@ -25,7 +26,7 @@ sub mod_init {
|
||||
if (keys %Auto::SOCKET) { API::Log::slog('MODULES: Attempting to load '.$name.' (version '.$version.') by '.$author.'...') }
|
||||
|
||||
# Check if this module is compatible with this version of Auto.
|
||||
if ($autover !~ m/^3\.0\.0a(7|8)$/xsm) {
|
||||
if ($autover !~ m/^3\.0\.0a(7|8|9|10)$/xsm) {
|
||||
API::Log::dbug('MODULES: Failed to load '.$name.': Incompatible with your version of Auto.');
|
||||
API::Log::alog('MODULES: Failed to load '.$name.': Incompatible with your version of Auto.');
|
||||
if (keys %Auto::SOCKET) { API::Log::slog('MODULES: Failed to load '.$name.': Incompatible with your version of Auto.') }
|
||||
|
||||
+3
-3
@@ -265,7 +265,7 @@ sub cmd_help
|
||||
# Help for a specific command was requested. Lets get it.
|
||||
my $rcm = uc($argv[0]);
|
||||
|
||||
if (defined $API::Std::CMDS{$rcm}{help}) {
|
||||
if (exists $API::Std::CMDS{$rcm}{help}) {
|
||||
# If there is help for this command.
|
||||
|
||||
# Check for necessary privileges.
|
||||
@@ -282,13 +282,13 @@ sub cmd_help
|
||||
# Get the language.
|
||||
my ($lang, undef) = split('_', $Auto::LOCALE);
|
||||
|
||||
if (defined ${ $API::Std::CMDS{$rcm}{help} }{$lang}) {
|
||||
if (exists ${ $API::Std::CMDS{$rcm}{help} }{$lang}) {
|
||||
# If help for this command is available in the configured language.
|
||||
notice($src->{svr}, $src->{nick}, "Help for \002".$rcm."\002: ".${ $API::Std::CMDS{$rcm}{help} }{$lang});
|
||||
}
|
||||
else {
|
||||
# If it isn't, default to English.
|
||||
if (defined ${ $API::Std::CMDS{$rcm}{help} }{en}) {
|
||||
if (exists ${ $API::Std::CMDS{$rcm}{help} }{en}) {
|
||||
# If help for this command is available in English.
|
||||
notice($src->{svr}, $src->{nick}, "Help for \002".$rcm."\002: ".${ $API::Std::CMDS{$rcm}{help} }{en});
|
||||
}
|
||||
|
||||
+49
-22
@@ -26,7 +26,7 @@ hook_add("on_uprivmsg", "ctcp_version_reply", sub {
|
||||
return 1;
|
||||
});
|
||||
|
||||
# Command alias parsing.
|
||||
# Command alias parsing for channel messages.
|
||||
hook_add('on_cprivmsg', 'irc.commands.aliases', sub {
|
||||
my (($src, $chan, ($cmd, @args))) = @_;
|
||||
|
||||
@@ -61,6 +61,33 @@ hook_add('on_cprivmsg', 'irc.commands.aliases', sub {
|
||||
return 1;
|
||||
});
|
||||
|
||||
# Command alias parsing for private messages.
|
||||
hook_add('on_uprivmsg', 'irc.commands.aliases', sub {
|
||||
my (($src, ($cmd, @args))) = @_;
|
||||
|
||||
# Check for an alias.
|
||||
if (defined $API::Std::ALIASES{uc $cmd}) {
|
||||
# Get aliased command.
|
||||
my @actual;
|
||||
if ($API::Std::ALIASES{uc $cmd} =~ m/ /xsm) { @actual = split /\s/xsm, $API::Std::ALIASES{uc $cmd} }
|
||||
else { @actual = ($API::Std::ALIASES{uc $cmd}) }
|
||||
# Prepare data.
|
||||
my @msg = (
|
||||
q{:}.$src->{nick}.q{!}.$src->{user}.q{@}.$src->{host},
|
||||
'PRIVMSG',
|
||||
$State::IRC::botinfo{$src->{svr}}{nick},
|
||||
q{:}.$actual[0],
|
||||
);
|
||||
# Rest of the data.
|
||||
if (scalar @actual > 1) { for (1..$#actual) { push @msg, $actual[$_] } }
|
||||
if (defined $args[0]) { foreach (@args) { push @msg, $_ } }
|
||||
# Simulate a PRIVMSG.
|
||||
Proto::IRC::privmsg($src->{svr}, @msg);
|
||||
}
|
||||
|
||||
return 1;
|
||||
});
|
||||
|
||||
# QUIT hook; delete user from chanusers.
|
||||
hook_add("on_quit", "quit_update_chanusers", sub {
|
||||
my (($src, undef)) = @_;
|
||||
@@ -79,8 +106,8 @@ hook_add("on_connect", "on_connect_modes", sub {
|
||||
my ($svr) = @_;
|
||||
|
||||
if (conf_get("server:$svr:modes")) {
|
||||
my $connmodes = (conf_get("server:$svr:modes"))[0][0];
|
||||
API::IRC::umode($svr, $connmodes);
|
||||
my $connmodes = (conf_get("server:$svr:modes"))[0][0];
|
||||
API::IRC::umode($svr, $connmodes);
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -100,8 +127,8 @@ hook_add("on_connect", "plaintext_auth", sub {
|
||||
my ($svr) = @_;
|
||||
|
||||
if (conf_get("server:$svr:idstr")) {
|
||||
my $idstr = (conf_get("server:$svr:idstr"))[0][0];
|
||||
Auto::socksnd($svr, $idstr);
|
||||
my $idstr = (conf_get("server:$svr:idstr"))[0][0];
|
||||
Auto::socksnd($svr, $idstr);
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -116,9 +143,9 @@ hook_add("on_connect", "autojoin", sub {
|
||||
|
||||
# Join the channels.
|
||||
if (!defined $cajoin[1]) {
|
||||
# For single-line ajoins.
|
||||
my @sajoin = split(',', $cajoin[0]);
|
||||
|
||||
# For single-line ajoins.
|
||||
my @sajoin = split(',', $cajoin[0]);
|
||||
|
||||
foreach (@sajoin) {
|
||||
# Check if a key was specified.
|
||||
if ($_ =~ m/\s/xsm) {
|
||||
@@ -128,13 +155,13 @@ hook_add("on_connect", "autojoin", sub {
|
||||
}
|
||||
else {
|
||||
# Else join without one.
|
||||
API::IRC::cjoin($svr, $_);
|
||||
API::IRC::cjoin($svr, $_);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
# For multi-line ajoins.
|
||||
foreach (@cajoin) {
|
||||
# For multi-line ajoins.
|
||||
foreach (@cajoin) {
|
||||
# Check if a key was specified.
|
||||
if ($_ =~ m/\s/xsm) {
|
||||
# There was, join with it.
|
||||
@@ -178,17 +205,17 @@ hook_add('on_isupport', 'core.prefixchanmode.getdata', sub {
|
||||
|
||||
# Find PREFIX and CHANMODES.
|
||||
foreach my $ex (@ex) {
|
||||
if ($ex =~ m/^PREFIX/xsm) {
|
||||
# Found PREFIX.
|
||||
my $rpx = substr($ex, 8);
|
||||
my ($pm, $pp) = split('\)', $rpx);
|
||||
my @apm = split(//, $pm);
|
||||
my @app = split(//, $pp);
|
||||
foreach my $ppm (@apm) {
|
||||
# Store data.
|
||||
$Proto::IRC::csprefix{$svr}{$ppm} = shift(@app);
|
||||
}
|
||||
}
|
||||
if ($ex =~ m/^PREFIX/xsm) {
|
||||
# Found PREFIX.
|
||||
my $rpx = substr($ex, 8);
|
||||
my ($pm, $pp) = split('\)', $rpx);
|
||||
my @apm = split(//, $pm);
|
||||
my @app = split(//, $pp);
|
||||
foreach my $ppm (@apm) {
|
||||
# Store data.
|
||||
$Proto::IRC::csprefix{$svr}{$ppm} = shift(@app);
|
||||
}
|
||||
}
|
||||
elsif ($ex =~ m/^CHANMODES/xsm) {
|
||||
# Found CHANMODES.
|
||||
my ($mtl, $mtp, $mtpp, $mts) = split m/[,]/xsm, substr($ex, 10);
|
||||
|
||||
+4
-3
@@ -157,10 +157,10 @@ sub ircsock {
|
||||
|
||||
# Prepare socket data.
|
||||
my %conndata = (
|
||||
Proto => 'tcp',
|
||||
Proto => 'tcp',
|
||||
LocalAddr => $cdata->{'bind'}[0],
|
||||
PeerAddr => $cdata->{'host'}[0],
|
||||
PeerPort => $cdata->{'port'}[0],
|
||||
PeerAddr => $cdata->{'host'}[0],
|
||||
PeerPort => $cdata->{'port'}[0],
|
||||
Timeout => 20,
|
||||
);
|
||||
# Set IPv6/SSL data.
|
||||
@@ -211,6 +211,7 @@ sub ircsock {
|
||||
$Auto::SOCKET{$svrname} = IO::Socket::INET->new(%conndata) or # Or error.
|
||||
err(2, 'Failed to connect to server ('.$ERRNO.'): '.$svrname.' ['.$cdata->{'host'}[0].q{:}.$cdata->{'port'}[0].']', 0)
|
||||
and delete $Auto::SOCKET{$svrname} and next;
|
||||
binmode($Auto::SOCKET{$svrname}, ':encoding(UTF-8)');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ sub installmods
|
||||
chomp $response;
|
||||
if (lc $response eq 'y') {
|
||||
println 'What modules would you like to install? (separate by commas)';
|
||||
println 'Available modules: AUR, Badwords, Bitly, BotStats, Calc, ChanTopics, Dictionary, EightBall, Eval, FML, Greet, HelloChan, IsItUp, LinkTitle, LOLCAT, Oper, QDB, SASLAuth, UNO, Weather';
|
||||
println 'Available modules: AUR, Badwords, Bitly, BotStats, Calc, ChanTopics, Dictionary, EightBall, Eval, FML, Greet, HelloChan, IsItUp, LinkTitle, LOLCAT, Oper, QDB, SASLAuth, UNO, Weather, Werewolf';
|
||||
print '> ';
|
||||
my $modules = <STDIN>; chomp $modules;
|
||||
$modules =~ s/ //g;
|
||||
|
||||
+126
-126
@@ -14,7 +14,7 @@ sub new
|
||||
|
||||
# Check to see if the configuration file exists.
|
||||
if (!-e "$Auto::bin{etc}/$file") {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
# Open, read and close the config.
|
||||
@@ -44,135 +44,135 @@ sub parse
|
||||
|
||||
# Iterate the file.
|
||||
foreach my $buff (@fbuf) {
|
||||
# Main newline buffer.
|
||||
if (defined $buff) {
|
||||
# If the line begins with a #, it's a comment so ignore it.
|
||||
if (substr($buff, 0, 1) eq '#') {
|
||||
next;
|
||||
}
|
||||
|
||||
if ($buff =~ m/;/) {
|
||||
# Semicolon buffer.
|
||||
my @asbuf = split(';', $buff);
|
||||
foreach my $asbuff (@asbuf) {
|
||||
if (defined $asbuff) {
|
||||
|
||||
# Space buffer.
|
||||
my @ebuf = split(' ', $asbuff);
|
||||
if (!defined $ebuf[0] or !defined $ebuf[1]) {
|
||||
# Garbage. Ignoring.
|
||||
next;
|
||||
}
|
||||
my $param = $ebuf[1];
|
||||
|
||||
if (substr($param, 0, 1) eq '"' and substr($param, length($param) - 1, 1) ne '"') {
|
||||
# Multi-word string.
|
||||
$param = substr($param, 1);
|
||||
|
||||
for (my $i = 2; $i < scalar(@ebuf); $i++) {
|
||||
if (substr($ebuf[$i], length($ebuf[$i]) - 1, 1) eq '"') {
|
||||
$param .= " ".substr($ebuf[$i], 0, length($ebuf[$i]) - 1);
|
||||
last;
|
||||
}
|
||||
else {
|
||||
$param .= " ".$ebuf[$i];
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif (substr($param, 0, 1) eq '"' and substr($param, length($param) - 1, 1) eq '"') {
|
||||
# Single-word string.
|
||||
$param = substr($param, 1, length($ebuf[1]) - 2);
|
||||
}
|
||||
elsif ($param =~ m/[0-9]/) {
|
||||
# Numeric.
|
||||
$param =~ s/[^0-9.]//g;
|
||||
}
|
||||
else {
|
||||
# Garbage.
|
||||
next;
|
||||
}
|
||||
|
||||
my @param = ($param);
|
||||
|
||||
unless (!$blk) {
|
||||
# We're inside a block.
|
||||
if ($blk =~ m/@@@/) {
|
||||
# We're inside a block with a parameter.
|
||||
my @sblk = split('@@@', $blk);
|
||||
|
||||
# Check to see if this config option already exists.
|
||||
if (defined $rs{$sblk[0]}{$sblk[1]}{$ebuf[0]}) {
|
||||
# It does, so merely push this second one to the existing array.
|
||||
push(@{ $rs{$sblk[0]}{$sblk[1]}{$ebuf[0]} }, $param);
|
||||
}
|
||||
else {
|
||||
# It doesn't, create it as an array.
|
||||
@{ $rs{$sblk[0]}{$sblk[1]}{$ebuf[0]} } = @param;
|
||||
}
|
||||
}
|
||||
else {
|
||||
# We're inside a block with no parameter.
|
||||
|
||||
# Check to see if this config option already exists.
|
||||
if (defined $rs{$blk}{$ebuf[0]}) {
|
||||
# It does, so merely push this second one to the existing array.
|
||||
# Main newline buffer.
|
||||
if (defined $buff) {
|
||||
# If the line begins with a #, it's a comment so ignore it.
|
||||
if (substr($buff, 0, 1) eq '#') {
|
||||
next;
|
||||
}
|
||||
|
||||
if ($buff =~ m/;/) {
|
||||
# Semicolon buffer.
|
||||
my @asbuf = split(';', $buff);
|
||||
foreach my $asbuff (@asbuf) {
|
||||
if (defined $asbuff) {
|
||||
|
||||
# Space buffer.
|
||||
my @ebuf = split(' ', $asbuff);
|
||||
if (!defined $ebuf[0] or !defined $ebuf[1]) {
|
||||
# Garbage. Ignoring.
|
||||
next;
|
||||
}
|
||||
my $param = $ebuf[1];
|
||||
|
||||
if (substr($param, 0, 1) eq '"' and substr($param, length($param) - 1, 1) ne '"') {
|
||||
# Multi-word string.
|
||||
$param = substr($param, 1);
|
||||
|
||||
for (my $i = 2; $i < scalar(@ebuf); $i++) {
|
||||
if (substr($ebuf[$i], length($ebuf[$i]) - 1, 1) eq '"') {
|
||||
$param .= " ".substr($ebuf[$i], 0, length($ebuf[$i]) - 1);
|
||||
last;
|
||||
}
|
||||
else {
|
||||
$param .= " ".$ebuf[$i];
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif (substr($param, 0, 1) eq '"' and substr($param, length($param) - 1, 1) eq '"') {
|
||||
# Single-word string.
|
||||
$param = substr($param, 1, length($ebuf[1]) - 2);
|
||||
}
|
||||
elsif ($param =~ m/[0-9]/) {
|
||||
# Numeric.
|
||||
$param =~ s/[^0-9.]//g;
|
||||
}
|
||||
else {
|
||||
# Garbage.
|
||||
next;
|
||||
}
|
||||
|
||||
my @param = ($param);
|
||||
|
||||
unless (!$blk) {
|
||||
# We're inside a block.
|
||||
if ($blk =~ m/@@@/) {
|
||||
# We're inside a block with a parameter.
|
||||
my @sblk = split('@@@', $blk);
|
||||
|
||||
# Check to see if this config option already exists.
|
||||
if (defined $rs{$sblk[0]}{$sblk[1]}{$ebuf[0]}) {
|
||||
# It does, so merely push this second one to the existing array.
|
||||
push(@{ $rs{$sblk[0]}{$sblk[1]}{$ebuf[0]} }, $param);
|
||||
}
|
||||
else {
|
||||
# It doesn't, create it as an array.
|
||||
@{ $rs{$sblk[0]}{$sblk[1]}{$ebuf[0]} } = @param;
|
||||
}
|
||||
}
|
||||
else {
|
||||
# We're inside a block with no parameter.
|
||||
|
||||
# Check to see if this config option already exists.
|
||||
if (defined $rs{$blk}{$ebuf[0]}) {
|
||||
# It does, so merely push this second one to the existing array.
|
||||
push(@{ $rs{$blk}{$ebuf[0]} }, $param);
|
||||
}
|
||||
else {
|
||||
# It doesn't, create it as an array.
|
||||
@{ $rs{$blk}{$ebuf[0]} } = @param;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
# We're not inside a block.
|
||||
|
||||
# Check to see if this config option already exists.
|
||||
if (defined $rs{$ebuf[0]}) {
|
||||
# It does, so merely push this second one to the existing array.
|
||||
push(@{ $rs{$ebuf[0]} }, $param);
|
||||
}
|
||||
else {
|
||||
# It doesn't, create it as an array.
|
||||
@{ $rs{$ebuf[0]} } = @param;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
# No semicolon space buffer.
|
||||
my @ebuf = split(' ', $buff);
|
||||
|
||||
if (!defined $ebuf[0]) {
|
||||
# Garbage. Ignoring.
|
||||
next;
|
||||
}
|
||||
|
||||
if (defined $ebuf[1]) {
|
||||
if ($ebuf[1] eq '{') {
|
||||
# This is the beginning of a block with no parameter.
|
||||
}
|
||||
else {
|
||||
# It doesn't, create it as an array.
|
||||
@{ $rs{$blk}{$ebuf[0]} } = @param;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
# We're not inside a block.
|
||||
|
||||
# Check to see if this config option already exists.
|
||||
if (defined $rs{$ebuf[0]}) {
|
||||
# It does, so merely push this second one to the existing array.
|
||||
push(@{ $rs{$ebuf[0]} }, $param);
|
||||
}
|
||||
else {
|
||||
# It doesn't, create it as an array.
|
||||
@{ $rs{$ebuf[0]} } = @param;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
# No semicolon space buffer.
|
||||
my @ebuf = split(' ', $buff);
|
||||
|
||||
if (!defined $ebuf[0]) {
|
||||
# Garbage. Ignoring.
|
||||
next;
|
||||
}
|
||||
|
||||
if (defined $ebuf[1]) {
|
||||
if ($ebuf[1] eq '{') {
|
||||
# This is the beginning of a block with no parameter.
|
||||
$blk = $ebuf[0];
|
||||
}
|
||||
elsif (defined $ebuf[2]) {
|
||||
if ($ebuf[2] eq '{') {
|
||||
# This is the beginning of a block with a parameter.
|
||||
my $param = $ebuf[1];
|
||||
$param =~ s/"//g;
|
||||
$blk = $ebuf[0].'@@@'.$param;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($ebuf[0] eq '}') {
|
||||
# This is the end of a block.
|
||||
$blk = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif (defined $ebuf[2]) {
|
||||
if ($ebuf[2] eq '{') {
|
||||
# This is the beginning of a block with a parameter.
|
||||
my $param = $ebuf[1];
|
||||
$param =~ s/"//g;
|
||||
$blk = $ebuf[0].'@@@'.$param;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($ebuf[0] eq '}') {
|
||||
# This is the end of a block.
|
||||
$blk = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Return the configuration data.
|
||||
return %rs;
|
||||
return %rs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+35
-35
@@ -14,10 +14,10 @@ sub parse
|
||||
|
||||
# Check that the language file exists.
|
||||
if (!-e "$Auto::bin{lng}/$lang.alf") {
|
||||
# Otherwise, use English.
|
||||
dbug "Language '$lang' not found. Using English.";
|
||||
alog "Language '$lang' not found. Using English.";
|
||||
$lang = 'en';
|
||||
# Otherwise, use English.
|
||||
dbug "Language '$lang' not found. Using English.";
|
||||
alog "Language '$lang' not found. Using English.";
|
||||
$lang = 'en';
|
||||
}
|
||||
|
||||
# Open, read and close the file.
|
||||
@@ -27,37 +27,37 @@ sub parse
|
||||
|
||||
# Iterate the file buffer.
|
||||
foreach my $buff (@fbuf) {
|
||||
if (defined $buff) {
|
||||
# Space buffer.
|
||||
my @sbuf = split(' ', $buff);
|
||||
|
||||
# Check for all required values.
|
||||
if (!defined $sbuf[0] or !defined $sbuf[1] or !defined $sbuf[2]) {
|
||||
# Missing a value.
|
||||
next;
|
||||
}
|
||||
|
||||
# Make sure the first value is "msge".
|
||||
if ($sbuf[0] ne "msge") {
|
||||
# It isn't.
|
||||
next;
|
||||
}
|
||||
|
||||
my $id = $sbuf[1];
|
||||
my $val = $sbuf[2];
|
||||
|
||||
# If the translation is multi-word, continue to parse.
|
||||
if (defined $sbuf[3]) {
|
||||
for (my $i = 3; $i < scalar(@sbuf); $i++) {
|
||||
$val .= " ".$sbuf[$i];
|
||||
}
|
||||
}
|
||||
|
||||
# Save to memory.
|
||||
$id =~ s/"//g;
|
||||
$val =~ s/"//g;
|
||||
$API::Std::LANGE{$id} = $val;
|
||||
}
|
||||
if (defined $buff) {
|
||||
# Space buffer.
|
||||
my @sbuf = split(' ', $buff);
|
||||
|
||||
# Check for all required values.
|
||||
if (!defined $sbuf[0] or !defined $sbuf[1] or !defined $sbuf[2]) {
|
||||
# Missing a value.
|
||||
next;
|
||||
}
|
||||
|
||||
# Make sure the first value is "msge".
|
||||
if ($sbuf[0] ne "msge") {
|
||||
# It isn't.
|
||||
next;
|
||||
}
|
||||
|
||||
my $id = $sbuf[1];
|
||||
my $val = $sbuf[2];
|
||||
|
||||
# If the translation is multi-word, continue to parse.
|
||||
if (defined $sbuf[3]) {
|
||||
for (my $i = 3; $i < scalar(@sbuf); $i++) {
|
||||
$val .= " ".$sbuf[$i];
|
||||
}
|
||||
}
|
||||
|
||||
# Save to memory.
|
||||
$id =~ s/"//g;
|
||||
$val =~ s/"//g;
|
||||
$API::Std::LANGE{$id} = $val;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
+21
-21
@@ -15,34 +15,34 @@ hook_add('on_namesreply', 'state.irc.names', sub {
|
||||
if (defined $chanusers{$svr}{$chan}) { delete $chanusers{$svr}{$chan} }
|
||||
# Iterate through each user.
|
||||
for (1..$#data) {
|
||||
my $fi = 0;
|
||||
my $fi = 0;
|
||||
PFITER: foreach my $spfx (keys %{ $Proto::IRC::csprefix{$svr} }) {
|
||||
# Check if the user has status in the channel.
|
||||
if (substr($data[$_], 0, 1) eq $Proto::IRC::csprefix{$svr}{$spfx}) {
|
||||
# He/she does. Lets set that.
|
||||
if (defined $chanusers{$svr}{$chan}{lc $data[$_]}) {
|
||||
# If the user has multiple statuses.
|
||||
$chanusers{$svr}{$chan}{lc substr $data[$_], 1} = $chanusers{$svr}{$chan}{lc $data[$_]}.$spfx;
|
||||
# Check if the user has status in the channel.
|
||||
if (substr($data[$_], 0, 1) eq $Proto::IRC::csprefix{$svr}{$spfx}) {
|
||||
# He/she does. Lets set that.
|
||||
if (defined $chanusers{$svr}{$chan}{lc $data[$_]}) {
|
||||
# If the user has multiple statuses.
|
||||
$chanusers{$svr}{$chan}{lc substr $data[$_], 1} = $chanusers{$svr}{$chan}{lc $data[$_]}.$spfx;
|
||||
delete $chanusers{$svr}{$chan}{lc $data[$_]};
|
||||
}
|
||||
else {
|
||||
# Or not.
|
||||
$chanusers{$svr}{$chan}{lc substr $data[$_], 1} = $spfx;
|
||||
}
|
||||
$fi = 1;
|
||||
}
|
||||
else {
|
||||
# Or not.
|
||||
$chanusers{$svr}{$chan}{lc substr $data[$_], 1} = $spfx;
|
||||
}
|
||||
$fi = 1;
|
||||
$data[$_] = substr $data[$_], 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
# Check if there's still a prefix.
|
||||
foreach my $spfx (keys %{$Proto::IRC::csprefix{$svr}}) {
|
||||
if (substr($data[$_], 0, 1) eq $Proto::IRC::csprefix{$svr}{$spfx}) { goto 'PFITER' }
|
||||
}
|
||||
# They had status, so go to the next user.
|
||||
next if $fi;
|
||||
# They didn't, set them as a normal user.
|
||||
if (!defined $chanusers{$svr}{$chan}{lc $data[$_]}) {
|
||||
$chanusers{$svr}{$chan}{lc $data[$_]} = 1;
|
||||
}
|
||||
# They had status, so go to the next user.
|
||||
next if $fi;
|
||||
# They didn't, set them as a normal user.
|
||||
if (!defined $chanusers{$svr}{$chan}{lc $data[$_]}) {
|
||||
$chanusers{$svr}{$chan}{lc $data[$_]} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
+4
-3
@@ -26,9 +26,10 @@ sub _void {
|
||||
}
|
||||
|
||||
|
||||
# Help hash for AUR. Spanish, French and German translations needed.
|
||||
# Help hash for AUR. Spanish and French translations needed.
|
||||
our %HELP_AUR = (
|
||||
'en' => "This command allows you to lookup a module in the Arch Linux AUR. \002Syntax:\002 AUR <module>",
|
||||
en => "This command allows you to lookup a module in the Arch Linux AUR. \2Syntax:\2 AUR <module>",
|
||||
de => "Dieser Befehl ermoeglicht du auf nachschlagst ein Modul in der Arch Linux AUR. \2Syntax:\2 AUR <module>",
|
||||
);
|
||||
|
||||
# Callback for AUR command.
|
||||
@@ -63,7 +64,7 @@ sub cmd_aur {
|
||||
}
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('AUR', 'Xelhua', '1.00', '3.0.0a8', __PACKAGE__);
|
||||
API::Std::mod_init('AUR', 'Xelhua', '1.00', '3.0.0a10');
|
||||
# build: cpan=WWW::AUR perl=5.010000
|
||||
|
||||
__END__
|
||||
|
||||
+4
-4
@@ -13,8 +13,8 @@ sub _init
|
||||
{
|
||||
# Check for required configuration values.
|
||||
if (!conf_get('badwords')) {
|
||||
err(2, 'Please verify that you have a badwords block with word entries defined in your configuration file.', 0);
|
||||
return;
|
||||
err(2, 'Please verify that you have a badwords block with word entries defined in your configuration file.', 0);
|
||||
return;
|
||||
}
|
||||
# Create the act_on_badword hook.
|
||||
hook_add('on_cprivmsg', 'act_on_badword', \&M::Badwords::actonbadword) or return;
|
||||
@@ -70,7 +70,7 @@ sub actonbadword
|
||||
}
|
||||
|
||||
|
||||
API::Std::mod_init('Badwords', 'Xelhua', '1.00', '3.0.0a7', __PACKAGE__);
|
||||
API::Std::mod_init('Badwords', 'Xelhua', '1.00', '3.0.0a10');
|
||||
# build: perl=5.010000
|
||||
|
||||
__END__
|
||||
@@ -121,7 +121,7 @@ Changing the obvious to your wish.
|
||||
|
||||
=over
|
||||
|
||||
This module is compatible with Auto version 3.0.0a7+.
|
||||
This module is compatible with Auto version 3.0.0a10+.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
+13
-11
@@ -14,8 +14,8 @@ sub _init
|
||||
{
|
||||
# Check for required configuration values.
|
||||
if (!(conf_get('bitly:user'))[0][0] or !(conf_get('bitly:key'))[0][0]) {
|
||||
err(2, 'Please verify that you have bitly_user and bitly_key defined in your configuration file.', 0);
|
||||
return;
|
||||
err(2, 'Please verify that you have bitly_user and bitly_key defined in your configuration file.', 0);
|
||||
return;
|
||||
}
|
||||
# Create the SHORTEN and REVERSE commands.
|
||||
cmd_add('SHORTEN', 0, 0, \%M::Bitly::HELP_SHORTEN, \&M::Bitly::shorten) or return;
|
||||
@@ -38,10 +38,12 @@ sub _void
|
||||
|
||||
# Help hashes.
|
||||
our %HELP_SHORTEN = (
|
||||
'en' => "This command will shorten an URL using Bit.ly. \002Syntax:\002 SHORTEN <url>",
|
||||
en => "This command will shorten an URL using Bit.ly. \2Syntax:\2 SHORTEN <url>",
|
||||
de => "Dieser Befehl wird eine URL verkuerzen. \2Syntax:\2 SHORTEN <url>",
|
||||
);
|
||||
our %HELP_REVERSE = (
|
||||
'en' => "This command will expand a Bit.ly URL. \002Syntax:\002 REVERSE <url>",
|
||||
en => "This command will expand a Bit.ly URL. \2Syntax:\2 REVERSE <url>",
|
||||
de => "Dieser Befehl wird eine URL erweitern. \2Syntax:\2 REVERSE <url>",
|
||||
);
|
||||
|
||||
# Callback for SHORTEN command.
|
||||
@@ -68,9 +70,9 @@ sub shorten
|
||||
if ($response->is_success) {
|
||||
# If successful, decode the content.
|
||||
my $d = $response->decoded_content;
|
||||
chomp $d;
|
||||
chomp $d;
|
||||
# And send to channel.
|
||||
privmsg($src->{svr}, $src->{chan}, "URL: ".$d);
|
||||
privmsg($src->{svr}, $src->{chan}, "URL: ".$d);
|
||||
}
|
||||
else {
|
||||
# Otherwise, send an error message.
|
||||
@@ -104,13 +106,13 @@ sub reverse
|
||||
if ($response->is_success) {
|
||||
# If successful, decode the content.
|
||||
my $d = $response->decoded_content;
|
||||
chomp $d;
|
||||
chomp $d;
|
||||
# And send it to channel.
|
||||
privmsg($src->{svr}, $src->{chan}, "URL: ".$d);
|
||||
}
|
||||
else {
|
||||
# Otherwise, send an error message.
|
||||
privmsg($src->{svr}, $src->{chan}, 'An error occurred while reversing your URL.');
|
||||
privmsg($src->{svr}, $src->{chan}, 'An error occurred while reversing your URL.');
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -118,7 +120,7 @@ sub reverse
|
||||
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('Bitly', 'Xelhua', '1.00', '3.0.0a7', __PACKAGE__);
|
||||
API::Std::mod_init('Bitly', 'Xelhua', '1.00', '3.0.0a10');
|
||||
# build: cpan=LWP::UserAgent,URI::Escape perl=5.010000
|
||||
|
||||
__END__
|
||||
@@ -167,7 +169,7 @@ Add Bitly to module auto-load and the following to your configuration file:
|
||||
|
||||
=over
|
||||
|
||||
* Add Spanish, French and German translations for the help hashes.
|
||||
* Add Spanish and German translations for the help hashes.
|
||||
|
||||
=back
|
||||
|
||||
@@ -178,7 +180,7 @@ Add Bitly to module auto-load and the following to your configuration file:
|
||||
This module adds extra dependencies: LWP::UserAgent and URI::Escape. You can
|
||||
get it from the CPAN <http://www.cpan.org>.
|
||||
|
||||
This module is compatible with Auto version 3.0.0a7+.
|
||||
This module is compatible with Auto version 3.0.0a10+.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
+3
-3
@@ -72,7 +72,7 @@ sub stats {
|
||||
}
|
||||
|
||||
|
||||
API::Std::mod_init('BotStats', 'Xelhua', '1.00', '3.0.0a7', __PACKAGE__);
|
||||
API::Std::mod_init('BotStats', 'Xelhua', '1.00', '3.0.0a10');
|
||||
# build: perl=5.010000
|
||||
|
||||
__END__
|
||||
@@ -89,7 +89,7 @@ BotStats - General information about the bot
|
||||
|
||||
<starcoder> !stats
|
||||
<blue> I have been running for 0 days, 0 hours, 1 minutes, and 5 seconds.
|
||||
<blue> I am running Auto IRC Bot (version 3.0.0a7) for Perl v5.12.3 on linux.
|
||||
<blue> I am running Auto IRC Bot (version 3.0.0a10) for Perl v5.12.3 on linux.
|
||||
<blue> I am on 2 channels, across 1 networks.
|
||||
|
||||
=head1 DESCRIPTION
|
||||
@@ -97,7 +97,7 @@ BotStats - General information about the bot
|
||||
This module creates the STATS command, for returning general information about
|
||||
the bot such as uptime, version, etc.
|
||||
|
||||
This module is compatible with Auto v3.0.0a7+.
|
||||
This module is compatible with Auto v3.0.0a10+.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
|
||||
+12
-11
@@ -32,7 +32,8 @@ sub _void
|
||||
|
||||
# Help hash.
|
||||
our %FHELP_CALC = (
|
||||
'en' => "This command will calculate an expression using Google Calculator. \002Syntax:\002 CALC <expression>",
|
||||
en => "This command will calculate an expression using Google Calculator. \2Syntax:\2 CALC <expression>",
|
||||
de => "Dieser Befehl berechnet einen Ausdruck mit den Google Rechner. \2Syntax:\2 CALC <expression>",
|
||||
);
|
||||
|
||||
# Callback for CALC command.
|
||||
@@ -58,27 +59,27 @@ sub calc
|
||||
|
||||
if ($response->is_success) {
|
||||
# If successful, decode the content.
|
||||
my $d = $json->allow_nonref->relaxed->escape_slash->loose->allow_singlequote->allow_barekey->decode($response->decoded_content);
|
||||
my $d = $json->allow_nonref->relaxed->escape_slash->loose->allow_singlequote->allow_barekey->decode($response->decoded_content);
|
||||
|
||||
if ($d->{error} eq "" or $d->{error} == 0) {
|
||||
if ($d->{error} eq "" or $d->{error} == 0) {
|
||||
# And send to channel
|
||||
privmsg($src->{svr}, $src->{chan}, "Result: ".$d->{lhs}." = ".$d->{rhs});
|
||||
}
|
||||
else {
|
||||
}
|
||||
else {
|
||||
# Otherwise, send an error message.
|
||||
privmsg($src->{svr}, $src->{chan}, "Google Calculator sent an error.");
|
||||
}
|
||||
privmsg($src->{svr}, $src->{chan}, "Google Calculator sent an error.");
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Otherwise, send an error message.
|
||||
privmsg($src->{svr}, $src->{chan}, "An error occurred while sending your expression to Google Calculator.");
|
||||
privmsg($src->{svr}, $src->{chan}, "An error occurred while sending your expression to Google Calculator.");
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('Calc', 'Xelhua', '1.00', '3.0.0a7', __PACKAGE__);
|
||||
API::Std::mod_init('Calc', 'Xelhua', '1.00', '3.0.0a10');
|
||||
# build: cpan=LWP::UserAgent,URI::Escape,JSON,JSON::PP perl=5.010000
|
||||
|
||||
__END__
|
||||
@@ -107,7 +108,7 @@ Google Calculator.
|
||||
|
||||
=over
|
||||
|
||||
* Add Spanish, French and German translations for the help hash.
|
||||
* Add Spanish and French translations for the help hash.
|
||||
|
||||
=back
|
||||
|
||||
@@ -118,7 +119,7 @@ Google Calculator.
|
||||
This module requires LWP::UserAgent, URI::Escape and JSON/JSON::PP.
|
||||
All are obtainable from the CPAN <http://www.cpan.org>.
|
||||
|
||||
This module is compatible with Auto version 3.0.0a7+.
|
||||
This module is compatible with Auto version 3.0.0a10+.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -282,7 +282,7 @@ sub _getdata
|
||||
}
|
||||
|
||||
|
||||
API::Std::mod_init('ChanTopics', 'Xelhua', '1.00', '3.0.0a7', __PACKAGE__);
|
||||
API::Std::mod_init('ChanTopics', 'Xelhua', '1.00', '3.0.0a10');
|
||||
# build: perl=5.010000
|
||||
|
||||
__END__
|
||||
@@ -337,7 +337,7 @@ This module adds no extra dependencies.
|
||||
|
||||
This module is not compatible with PostgreSQL, yet.
|
||||
|
||||
This module is compatible with Auto v3.0.0a7+.
|
||||
This module is compatible with Auto v3.0.0a10+.
|
||||
|
||||
Ported from v1.0.
|
||||
|
||||
|
||||
@@ -31,7 +31,8 @@ sub _void
|
||||
|
||||
# Help hash for DICT. Spanish, French and German translations needed.
|
||||
our %HELP_DICT = (
|
||||
'en' => "This command allows you to lookup a word through Dict.org. \002Syntax:\002 DICT <word>",
|
||||
en => "This command allows you to lookup a word through Dict.org. \2Syntax:\2 DICT <word>",
|
||||
de => "Dieser Befehl ermoeglicht du auf nachschlagst ein Wort durch Dict.org. \2Syntax:\2 DICT <word>",
|
||||
);
|
||||
|
||||
# Callback for DICT command.
|
||||
@@ -75,7 +76,7 @@ sub cmd_dict
|
||||
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('Dictionary', 'Xelhua', '1.00', '3.0.0a7', __PACKAGE__);
|
||||
API::Std::mod_init('Dictionary', 'Xelhua', '1.00', '3.0.0a10');
|
||||
# build: cpan=Net::Dict perl=5.010000
|
||||
|
||||
__END__
|
||||
@@ -98,7 +99,7 @@ DICT command.
|
||||
This module adds an extra dependency: Net::Dict. You can get it from the CPAN
|
||||
<http://www.cpan.org>.
|
||||
|
||||
This module is compatible with Auto v3.0.0a7+.
|
||||
This module is compatible with Auto v3.0.0a10+.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -45,10 +45,12 @@ sub _void {
|
||||
|
||||
# Help hashes.
|
||||
our %HELP_8BALL = (
|
||||
'en' => "This command will ask the magic 8-Ball your question. \002Syntax:\002 8BALL <question>",
|
||||
en => "This command will ask the magic 8-Ball your question. \2Syntax:\2 8BALL <question>",
|
||||
de => "Dieser Befehl fragt die magische 8-Kugel eine Frage. \2Syntax:\2 8BALL <question>",
|
||||
);
|
||||
our %HELP_RIGBALL = (
|
||||
'en' => "This command will \"rig\" (set) the answer of the next 8-Ball question. \002Syntax:\002 RIGBALL <answer>",
|
||||
en => "This command will \"rig\" (set) the answer of the next 8-Ball question. \2Syntax:\2 RIGBALL <answer>",
|
||||
de => "Dieser Befehl wird festgelegt die Antwort der naechsten 8-Kugel Frage. \2Syntax:\2 RIGBALL <answer>",
|
||||
);
|
||||
|
||||
# Callback for 8BALL command.
|
||||
@@ -98,7 +100,7 @@ sub rigball {
|
||||
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('EightBall', 'Xelhua', '2.00', '3.0.0a8', __PACKAGE__);
|
||||
API::Std::mod_init('EightBall', 'Xelhua', '2.00', '3.0.0a10');
|
||||
# build: perl=5.010000
|
||||
|
||||
__END__
|
||||
|
||||
+5
-4
@@ -26,9 +26,10 @@ sub _void {
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Help hash for EVAL command. Spanish, German and French translations are needed.
|
||||
# Help hash for EVAL command. Spanish and French translations are needed.
|
||||
our %HELP_EVAL = (
|
||||
'en' => "This command allows you to eval Perl code. USE WITH CAUTION. \2Syntax:\2 EVAL <expression>",
|
||||
en => "This command allows you to eval Perl code. USE WITH CAUTION. \2Syntax:\2 EVAL <expression>",
|
||||
de => "Dieser Befehl ermoeglicht du auf bewertst Perl Code. GEBRAUCH MIT VORSICHT. \2Syntax:\2 EVAL <expression>",
|
||||
);
|
||||
|
||||
# Callback for EVAL command.
|
||||
@@ -63,7 +64,7 @@ sub cmd_eval {
|
||||
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('Eval', 'Xelhua', '1.01', '3.0.0a7', __PACKAGE__);
|
||||
API::Std::mod_init('Eval', 'Xelhua', '1.01', '3.0.0a10');
|
||||
# build: perl=5.010000
|
||||
|
||||
__END__
|
||||
@@ -88,7 +89,7 @@ IRC, returning the output via notice.
|
||||
|
||||
This command requires the cmd.eval privilege.
|
||||
|
||||
This module is compatible with Auto v3.0.0a7+.
|
||||
This module is compatible with Auto v3.0.0a10+.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
|
||||
+7
-6
@@ -30,7 +30,8 @@ sub _void
|
||||
|
||||
# Help hash.
|
||||
our %HELP_FML = (
|
||||
'en' => "This command will return a random FML quote. \002Syntax:\002 FML",
|
||||
en => "This command will return a random FML quote. \2Syntax:\2 FML",
|
||||
de => "Dieser Befehl liefert eine zufaellige Zitat von FML. \2Syntax:\2 FML",
|
||||
);
|
||||
|
||||
# Callback for FML command.
|
||||
@@ -49,14 +50,14 @@ sub fml
|
||||
if ($rp->is_success) {
|
||||
# If successful, decode the content.
|
||||
my $d = $rp->decoded_content;
|
||||
$d =~ s/(\n|\r)//g;
|
||||
$d =~ s/(\n|\r)//g;
|
||||
|
||||
# Get the FML.
|
||||
my (undef, $dfa) = split('Text: ', $d);
|
||||
my ($fml, undef) = split('Agree:', $dfa);
|
||||
|
||||
# And send to channel.
|
||||
privmsg($src->{svr}, $src->{chan}, "\002Random FML:\002 ".$fml);
|
||||
privmsg($src->{svr}, $src->{chan}, "\002Random FML:\002 ".$fml);
|
||||
}
|
||||
else {
|
||||
# Otherwise, send an error message.
|
||||
@@ -67,7 +68,7 @@ sub fml
|
||||
}
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('FML', 'Xelhua', '1.00', '3.0.0a7', __PACKAGE__);
|
||||
API::Std::mod_init('FML', 'Xelhua', '1.00', '3.0.0a10');
|
||||
# build: cpan=LWP::UserAgent perl=5.010000
|
||||
|
||||
__END__
|
||||
@@ -98,7 +99,7 @@ have my hand back?" FML
|
||||
|
||||
=over
|
||||
|
||||
* Add Spanish, French and German translations for the help hash.
|
||||
* Add Spanish and French translations for the help hash.
|
||||
|
||||
=back
|
||||
|
||||
@@ -109,7 +110,7 @@ have my hand back?" FML
|
||||
This module adds an extra dependency: LWP::UserAgent. You can get it from
|
||||
the CPAN <http://www.cpan.org>.
|
||||
|
||||
This module is compatible with Auto version 3.0.0a7+.
|
||||
This module is compatible with Auto version 3.0.0a10+.
|
||||
|
||||
Ported from Auto 2.0.
|
||||
|
||||
|
||||
+6
-5
@@ -37,9 +37,10 @@ sub _void
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Help hash for GREET. Spanish, French and German translation needed.
|
||||
# Help hash for GREET. Spanish and French translation needed.
|
||||
our %HELP_GREET = (
|
||||
'en' => "This command allows management of greets. \002Syntax:\002 GREET (ADD|DEL) [nick] [greet]",
|
||||
en => "This command allows management of greets. \2Syntax:\2 GREET (ADD|DEL) [nick] [greet]",
|
||||
de => "Dieser Befehl ermoeglicht die Verwaltung von Gruesse. \2Syntax:\2 GREET (ADD|DEL) [nick] [greet]",
|
||||
);
|
||||
# Callback for GREET.
|
||||
sub cmd_greet
|
||||
@@ -125,7 +126,7 @@ sub hook_rcjoin
|
||||
}
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('Greet', 'Xelhua', '1.00', '3.0.0a7', __PACKAGE__);
|
||||
API::Std::mod_init('Greet', 'Xelhua', '1.00', '3.0.0a10');
|
||||
# build: perl=5.010000
|
||||
|
||||
__END__
|
||||
@@ -145,7 +146,7 @@ user that has a greet in the database joins a channel the bot is in.
|
||||
|
||||
=over
|
||||
|
||||
* Add Spanish, French and German translations for the help hash.
|
||||
* Add Spanish and French translations for the help hash.
|
||||
|
||||
=back
|
||||
|
||||
@@ -153,7 +154,7 @@ user that has a greet in the database joins a channel the bot is in.
|
||||
|
||||
=over
|
||||
|
||||
This module is compatible with Auto version 3.0.0a7+.
|
||||
This module is compatible with Auto version 3.0.0a10+.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ sub hello
|
||||
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('HelloChan', 'Xelhua', '1.00', '3.0.0a7', __PACKAGE__);
|
||||
API::Std::mod_init('HelloChan', 'Xelhua', '1.00', '3.0.0a10');
|
||||
# build: perl=5.010000
|
||||
|
||||
__END__
|
||||
|
||||
+9
-9
@@ -44,32 +44,32 @@ sub check
|
||||
$ua->timeout(2);
|
||||
# Do we have enough parameters?
|
||||
if (!defined $argv[0]) {
|
||||
notice($src->{svr}, $src->{nick}, trans('Not enough parameters').q{.});
|
||||
return;
|
||||
notice($src->{svr}, $src->{nick}, trans('Not enough parameters').q{.});
|
||||
return;
|
||||
}
|
||||
my $curl = $argv[0];
|
||||
# Does the URL start with http(s)?
|
||||
if ($curl !~ m/^http/) {
|
||||
$curl = 'http://'.$curl;
|
||||
$curl = 'http://'.$curl;
|
||||
}
|
||||
|
||||
# Get the response via HTTP.
|
||||
my $response = $ua->get($curl);
|
||||
|
||||
if ($response->is_success) {
|
||||
# If successful, it's up.
|
||||
privmsg($src->{svr}, $src->{chan}, $curl.' appears to be up from here.');
|
||||
# If successful, it's up.
|
||||
privmsg($src->{svr}, $src->{chan}, $curl.' appears to be up from here.');
|
||||
}
|
||||
else {
|
||||
# Otherwise, it's down.
|
||||
privmsg($src->{svr}, $src->{chan}, $curl.' appears to be down from here.');
|
||||
# Otherwise, it's down.
|
||||
privmsg($src->{svr}, $src->{chan}, $curl.' appears to be down from here.');
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('IsItUp', 'Xelhua', '1.00', '3.0.0a7', __PACKAGE__);
|
||||
API::Std::mod_init('IsItUp', 'Xelhua', '1.00', '3.0.0a10');
|
||||
# build: cpan=LWP::UserAgent perl=5.010000
|
||||
|
||||
__END__
|
||||
@@ -109,7 +109,7 @@ appears up or down to Auto.
|
||||
This module requires LWP::UserAgent. You can get it from
|
||||
the CPAN <http://www.cpan.org>.
|
||||
|
||||
This module is compatible with Auto version 3.0.0a7+.
|
||||
This module is compatible with Auto version 3.0.0a10+.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ sub cmd_lolcat {
|
||||
}
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('LOLCAT', 'Xelhua', '1.00', '3.0.0a8', __PACKAGE__);
|
||||
API::Std::mod_init('LOLCAT', 'Xelhua', '1.00', '3.0.0a10');
|
||||
# build: perl=5.010000 cpan=Acme::LOLCAT
|
||||
|
||||
__END__
|
||||
|
||||
@@ -69,7 +69,7 @@ sub gettitle
|
||||
}
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('LinkTitle', 'Xelhua', '1.01', '3.0.0a8', __PACKAGE__);
|
||||
API::Std::mod_init('LinkTitle', 'Xelhua', '1.01', '3.0.0a10');
|
||||
# build: cpan=LWP::UserAgent,HTML::Entities perl=5.010000
|
||||
|
||||
__END__
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ sub oper {
|
||||
}
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('Oper', 'Xelhua', '1.01', '3.0.0a7', __PACKAGE__);
|
||||
API::Std::mod_init('Oper', 'Xelhua', '1.01', '3.0.0a10');
|
||||
# build: perl=5.010000
|
||||
|
||||
__END__
|
||||
|
||||
+3
-3
@@ -113,7 +113,7 @@ sub cmd_qdb
|
||||
|
||||
# Send it back.
|
||||
privmsg($src->{svr}, $src->{chan}, "\002ID:\002 $data[0] - \002Submitted by\002 $data[1] \002on\002 ".POSIX::strftime('%F', localtime($data[2]))." \002at\002 ".POSIX::strftime('%I:%M %p', localtime($data[2])));
|
||||
privmsg($src->{svr}, $src->{chan}, $data[3]);
|
||||
privmsg($src->{svr}, $src->{chan}, '> '.$data[3]);
|
||||
}
|
||||
when ('SEARCH') {
|
||||
# QDB SEARCH.
|
||||
@@ -211,7 +211,7 @@ sub cmd_qdb
|
||||
}
|
||||
|
||||
|
||||
API::Std::mod_init('QDB', 'Xelhua', '1.03', '3.0.0a7', __PACKAGE__);
|
||||
API::Std::mod_init('QDB', 'Xelhua', '1.04', '3.0.0a10');
|
||||
# build: perl=5.010000
|
||||
|
||||
__END__
|
||||
@@ -222,7 +222,7 @@ QDB - Quote database module.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
1.03
|
||||
1.04
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
+2
-2
@@ -111,7 +111,7 @@ sub handle_906
|
||||
}
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('SASLAuth', 'Xelhua', '1.00', '3.0.0a7', __PACKAGE__);
|
||||
API::Std::mod_init('SASLAuth', 'Xelhua', '1.00', '3.0.0a10');
|
||||
# build: perl=5.010000
|
||||
|
||||
__END__
|
||||
@@ -168,7 +168,7 @@ block(s) you wish to use SASL with:
|
||||
This adds an extra dependency: You must build Auto with the
|
||||
--enable-sasl option.
|
||||
|
||||
This module is compatible with Auto v3.0.0a7+.
|
||||
This module is compatible with Auto v3.0.0a10+.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
+10
-4
@@ -23,7 +23,7 @@ sub _init {
|
||||
return;
|
||||
}
|
||||
$EDITION = (conf_get('uno:edition'))[0][0];
|
||||
$EDITION = uc(substr $EDITION, 0, 1).substr $EDITION, 1;
|
||||
$EDITION = ucfirst $EDITION;
|
||||
|
||||
# Check if the edition is valid.
|
||||
if ($EDITION !~ m/^(Original|Super|Advanced|Any)$/xsm) {
|
||||
@@ -653,6 +653,8 @@ sub cmd_uno {
|
||||
while ($durtime >= 3600) { $hours++; $durtime -= 3600 }
|
||||
while ($durtime >= 60) { $mins++; $durtime -= 60 }
|
||||
while ($durtime >= 1) { $secs++; $durtime -= 1 }
|
||||
if (length $mins < 2) { $mins = "0$mins" }
|
||||
if (length $secs < 2) { $secs = "0$secs" }
|
||||
$msg .= " The fastest game ever lasted \2$hours:$mins:$secs\2; the winner was \2$data->{fast}->{winner}\2.";
|
||||
}
|
||||
}
|
||||
@@ -664,6 +666,8 @@ sub cmd_uno {
|
||||
while ($durtime >= 3600) { $hours++; $durtime -= 3600 }
|
||||
while ($durtime >= 60) { $mins++; $durtime -= 60 }
|
||||
while ($durtime >= 1) { $secs++; $durtime -= 1 }
|
||||
if (length $mins < 2) { $mins = "0$mins" }
|
||||
if (length $secs < 2) { $secs = "0$secs" }
|
||||
$msg .= " The slowest game ever lasted \2$hours:$mins:$secs\2; the winner was \2$data->{slow}->{winner}\2.";
|
||||
}
|
||||
}
|
||||
@@ -1288,6 +1292,8 @@ sub _gameover {
|
||||
while ($durtime >= 3600) { $hours++; $durtime -= 3600 }
|
||||
while ($durtime >= 60) { $mins++; $durtime -= 60 }
|
||||
while ($durtime >= 1) { $secs++; $durtime -= 1 }
|
||||
if (length $mins < 2) { $mins = "0$mins" }
|
||||
if (length $secs < 2) { $secs = "0$secs" }
|
||||
privmsg($net, $chan, "Game lasted $hours:$mins:$secs; $UNOGCC cards were played.");
|
||||
|
||||
# Reset variables.
|
||||
@@ -1438,7 +1444,7 @@ sub sendmsg {
|
||||
}
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('UNO', 'Xelhua', '1.09', '3.0.0a8', __PACKAGE__);
|
||||
API::Std::mod_init('UNO', 'Xelhua', '1.10', '3.0.0a10');
|
||||
# build: perl=5.010000
|
||||
|
||||
__END__
|
||||
@@ -1449,7 +1455,7 @@ UNO - Three editions of the UNO card game
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
1.09
|
||||
1.10
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -1499,7 +1505,7 @@ The commands this adds are:
|
||||
|
||||
All of which describe themselves quite well with just the name.
|
||||
|
||||
This module is compatible with Auto v3.0.0a8+.
|
||||
This module is compatible with Auto v3.0.0a10+.
|
||||
|
||||
=head1 INSTALL
|
||||
|
||||
|
||||
+16
-16
@@ -45,8 +45,8 @@ sub weather
|
||||
$ua->timeout(2);
|
||||
# Put together the call to the Wunderground API.
|
||||
if (!defined $args[0]) {
|
||||
notice($src->{svr}, $src->{nick}, trans('Not enough parameters').".");
|
||||
return;
|
||||
notice($src->{svr}, $src->{nick}, trans('Not enough parameters').".");
|
||||
return;
|
||||
}
|
||||
my $loc = join(' ', @args);
|
||||
$loc =~ s/ /%20/g;
|
||||
@@ -56,29 +56,29 @@ sub weather
|
||||
|
||||
if ($response->is_success) {
|
||||
# If successful, decode the content.
|
||||
my $d = XMLin($response->decoded_content);
|
||||
my $d = XMLin($response->decoded_content);
|
||||
# And send to channel
|
||||
if (!ref($d->{observation_location}->{country})) {
|
||||
my $windc = $d->{wind_string};
|
||||
if (substr($windc, length($windc) - 1, 1) eq " ") { $windc = substr($windc, 0, length($windc) - 1) }
|
||||
privmsg($src->{svr}, $src->{chan}, "Results for \2".$d->{observation_location}->{full}."\2 - \2Temperature:\2 ".$d->{temperature_string}." \2Wind Conditions:\2 ".$windc." \2Conditions:\2 ".$d->{weather});
|
||||
privmsg($src->{svr}, $src->{chan}, "\2Heat index:\2 ".$d->{heat_index_string}." \2Humidity:\2 ".$d->{relative_humidity}." \2Pressure:\2 ".$d->{pressure_string}." - ".$d->{observation_time});
|
||||
}
|
||||
else {
|
||||
# Otherwise, send an error message.
|
||||
privmsg($src->{svr}, $src->{chan}, 'Location not found.');
|
||||
}
|
||||
if (!ref($d->{observation_location}->{country})) {
|
||||
my $windc = $d->{wind_string};
|
||||
if (substr($windc, length($windc) - 1, 1) eq " ") { $windc = substr($windc, 0, length($windc) - 1) }
|
||||
privmsg($src->{svr}, $src->{chan}, "Results for \2".$d->{observation_location}->{full}."\2 - \2Temperature:\2 ".$d->{temperature_string}." \2Wind Conditions:\2 ".$windc." \2Conditions:\2 ".$d->{weather});
|
||||
privmsg($src->{svr}, $src->{chan}, "\2Heat index:\2 ".$d->{heat_index_string}." \2Humidity:\2 ".$d->{relative_humidity}." \2Pressure:\2 ".$d->{pressure_string}." - ".$d->{observation_time});
|
||||
}
|
||||
else {
|
||||
# Otherwise, send an error message.
|
||||
privmsg($src->{svr}, $src->{chan}, 'Location not found.');
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Otherwise, send an error message.
|
||||
privmsg($src->{svr}, $src->{chan}, 'An error occurred while retrieving your weather.');
|
||||
privmsg($src->{svr}, $src->{chan}, 'An error occurred while retrieving your weather.');
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Start initialization.
|
||||
API::Std::mod_init('Weather', 'Xelhua', '1.00', '3.0.0a7', __PACKAGE__);
|
||||
API::Std::mod_init('Weather', 'Xelhua', '1.00', '3.0.0a10');
|
||||
# build: cpan=LWP::UserAgent,XML::Simple perl=5.010000
|
||||
|
||||
__END__
|
||||
@@ -120,7 +120,7 @@ From the NE at 9 MPH Gusting to 22 MPH Conditions: Overcast
|
||||
This module requires LWP::UserAgent and XML::Simple. Both are
|
||||
obtainable from CPAN <http://www.cpan.org>.
|
||||
|
||||
This module is compatible with Auto version 3.0.0a7+.
|
||||
This module is compatible with Auto version 3.0.0a10+.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user