im making a plugin that get peoples serial hashes from renlog
sub serial
{
my ( $session, $heap, $args ) = @_[ SESSION, HEAP, ARG0 ];
my $kernel = $_[KERNEL];
my $line = $args->{line};
my $name;
my $serial;
my $ip;
my $port;
my $verification;
if ($line =~ m/^Serial\shash\sresponse\sfrom\s(.+)\s\-\>\s(.+)\./)
{
$name = $1;
$serial = $2;
}
if ($line =~ m/^\[JOIN\]\s(.+)\s(.+)\s(.+)/)
{
$name = $1;
$ip = $2;
$serial = $3;
}
if ($line =~ m/^\[Serial\]\s(.+)\s(.+)/)
{
$name = $1;
$serial = $2;
}
if ( $line =~ /\(Game\)\s(.+)/ )
{
my $text = $1;
if ($text =~ m/Serial\sof\sclient\s\'(.+)\'\sis\s(.+)\./)
{
$name = $1;
$serial = $2;
brIRC::ircmsg ( "in serial 1 $name $serial", "A" );
}
if ($text =~ m/Client\s\'(.+)\'\s\((.+)\:(.+)\)\sconnected\./)
{
$name = $1;
$ip = $2;
$port = $3;
}
}
if ($line =~ m/(\d+)\s\|\s(.+)\s\|\s(.+)\s\|\s(.+)/)
{
$id = $1;
$name = $2;
$serial = $3;
$verification = $4;
brIRC::ircmsg ( "09[Serial] $name Verification $verification with serial $serial", "A" );
}
brIRC::ircmsg ( "serial $name $serial", "A" );
serialupdate( $name, $serial );
}
What is the appropriate way to use the renlog hook in the .xml file. What i have currently works but is their an easy way when using the hook.
<renlog_regex_hooks>
<hook event="serial" regex="^\[Serial\]|^\[Join\]|^Serial\shash\s|^\(Game\)\s(.+)\sSerial|^\(Game\)\s(.+)\sClient|^\(Game\)\s(.+)\sClient|^(\d+)\s\|\s(.+)\s\|\s(.+)\s\|\s(.+)" />
</renlog_regex_hooks>
[Updated on: Thu, 02 December 2010 12:52]
Report message to a moderator