Anyone out there familiar with Net::IRC and familiar know your away around IRC/MIRC? My question is, I want my bot to do a specific action when the bot is slapped (ie: /me slaps Wizard). I'm sure my regex is fine but I think the reason it's not reading in the action is because it's not being read as "on_public" text..
Everything else in the on_public is working, just not the actions.
sub on_public
{
my ($conn, $event) = @_;
my $nick = $event->{nick};
. . .
elsif ($text =~ m/slaps Wizard/i)
{
$conn->privmsg($conn->{channel}, "Hey, don't slap me!");
}
. . .
}
I tried looking on Google but it doesn't say anything about reading user actions. Any ideas?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.