Parse Numeric:005 and store PREFIX's data.
This commit is contained in:
1 parent
1ca0c9a078
commit
53422a7545
2 files changed
+27
-1
No files matched your search
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
|
||||
|
||||
3.0 Indev
|
||||
==================================================================
|
||||
* Parse Numeric:005 and store PREFIX's data.
|
||||
* Bug fix: The bot's nick is now stored correctly.
|
||||
* Added server:modes config option for setting modes on
|
||||
connect.
|
||||
|
||||
+26
-1
@@ -12,6 +12,7 @@ use API::IRC;
|
||||
# Raw parsing hash.
|
||||
our %RAWC = (
|
||||
'001' => \&num001,
|
||||
'005' => \&num005,
|
||||
'432' => \&num432,
|
||||
'433' => \&num433,
|
||||
'438' => \&num438,
|
||||
@@ -26,7 +27,7 @@ our %RAWC = (
|
||||
);
|
||||
|
||||
# Variables for various functions.
|
||||
our (%got_001, %botnick, %botchans);
|
||||
our (%got_001, %botnick, %botchans, %csprefix);
|
||||
|
||||
# Events.
|
||||
API::Std::event_add("on_rcjoin");
|
||||
@@ -108,6 +109,30 @@ sub num001
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Parse: Numeric:005
|
||||
# Prefixes.
|
||||
sub num005
|
||||
{
|
||||
my ($svr, @ex) = @_;
|
||||
|
||||
# Find PREFIX.
|
||||
foreach my $ex (@ex) {
|
||||
if (substr($ex, 0, 7) eq "PREFIX=") {
|
||||
# Found.
|
||||
my $rpx = substr($ex, 8);
|
||||
my ($pm, $pp) = split('\)', $rpx);
|
||||
my @apm = split(//, $pm);
|
||||
my @app = split(//, $pp);
|
||||
foreach my $ppm (@apm) {
|
||||
# Store data.
|
||||
$csprefix{$svr}{$ppm} = shift(@app);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Parse: Numeric:432
|
||||
# Erroneous nickname.
|
||||
sub num432
|
||||
|
||||
Reference in new issue
Block a user