Where should I save this? I mean, what should I name the file? And does this work in 1.9.3?kingkevz wrote:
Code: Select all
# ======================= # 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); if ($Settings::interface ne "Console") { message("The hideConsole plugin only works with the Console interface.\n"); return 1; } 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) { message("Auto-hiding console in $config{hideConsole} seconds...\n"); message("Hide the console? (Y/n) "); my $msg = $interface->getInput($config{hideConsole}); if ($msg =~ /y/i || $msg eq "") { message("Console hidden\n\n"); hideConsole(); } else { message("Cancelled auto-hide of console\n\n"); } } } sub cmdhideConsole { my (undef, $args) = @_; my ($cmd) = split(' ', $args->{input}, 2); if ($cmd eq "hideconsole") { message("Console hidden\n\n"); hideConsole(); $args->{return} = 1; } } sub hideConsole { eval 'use Win32::Console;Win32::Console->new(STD_OUTPUT_HANDLE)->Free();'; } return 1;
I'm a noob. Sorry.