WxHideInterface v1.0 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
iamanoob
Plain Yogurt
Plain Yogurt
Posts: 82
Joined: 04 Apr 2008, 09:49

WxHideInterface v1.0 plugin

#1 Post by iamanoob »

How to use:

To automatically hide the Wx at startup, add an option named autoHideWx 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 Wx into tray. 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 Wx manually, type wxtray

Notes:

1. This will simply hide the Wx and you will be ABLE to control the bot again by clicking it again from the tray (near the digital clock, nice workaround to hide/unhide your bot). For clarification, there will be AN icon in the system tray when you use this. You can also, control the bot using external means like Chat Commands, XKore 2, webMonitor Plugin, ditto plugin, etc.

2. After you hide the Wx in the tray, you can either turn off the bot by ending the process using Task Manager (really dangerous if you have to many wxstart.exe in your processes), or using an external bot control mechanism (see 1), or by clicking the icon in your desktop tray, Click Program->Quit or Ctrl-Q or type quit or unplug your pc or throw molotov at your pc.

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

4. You also need to modify your Wx.pm to enable the 'wxtray' command because Wx only has to be hotkeyed (Ctrl-Shift-T) or by clicking Programs -> Minimize to make it hide into tray.
http://forums.openkore.com/viewtopic.php?f=34&t=826

Code: Select all

# =======================
# WxHideInterface v1.0
# =======================
# by iamanoob trisha
# COPIED FROM hideConsole plugin v1.0 by hakore

package WxHideInterface;

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

if ($Settings::interface ne "Wx") {
        message("The WxHideInterface plugin only works with the Wx interface.\n");
        return 1;
}

Plugins::register('WxHideInterface', 'hide your Wx', \&onUnload);

my $hooks = Plugins::addHooks(
        ['initialized', \&autoHideWx, undef],
);


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

sub autoHideWx {
        if ($config{autoHideWx} > 0) {
                message("Auto-hiding Wx in $config{autoHideWx} seconds...\n");
                message("Hide Wx? (Y/n) ");

                my $msg = $interface->getInput($config{autoHideWx});
                if ($msg =~ /y/i || $msg eq "") {
                        message("Wx hidden\n\n");
                         hideWx();
                } else {
                        message("Cancelled Wx auto-hide\n\n");
                }
        }
}

sub hideWx { 
Commands::run('wxtray');
}

return 1;
you could also macro auto-hide if you had already modified your Wx.pm
http://forums.openkore.com/viewtopic.php?f=32&t=835
Image
DARKest Ninja