Ok,thanks,i got.
But,i realized that,when the plugin have this line :
In console appears :
Code: Select all
[Oct 31 13:27:48 2011.48] Loading control\mon_control.txt...
[Oct 31 13:27:48 2011.49] Hook: Loading control\mon_control.txt...
[Oct 31 13:27:48 2011.53] Loading control\items_control.txt...
[Oct 31 13:27:48 2011.57] Hook: Loading control\items_control.txt...
[Oct 31 13:27:48 2011.66] Loading control\shop.txt...
[Oct 31 13:27:48 2011.71] Hook: Loading control\shop.txt...
But,when i delete him,appears :
Code: Select all
Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook
In a plugin,with that line deleted,I Have modified some lines or added some,and i got that the plugin has been activated when message : " Olá " appears in console,ok.
And the message who appears :
Code: Select all
Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Hook : Input: c Olá
Don't remember as,but appears Input .
Ok,i try this : Plugins:addHook('input'....)
But don't work
Er...
Then,when i use a plugin for activate when appears a message in console, need use
The plugin flood my Kore.
Have a way to the plugin has activated and after time,the plugin activate again ?
Thanks for help,sorry my Nooobisse
Other ask,which best hook :
Other,other,other :
Whats is this ? and what is influence of this in my plugin ?
I Don't understand this line.I search in google : return if and don't understand nothing.
I'am braziilian,you know how is very hard found some in a other language forum.But,english it's nice.
thanks for help,you is excellent .
My plugin :
Code: Select all
use strict;
use Plugins;
use Log qw( warning message error );
use Globals;
Plugins::register('Olá', 'Olá is hello in english', \&inUnload);
Plugins::addHook('in_game', \&onCommand, undef);
sub onCommand {
my $logHook = Log::addHook(
sub {
my (undef, $domain, undef, undef, $msg) = @_;
return if $domain eq 'test';
warning "Hook: $msg", 'test';
}
);
sub inUnload {
Log::delHook($logHook);
}
All appears on console openkore,the plugin duplicate,understand
And the plugin lines,to activate on determinated message :
Code: Select all
my (undef, $domain, undef, undef, $msg) = @_;
return if $domain eq 'test';
if ($msg =~/Olá/i)
{
warning "Hook: $msg", 'test';
}
}
);
But,i discover that's work too :
Code: Select all
use strict;
use Plugins;
use Log qw( warning message error );
use Globals;
Plugins::register('Olá', 'Olá is hello in english', \&inUnload);
my $logHook = Log::addHook(
sub {
my (undef, $domain, undef, undef, $msg) = @_;
if ($msg =~/Olá/i)
{
warning "Bem vindo\n";
}
}
)
;
sub inUnload {
Log::delHook($logHook);
}
Other ask,last,please,please :
Code: Select all
my (undef, $domain, undef, undef, $msg) = @_;
Why many " undef's " ?
I remove a undef and the plugin has not activated.
Example :
Code: Select all
my (undef, $msg) = @_;
if ($msg =~ /Olá/i)
{
warning "Olá is hello in portuguese";
}
doesn't work.
Why ?
Thanks ! Now i will stay quiet