Hide Console plugin

Other plugins for extending OpenKore's functionality. This forum is only for posting new plugins and commenting on existing plugins. For support, use the Support forum.

Moderator: Moderators

Message
Author
kingkevz
Human
Human
Posts: 25
Joined: 04 Apr 2008, 22:55

Hide Console plugin

#1 Post by kingkevz »

How to use

To automatically hide the Console at startup, add an option named hideConsole in your config.txt. If this option is set to a positive number, this specifies the time in seconds Kore will wait before automatically hiding the console. Set this to 0 to disable auto-hide. If you press any key other than "y" when you are prompted during auto-hide, Kore will cancel auto-hide.

To hide the console manually, type hideconsole

Notes

1. This will simply hide the console and you will not be able to control the bot using console commands while it's running in the background (lame workaround to hide your bot). For clarification, there will be no icon in the system tray when you use this. You can however, control the bot using external means like Chat Commands, XKore 2, webMonitor Plugin, etc.

2. After you hide the console, you can only turn off the bot by ending the process using Task Manager (dangerous), or using an external bot control mechanism (see 1).

3. It only works if you are using the 'Console' interface.



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;

BotMyHobby
Noob
Noob
Posts: 3
Joined: 06 Apr 2008, 04:44

Re: Hide Console plugin

#2 Post by BotMyHobby »

3. It only works if you are using the 'Console' interface.<

Wat Mean By 'Console' interface

h4rry84
Moderators
Moderators
Posts: 234
Joined: 04 Apr 2008, 09:30
Noob?: Yes
Location: My House
Contact:

Re: Hide Console plugin

#3 Post by h4rry84 »

it's when you use start.exe and not wxstart.exe , understood ?

BotMyHobby
Noob
Noob
Posts: 3
Joined: 06 Apr 2008, 04:44

Re: Hide Console plugin

#4 Post by BotMyHobby »

Not Understand! me Using Open Kore 2.0.5.1, inside only got start.exe!

alpha
Noob
Noob
Posts: 12
Joined: 08 Apr 2008, 10:00
Noob?: No

Re: Hide Console plugin

#5 Post by alpha »

well then it should work perfectly fine for you..
here is a small tweak to this if u dont wanna be asked whether to hide or not
look for

Code: Select all

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");
                }
        }
}
and make it

Code: Select all

sub autoHideConsole {
        if ($config{hideConsole} > 0) 
                hideConsole();
               }
this way if u have hide console 1 in ur config.txt it will automatically hide :)

BotMyHobby
Noob
Noob
Posts: 3
Joined: 06 Apr 2008, 04:44

Re: Hide Console plugin

#6 Post by BotMyHobby »

the 'Console' interface.
the original download of 2.0.5.1 not console interface!!!
how solve the problem! to make it can use hideconsole

-Fallen-
Human
Human
Posts: 41
Joined: 04 Apr 2008, 19:30
Noob?: Yes
Location: Local Lingerie Shop

Re: Hide Console plugin

#7 Post by -Fallen- »

does this actually reduce computer memory usage (aka less lag even with multiple xkore0 opened?)
Be an Underwear Thief. And be proud about it.

Read the Manual, its FREE!
http://www.openkore.com/wiki/index.php/Manual

alpha
Noob
Noob
Posts: 12
Joined: 08 Apr 2008, 10:00
Noob?: No

Re: Hide Console plugin

#8 Post by alpha »

err if anything this increase the memory usage.. since its a plugin.. atleast thats what i have noticed...

adani_jmc
Noob
Noob
Posts: 2
Joined: 28 Apr 2008, 06:00

Re: Hide Console plugin

#9 Post by adani_jmc »

hmm ...
i'm currently use win32 not wx interface with 2.0.5.1 kore
but it not working

my bot "sound" likes
BotMyHobby
Console' interface
but when i use 2.0.3 kore it worked

hmm
what is the matter

*i have include

Code: Select all

hideConsole 10
in config.txt (10 is my timeout)

heerojsn
Noob
Noob
Posts: 4
Joined: 19 Apr 2008, 01:22

Re: Hide Console plugin

#10 Post by heerojsn »

how can i make this bot to automatically hide in the taskbar upon starting
this is the bot i have, version 2. 0. 6.
Image

Post Reply