HotKeyNet Boxing Guide

From Dual-Boxing Wiki

Jump to: navigation, search

This is a guide for using HotKeyNet for multiboxing.

It can also be found on the software-forum at: Guide: HowTo use HotKeyNet for boxing

Contents

Basic Concept

HotKeyNet (HKN) is a currently free program for sending HotKeys to different windows (on one ore more than one pc) developed by Freddy. The download, sample scripts and command reference can be found on: www.hotkeynet.com .


All actions of HKN are defined in a simple textfile, called the hkn-file or script, which can be edited with a simple texteditor.


if you now say: "Yeah great i don't want to read the concepts and explanations, give me a simple script!"

-no problem: if you want to get the files first, here are sample scripts !


Ah, you stayed :), so back to the concept:

The basic conecept of HotKeyNet is that it is a program what simply waits on a key-trigger to run an action, like for example pressing 'ctrl+o' to run winamp. So in general HKN can be used for a lot of other things than multiboxing.

Defining an Hotkey / Broadcasting keys

General

The command to define a Hotkey is: <Hotkey ..>

A simple example to broadcast '1' to a window named 'wow1' on the local computer would look like:

<hotkey 1>
   <sendpc local>
      	<sendwin wow1>
      	     <key 1>

So basicaly in the <hotkey ..>-command the trigger is defiend (line 1), here '1', and in the following (line 2-4) an action to execute.

As a trigger simple keys like '1','a','F11' can be used or combinations of modifiers and a key. As a modifier the normal modifiers 'shift','ctrl','alt' can be used or with the <UseKeyAsModifier>-command any other key can be used. For the hole definition of <HotKey> see: HKN: HotKey . For how to figure out keynames see: HKN: Keynames .

Broadcasting Keys to WoW windows

For broadcasting a hole bunch of keys to different WoW windows the following example (here for 5 boxing on one pc) can be used:

//-----------------------------------------------------------
// DEFINE MAIL LABELS FOR SENDING KEY STROKES.
//-----------------------------------------------------------
<Label w1 Local SendWinM WoW1>
<Label w2 Local SendWinM WoW2>
<Label w3 Local SendWinM WoW3>
<Label w4 Local SendWinM WoW4>
<Label w5 Local SendWinM WoW5>

//-----------------------------------------------------------
// DEFINE HOTKEYS FOR ALL KEY COMBINATIONS THAT WILL GET
// SENT TO ALL WOWS. ADD MORE KEY COMBO'S IF YOU WANT.
//-----------------------------------------------------------
<KeyList MyList A-Z, 0-9, Enter, Tab, Oem4, Space, Comma, Oem6 except W, A, S, D, Q, E, L>

<Hotkey MyList; Shift MyList; Alt MyList; Ctrl MyList>
    <SendLabel w1, w2, w3, w4, w5>
   	<Key %Trigger%>

this does the following:

1. Defining five <Label..>-commands, one for each WoW-window.
A <Label ..> -command can be used to summerize for a setup to which window, running on which pc, with what method keys (or other actions) are send.
So <Label w1 Local SendWinM WoW1> defines that when sending a key to the label 'w1' with <SendLabel..> its meant: Sending a key to the window named 'WoW1', which is runing on the local pc using the method SendWinM.


2. Defining a KeyList
This also is a shorter form of defining multiple hotkeys. And basicly means, that all the trigger-keys can be defined in a KeyList and the name of the KeyList can be used in the <HotKey>-definition instead of the triggers. For the syntax see this .


3. Defining the Hotkey
With <Hotkey MyList; Shift MyList; Alt MyList; Ctrl MyList> the triggers for the action defined in the next 2 lines are defined, using the KeyList defined before. The action to execute is composed of 2 things:
a) <SendLabel w1, w2, w3, w4, w5>, tells HKN to which Labels to send (and thereby to wich Window, on which PC with which Method)
b) <Key %Trigger%>, tells HKN what to send. Here the same key as the key which triggerd the action. For reference see: this .

Movement Keys

Some keys which need to be handled differently are keys that should be used for moving, turning etc. in wow, as for them ist not a simple <KeyDown><KeyUp>. This keys can be defined like any other <HotKey> with <MovementHotkey> . So example code for using the cursor-keys as movement-keys and broadcasting them to all windows, would look like:

<MovementHotkey up, down, left, right>
    <SendLabel w1, w2, w3, w4, w5>
        <Key %Trigger%>                           

Toggeling HKN off/on

Sometimes its quite usefull to simply turn of all hotkey-definitions (for example for chatting) this can be easily be done with defining a Trigger-Key for toggeling HKN on/off like:

<hotkey pause>
    <sendpc local>
	<ToggleHotkeys>

In the following I will describe the script-definitions and commands necessary to use hkn for multiboxing.

Starting WoWs / Renaming Windows

As HotKeyNet is not restricted on only sending keys, when a hotkey is triggered, but perfom a lot of other actions, it can be used for starting wow itself and renaming the windows.

This can be done like this:

//-----------------------------------------------------------
// SUBROUTINE TO LAUNCH AND RENAME A COPY OF WOW.
//-----------------------------------------------------------
<Command LaunchAndRename>
  <SendPC %1%>
     <Run %2%>
     <RenameTargetWin %3%>
     <RemoveWinFrame>
     <SetAffinity %4%>

//-----------------------------------------------------------
// HOTKEY TO LAUNCH AND RENAME YOUR WOW WINDOWS while 5 boxing
// Please configure the Path and processor afinitys correctly
//-----------------------------------------------------------
<Hotkey Alt Ctrl L>
    <LaunchAndRename Local "C:\temp\multi\w1\wow.exe" WoW1 1>
    <LaunchAndRename Local "C:\temp\multi\w2\wow.exe" WoW2 2>
    <LaunchAndRename Local "C:\temp\multi\w3\wow.exe" WoW3 2>
    <LaunchAndRename Local "C:\temp\multi\w4\wow.exe" WoW4 3>
    <LaunchAndRename Local "C:\temp\multi\w5\wow.exe" WoW5 3>
    <ResizeAndPosition WoW1 WoW2 WoW3 WoW4 WoW5>

This first defines an command (for how to define a command see: this ) named LaunchAndRename, which starts WoW, which has the following parameters:

<LaunchAndRename %1% %2% %3% %4%>

%1%: The pc to to run the WoW from (see <SendPC> )

%2%: path and program to run (This must be customized!) (see <Run> )

%3%: name to rename the window to (see RenameTargetWin )

%4%: Affinity, which processor to use in a dual/quad-core environment (see <SetAffinity> )

Second a <Hotkey> is defined (trigger: ctrl + alt+ l) which uses the command to start 5 wow. And initiates the repositioning and resizing of them with <ResizeAndPositio>. (This is covered in the next paragraph).

Resizing / Positioning of WoW-windows

In the steps before you have learned how to setup keybroadcasting and starting the WoWs. Know we want to position and resize the windows.

This can be done with three commands:

  • <SendWin> / <SendWinM> : To specify which window to resize/position
  • <SetWinPos x y> : changes the position of a targeted window (x horizontal position, y vertical position)
  • <SetWinSize x y> : resizes the window to a size (x horizontal size, y vertical size)

So to position the window named 'WoW1' at x=200, y=300 with the resolution of 640x480 an the local pc you would use the follwoing comand-sequence:

<SendWin WoW1>
 	<SetWinPosition 200 300>
 	<SetWinSize 640 480>

derived from this example you can build a command for 5 boxing, by defining five conectional regions and position windows accordingly.

For example for a system using 2 monitos both with a 1280x1024 resolution, and using the first monitor for the 'main' screen, the second monitor for the other four windows, using resolutions of 640x512 for them would look like:

//-----------------------------------------------------------
// SUBROUTINE TO Position Windows for 5 boxing.
//-----------------------------------------------------------
<Command ResizeAndPosition>
   <SendPC Local>
  	 <SendWin %1%>
   	    	 <SetWinSize 1280 1024>
   	        <SetWinPos 0 0>
  	 <SendWinM %2%>
   	    	<SetWinSize 640 512>
   	        <SetWinPos 1280 0>     
    	 <SendWinM %3%>
  	    	<SetWinSize 640 512>
  	    	<SetWinPos 1280 512>     
    	 <SendWinM %4%>
  	    	<SetWinSize 640 512>
  	    	<SetWinPos 1920 0>     
   <SendWinM %5%>
  	         <SetWinSize 640 512>
  	    	 <SetWinPos 1920 512>     

of course you would have to customize the positions / sizes of the windows as you need them!

PiP / window switching

Window-switching

Simple window switching, like for example Keyclone does it (even if its called pip there) can be done quite easily with using the selfwritten <ResizeAndPosition>-command shown above.

With this you can do for example simple switching with the trigger-keys F1 - F5 for the corresponding windows WoW1 - WoW5 like this:

//----------------------------------------------------------------
//Window Switching
//----------------------------------------------------------------
<Hotkey F1>
   <ResizeAndPosition WoW1 WoW2 WoW3 WoW4 WoW5>
<Hotkey F2>
   <ResizeAndPosition WoW2 WoW1 WoW3 WoW4 WoW5>
<Hotkey F3>
   <ResizeAndPosition WoW3 WoW2 WoW1 WoW4 WoW5>
<Hotkey F4>
   <ResizeAndPosition WoW4 WoW2 WoW3 WoW1 WoW5>
<Hotkey F5>
   <ResizeAndPosition WoW5 WoW2 WoW3 WoW4 WoW1>   

PiP

With HotKeyNet you can do real Picture-in-Picture drawing of windows, like on this screenshot


To do this you use the <SetWinPosition> and <SetWinSize>-commands like shown in the above section to resize and position the windows. But in addition for the 'big window' you specify a 'hole' so that it doesn't overlap the 'littel windows'.

The command to use for this is: <SetWinRegion x y width height> with,

  • x = relative horizontal position, form the upper left corner of the target window, where the hole should start
  • y = relative vertical position, form the upper left corner of the target window, where the hole should start
  • width = horizontal width of th hole
  • height = vertical height of the hole

So to give an example, imagine 5boxing on an 1920x1200 screen, and you want the main window to take up the hole screen, and to line up the four 'slave'-windows with a size of 320x200 300 pixels from the bottom, with a spacing of 100px. To switch between them also we use F1-F5. This could be done like this:

<Command ResizeAndPosition>
   <SendPC Local>
       <SendWin %1%>
          <SetWinSize 1920 1200>
          <SetWinPos 0 0>
          <SetWinRegion 160 1620 300 200>
          <SetWinRegion 560 1620 300 200>
          <SetWinRegion 960 1620 300 200>
          <SetWinRegion 1360 1620 300 200>
      <SendWinM %2%>
          <SetWinSize 300 200>
          <SetWinPos 160 1620>     
      <SendWinM %3%>
          <SetWinSize 300 200>
          <SetWinPos 560 1620>     
      <SendWinM %4%>
          <SetWinSize 960 1620>
          <SetWinPos 1920 0>     
     <SendWinM %5%>
           <SetWinSize 1460 1620>
           <SetWinPos 1920 512>

//----------------------------------------------------------------
//Window Switching
//----------------------------------------------------------------
<Hotkey F1>
   <ResizeAndPosition WoW1 WoW2 WoW3 WoW4 WoW5>
<Hotkey F2>
   <ResizeAndPosition WoW2 WoW1 WoW3 WoW4 WoW5>
<Hotkey F3>
   <ResizeAndPosition WoW3 WoW2 WoW1 WoW4 WoW5>
<Hotkey F4>
   <ResizeAndPosition WoW4 WoW2 WoW3 WoW1 WoW5>
<Hotkey F5>
   <ResizeAndPosition WoW5 WoW2 WoW3 WoW4 WoW1>   

for an example on HotKeyNEt-site see: this

Mousebroadcasting

With HotKeyNet it is possible to do mouse-broadcasting, meaning that you can broadcast a mouse-click on a position in one window, to the corresponding position (regarding to window-resolution) in anoher window. In WoW this is quite usefull for 'mouse-healing', using clique or healbot and for using targetet abilities, like blizzard, druids trees, hunter aoe ...

The general command to trigger a mouse-click with hotkey net is <ClickMouse ..> . The command is quite complex, and better explained in the HKN-APi than i could do it here, so for real details you might look there .

I give here a simple example for simply broadcasting left, right, middle - click while pressing 'g' (for using 'g' as amodifier see <UseKeyAsModifier> ).

<UseKeyAsModifier g>
<Hotkey g LButton, MButton, RButton>  
    <SendLabel w1, w2, w3, w4, w5>
        <ClickMouse %TriggerMainKey%>

if you want to also broadcast f.e. shift+left click you would have to add:

<Hotkey g shift LButton, MButton, RButton>  
   <SendLabel w1, w2, w3, w4, w5>
      <KeyDown shift>
      <ClickMouse  %TriggerMainKey%>
      <KeyUp shift>

Another example for this can be found here: HotkeyNet + AOE!

Other

Here only some quick comments/links for how to implement other more advanced features using HotKeyNet.

Round-Robin

Round robin can be implemented using the <Toggle> -command.


For example defining '4' as a round-robin-key for the windows WoW1 - WoW5 can be done like:

<Hotkey 4>
	<Toggle>
    	<SendLabel w1>
    	<Key %trigger%>
   <Toggle>
     	<SendLabel w2>
     	<Key %trigger%>
   <Toggle>
     	<SendLabel w3>
     	<Key %trigger%>
   <Toggle>
     	<SendLabel w4>
     	<Key %trigger%>
   <Toggle>
     	<SendLabel w5>
     	<Key %trigger%>

Focusless Targetless Leaderless Setup

It is possible to implement an ftl-setup with HotKeyNet, but as it would be a little much to explain it in an introduction thread, i like to only link to the implementation and disscussion:

More examples & informations

Allmost everything I presented here can be found on the HKN-Website, so if you realy want to know it go to:

Personal tools