Monday, November 10, 2014

Plugin HideConsole

1. di config.txt tambahkan: HideConsole 1
2. jika mau melihat bot: matikan bot dari task manager, nyalakan lagi

# =======================
# hideConsole v1.0
# =======================
# by hakore (hakore@users.sourceforge.net)
# see documentation at: http://forums.openkore.com/viewtopic.php?p=103437


package hideConsole;
use Globals qw(%config $interface);
use Log qw(message error);


Plugins::register('hideConsole', 'hide your console', \&onUnload);
my $hooks = Plugins::addHooks(
['initialized', \&autoHideConsole, undef],
['Command_post', \&cmdhideConsole, undef]
);


sub onUnload {
Plugins::delHooks($hooks);
}


sub autoHideConsole {
if ($config{hideConsole} > 0) {
hideConsole();
}
}


sub cmdhideConsole {
my (undef, $args) = @_;
my ($cmd) = split(' ', $args->{input}, 2);
if ($cmd eq "hideconsole") {
message("Console hidden
");


hideConsole();
$args->{return} = 1;
}
}


sub hideConsole {
eval 'use Win32::Console;Win32::Console->new(STD_OUTPUT_HANDLE)->Free();';
}


return 1;

No comments:

Post a Comment