Fixing various typos and spelling mistakes spotted by timeless. There shouldn't be any code level changes here. moa=hixie

This commit is contained in:
ian%hixie.ch 2001-04-29 08:35:29 +00:00
Родитель 40bfcee8b0
Коммит 3db33a040e
9 изменённых файлов: 27 добавлений и 22 удалений

Просмотреть файл

@ -18,5 +18,5 @@ Reserved.
Contributor(s): Harrison Page <harrison@netscape.com> Contributor(s): Harrison Page <harrison@netscape.com>
Terry Weissman <terry@mozilla.org> Terry Weissman <terry@mozilla.org>
Risto Kotalampi <risto@kotalampi.com> Risto Kotalampi <risto@kotalampi.com>
Josh Soref <timeless@bemail.org> Josh Soref <timeless@mac.com>
Ian Hickson <py8ieh=mozbot@bath.ac.uk> Ian Hickson <mozbot@hixie.ch>

Просмотреть файл

@ -13,8 +13,9 @@ sub Help {
return { return {
'' => 'A module to get random fortune cookies.', '' => 'A module to get random fortune cookies.',
'fortune' => 'Same as \'cookie\', which see.', 'fortune' => 'Same as \'cookie\', which see.',
'cookie' => 'To get a fortune cookie, just tell me \'cookie\'. To set a new fortune cookie, see \'new\'. To find out how many cookies are left, use \'cookie status\'.', 'cookie' => 'To get a fortune cookie, just tell me \'cookie\'. To set a new fortune cookie, see \'new\' (or \'add\'). To find out how many cookies are left, use \'cookie status\'.',
'new' => 'To set a new fortune cookie, say \'new cookie\' followed by the text, e.g. \'new cookie: you will have a nice day\' or whatever. The string %from% will be replaced by the name of whoever requests the cookie.', 'new' => 'To set a new fortune cookie, say \'new cookie\' followed by the text, e.g. \'new cookie: you will have a nice day\' or whatever. The string %from% will be replaced by the name of whoever requests the cookie.',
'add' => 'To add a new fortune cookie, say \'add cookie\' followed by the text, e.g. \'add cookie: you will have a nice day\' or whatever. The string %from% will be replaced by the name of whoever requests the cookie.',
'fetch' => 'The command \'fetch cookies from <uri>\' will add each line in <uri> to the cookie list. Cookie lists must start with one line that reads \'FORTUNE COOKIE FILE\'. Blank lines and lines starting with a hash (\'#\') are ignored.', 'fetch' => 'The command \'fetch cookies from <uri>\' will add each line in <uri> to the cookie list. Cookie lists must start with one line that reads \'FORTUNE COOKIE FILE\'. Blank lines and lines starting with a hash (\'#\') are ignored.',
}; };
} }
@ -56,7 +57,7 @@ sub Told {
} else { } else {
$self->say($event, 'I\'m sorry, I\'ve run out of cookies! You\'ll have to wait for me to bake some more.'); $self->say($event, 'I\'m sorry, I\'ve run out of cookies! You\'ll have to wait for me to bake some more.');
} }
} elsif ($message =~ /^\s*new\s+(?:fortune\s+cookie|fortune|cookie)[-!:,;.\s]+(.....+?)\s*$/osi) { } elsif ($message =~ /^\s*(?:new|add)\s+(?:fortune\s+cookie|fortune|cookie)[-!:,;.\s]+(.....+?)\s*$/osi) {
push(@{$self->{'cookies'}}, $1); push(@{$self->{'cookies'}}, $1);
my $count = scalar(@{$self->{'cookies'}}); my $count = scalar(@{$self->{'cookies'}});
$self->say($event, "$event->{'from'}: Thanks! I have added that fortune cookie to my recipe book. I now have $count fortunes!"); $self->say($event, "$event->{'from'}: Thanks! I have added that fortune cookie to my recipe book. I now have $count fortunes!");

Просмотреть файл

@ -16,7 +16,7 @@ sub Help {
'opme' => 'Checks the autoop list, and ops the speaker if they are on the autoop list. Must be used in a channel. Syntax: \'op me\' or \'opme\'', 'opme' => 'Checks the autoop list, and ops the speaker if they are on the autoop list. Must be used in a channel. Syntax: \'op me\' or \'opme\'',
'mask' => 'Add or remove a regexp mask from a channel\'s autoop list. Only bot and channel admins can do this. USE OF THIS FEATURE IS HIGHLY DISCOURAGED AS IT IS VERY INSECURE!!! Syntax: \'add mask <user@host> in <channel>\' to add and \'remove mask <user@host> in <channel>\' to remove. The special word \'everywhere\' can be used instead of a channel name to add a mask that works in all channels.', 'mask' => 'Add or remove a regexp mask from a channel\'s autoop list. Only bot and channel admins can do this. USE OF THIS FEATURE IS HIGHLY DISCOURAGED AS IT IS VERY INSECURE!!! Syntax: \'add mask <user@host> in <channel>\' to add and \'remove mask <user@host> in <channel>\' to remove. The special word \'everywhere\' can be used instead of a channel name to add a mask that works in all channels.',
'autoop' => 'Add someone to the autoop list for a channel. Only bot and channel admins can do this. Syntax: \'op <user> in <channel>\'', 'autoop' => 'Add someone to the autoop list for a channel. Only bot and channel admins can do this. Syntax: \'op <user> in <channel>\'',
'deautoop' => 'Remove someone from the autoop list for a channel. Only bot and channel admins can do this. Syntax: \'deop <user> in <channel>\'', 'deautoop' => 'Remove someone from the autoop list for a channel. Only bot and channel admins can do this. Syntax: \'deautoop <user> in <channel>\'',
'enable' => 'Enable a module in a channel. Only bot and channel admins can do this. Syntax: \'enable <module> in <channel>\'', 'enable' => 'Enable a module in a channel. Only bot and channel admins can do this. Syntax: \'enable <module> in <channel>\'',
'disable' => 'Disable a module in a channel. Only bot and channel admins can do this. Syntax: \'disable <module> in <channel>\'', 'disable' => 'Disable a module in a channel. Only bot and channel admins can do this. Syntax: \'disable <module> in <channel>\'',
}; };

Просмотреть файл

@ -17,7 +17,7 @@ sub Help {
return { return {
'' => 'A polite module for saying hello and goodbye and so on.', '' => 'A polite module for saying hello and goodbye and so on.',
'hi' => 'To greet the bot.', 'hi' => 'To greet the bot.',
'bye' => 'To say good bye to the bot.', 'bye' => 'To say goodbye to the bot.',
'ping' => 'To check the bot is alive.', 'ping' => 'To check the bot is alive.',
'uptime' => 'Gives the amount of time that the bot has been active.', 'uptime' => 'Gives the amount of time that the bot has been active.',
}; };

Просмотреть файл

@ -45,7 +45,7 @@ sub Told {
} }
$self->directSay($event, 'End of wishes.'); $self->directSay($event, 'End of wishes.');
} else { } else {
$self->directSay($event, 'Noone has wished for anything!'); $self->directSay($event, 'No-one has wished for anything!');
} }
$self->channelSay($event, "$event->{'from'}: wishlist /msg'ed"); $self->channelSay($event, "$event->{'from'}: wishlist /msg'ed");
} else { } else {

Просмотреть файл

@ -197,7 +197,7 @@ set to 1. This won't be a problem if your module only returns 1
*** PartedChannel($event, $channel) *** PartedChannel($event, $channel)
Called after the bot has left a channel, for example if the bot has Called after the bot has left a channel, for example if the bot has
been /hicked. been /kicked.
No special return values. Always call inherited the function, as this No special return values. Always call inherited the function, as this
is where the autopart function is implemented. is where the autopart function is implemented.
@ -543,7 +543,7 @@ recommended.
Example: Example:
$self->registerVariables( $self->registerVariables(
[ 'ftpDelay', 1, 1, 60 ], [ 'ftpDelay', 1, 1, 60 ],
[ 'ftpsite', 1, 1, 'ftp.mozilla.org' ], [ 'ftpSite', 1, 1, 'ftp.mozilla.org' ],
); );
@ -700,7 +700,7 @@ recommended.
Set the bot's 'away' flag. A blank message will mark the bot as Set the bot's 'away' flag. A blank message will mark the bot as
back. Note: If you need this you are doing something wrong!!! back. Note: If you need this you are doing something wrong!!!
Remember that you should not be doing any lengthy processes since if Remember that you should not be doing any lengthy processes since if
you are away for any length of time, the bot will be kicked! you are away for any length of time, the bot will be disconnected!
Also note that in 2.0 this is not throttled, so DO NOT call this Also note that in 2.0 this is not throttled, so DO NOT call this
repeatedly, or put yourself in any position where you allow IRC repeatedly, or put yourself in any position where you allow IRC

Просмотреть файл

@ -74,7 +74,11 @@ See the "Administration" section for instructions on how to change the
administration password (important!). administration password (important!).
Note: Passwords are printed in clear text on the console and in the Note: Passwords are printed in clear text on the console and in the
log files. Secure them accordingly. log files. Secure them accordingly. Of course, IRC is an inherently
insecure protocol anyway, and any machine between your IRC client's
and your bot's, going through the IRC network's servers, will have
access to the passwords. For this reason, change them often, and don't
use passwords that you use for important things here.
The default setting is for mozbot to run with taint checking The default setting is for mozbot to run with taint checking
enabled. I *STRONGLY* recommend not changing this. enabled. I *STRONGLY* recommend not changing this.
@ -189,7 +193,6 @@ Now authenticate yourself again, as the new user:
The moment you authenticate as the new admin, the default admin The moment you authenticate as the new admin, the default admin
account is deleted. account is deleted.
You are now in a position to add the modules you want and to put the You are now in a position to add the modules you want and to put the
bot in the channels you want it in. bot in the channels you want it in.
@ -214,7 +217,7 @@ the following message:
/msg mozbot shutup please /msg mozbot shutup please
It should respond within a few seconds. You can authenticate while it It should respond within a few seconds. You can authenticate while it
is speaking, that is no problem. is speaking, that's not a problem.
VARIABLES VARIABLES

Просмотреть файл

@ -19,7 +19,7 @@
# #
# Contributor(s): Harrison Page <harrison@netscape.com> # Contributor(s): Harrison Page <harrison@netscape.com>
# Terry Weissman <terry@mozilla.org> # Terry Weissman <terry@mozilla.org>
# Ian Hickson <py8ieh=mozbot@bath.ac.uk> # Ian Hickson <mozbot@hixie.ch>
package Mails; package Mails;
use strict; use strict;

Просмотреть файл

@ -130,11 +130,11 @@ $|++;
# internal 'constants' # internal 'constants'
my $NAME = 'mozbot'; my $NAME = 'mozbot';
my $VERSION = q$Revision: 2.0 $; my $VERSION = q$Revision: 2.1 $;
my $USERNAME = "pid-$$"; my $USERNAME = "pid-$$";
my $LOGFILEPREFIX; my $LOGFILEPREFIX;
# adjust the version constants # adjust the version constant
$VERSION =~ /([0-9.]+)/; $VERSION =~ /([0-9.]+)/;
$VERSION = $1; $VERSION = $1;
@ -1448,7 +1448,7 @@ sub getModule {
} }
# tellAdmin - may try to talk to an admin. # tellAdmin - may try to talk to an admin.
# NO GUARENTEES! This will PROBABLY NOT reach anyone! # NO GUARANTEES! This will PROBABLY NOT reach anyone!
sub tellAdmin { sub tellAdmin {
my $self = shift; my $self = shift;
my ($event, $data) = @_; my ($event, $data) = @_;
@ -1965,7 +1965,7 @@ sub Set {
} elsif (ref($self->{$variable}) eq 'HASH') { } elsif (ref($self->{$variable}) eq 'HASH') {
if ($value =~ /^\+(.)(.*)\1(.*)$/so) { if ($value =~ /^\+(.)(.*)\1(.*)$/so) {
$self->{$variable}->{$2} = $3; $self->{$variable}->{$2} = $3;
return -2 if $1 =~ /[a-zA-Z]/os; return -2 if $1 =~ /[a-zA-Z]/so;
} elsif ($value =~ /^\-(.*)$/so) { } elsif ($value =~ /^\-(.*)$/so) {
# XXX no feedback if nothing is done # XXX no feedback if nothing is done
delete($self->{$variable}->{$1}); delete($self->{$variable}->{$1});
@ -2101,8 +2101,8 @@ sub Help {
'restart' => 'Shuts the bot down completely then restarts it, so that any source changes take effect.', 'restart' => 'Shuts the bot down completely then restarts it, so that any source changes take effect.',
'cycle' => 'Makes the bot disconnect from the server then try to reconnect.', 'cycle' => 'Makes the bot disconnect from the server then try to reconnect.',
'vars' => 'Manage variables: vars [<module> [<variable> [\'<value>\']]], say \'vars\' for more details.', 'vars' => 'Manage variables: vars [<module> [<variable> [\'<value>\']]], say \'vars\' for more details.',
'join' => 'Makes the bot attempt to join a channel. You can also use /invite. Syntax: join <channel>', 'join' => 'Makes the bot attempt to join a channel. The same effect can be achieved using /invite. Syntax: join <channel>',
'part' => 'Makes the leave a channel. The same affect can be achieved using /kick. Syntax: part <channel>', 'part' => 'Makes the bot leave a channel. The same effect can be achieved using /kick. Syntax: part <channel>',
'load' => 'Loads a module from disk, if it is not already loaded: load <module>', 'load' => 'Loads a module from disk, if it is not already loaded: load <module>',
'unload' => 'Unloads a module from memory: load <module>', 'unload' => 'Unloads a module from memory: load <module>',
'reload' => 'Unloads and then loads a module: reload <module>', 'reload' => 'Unloads and then loads a module: reload <module>',
@ -2370,7 +2370,7 @@ sub Invited {
# on the server should the bot join first. # on the server should the bot join first.
my $channel = lc($channelName); my $channel = lc($channelName);
if (grep($_ eq $channel, @channels)) { if (grep($_ eq $channel, @channels)) {
$self->directSay($event, "I think already *in* channel $channel! If this is not the case please make me part and then rejoin."); $self->directSay($event, "I think I'm already *in* channel $channel! If this is not the case please make me part and then rejoin.");
} else { } else {
if ($self->isAdmin($event) || $self->{'allowInviting'}) { if ($self->isAdmin($event) || $self->{'allowInviting'}) {
$self->debug("Joining $channel, since I was invited."); $self->debug("Joining $channel, since I was invited.");
@ -2561,7 +2561,7 @@ sub Told {
} else { } else {
$self->directSay($event, "Help topics for $NAME $VERSION ($helpline):"); $self->directSay($event, "Help topics for $NAME $VERSION ($helpline):");
$self->say($event, "$event->{'from'}: help info /msg'ed") if ($event->{'channel'}); $self->say($event, "$event->{'from'}: help info /msg'ed") if ($event->{'channel'});
local @" = ', '; local @" = ', '; # to reset font-lock: "
my @helplist; my @helplist;
foreach my $module (@modules) { foreach my $module (@modules) {
my %commands = %{$module->Help($event)}; my %commands = %{$module->Help($event)};
@ -2653,6 +2653,7 @@ sub SpottedQuit {
my $self = shift; my $self = shift;
my ($event, $who, $why) = @_; my ($event, $who, $why) = @_;
delete($authenticatedUsers{$event->{'user'}}); delete($authenticatedUsers{$event->{'user'}});
# XXX this doesn't deal with a user who has authenticated twice.
return $self->SUPER::SpottedQuit(@_); return $self->SUPER::SpottedQuit(@_);
} }