Log in

View Full Version : [HotKeyNet] Can't get the HotkeyNet Sample script to work



mountainking
11-28-2010, 08:01 PM
http://hotkeynet.com/wow/wow-sample-two-on-one.html

Here's what I'm trying to do:

Have spells, click-to-move, accept quest, turn in quest, and interact with NPC basically mimicked on my inactive window?

Also tried to get my second char to auto follow me after combat with jamba but i cant get it to work at all. :\

I'm new to multiboxing and I'm trying it for the first time since the game only costs $5 right now could use some help.

EDIT here is the error I get when I load the script

Command line: AutoExec
Unable to find command AutoExec

EaTCarbS
11-28-2010, 08:19 PM
what exactly are you having problems with? could you be more specific?

mountainking
11-28-2010, 09:19 PM
I'm trying to get the game to run on one machine/monitor and have hotkeynet just mimic my mouseclicks, targeting, and key pressing on my inactive window.

It seems like something simple to do but I can't get this thing to work and it's giving me a headache -.-

Gonna mess with it some more so I can hopefully give you more info because I don't really know how to write code myself

Ualaa
11-28-2010, 09:22 PM
For the mouse stuff, this might help: http://www.dual-boxing.com/showpost.php?p=303094&postcount=11

Khatovar
11-29-2010, 03:39 AM
That error is irrelevant. It's simply HKN looking for anything that it should do without you using hotkeys, such as autolaunching WoW or creating buttons.


Are your paths set properly? <Run "c:\Program Files\World of Warcraft\WoW.exe">
Is your Scroll Lock on? <Hotkey ScrollLockOn A-Z....>
Are your WoWs renamed? <Hotkey ScrollLockOn Alt Ctrl L> or <Hotkey ScrollLockOn Ctrl R> if you launched instances manually
Are you activating mousing properly? You must hold down oem3 {the tilde key ` } while pressing the mouse buttton.
Are you running both windows as active or are you minimizing the secondary window? I don't see a resize code in that script. The below code will add a large window for your main WoW and a small window for your slave WoW on the same screen. You may need to adjust based on your screen size.



//----------------------------------------------------------
// SUBROUTINE TO Position Windows for 2 boxing.
//----------------------------------------------------------
<Command ResizeAndPosition>
<SendPC Local>
<SendWinM %1%>
<SetWinRect 0 0 1288 1020>
<SendWinM %2%>
<SetWinRect 1290 0 390 356>


Then add <ResizeAndPosition WoW1 WoW2> in the Launch and Rename section so it reads like this


//-----------------------------------------------------------
// HOTKEY TO LAUNCH AND RENAME BOTH WOW'S.
//-----------------------------------------------------------
<Hotkey ScrollLockOn Alt Ctrl L>
<LaunchAndRename Local WoW1>
<LaunchAndRename Local WoW2>
<ResizeAndPosition WoW1 WoW2>

You may need to adjust based on your screen size. One way to do this is to take a screenshot of your desktop {PrtScn in Windows} and pasting it {ctrl+v} into a paint program like Paint.NET (http://www.getpaint.net/), then use a draw rectangle tool to visualize how you want it set up.

http://img444.imageshack.us/img444/858/reseu.jpg (http://img444.imageshack.us/i/reseu.jpg/)



The pink rectangle would be your main window, the blue would be the slave.

The first set of numbers you need for SetWinRect are the x,y coordinates for the upper left corner of the windows {0 0 for the main and 1290 0 for the slave using my example}. Paint.NET shows this in the lower right corner of the program. Alternately, you can get these coordinates by opening HotKeyNet and clicking your mouse anywhere on your screen where you want the window to be placed. In the Last Key Press Window you will see "scrn position: x = 0 y = 0"

The second set of numbers for SetWinRect are the dimensions of the windows {1288 1020 for the master and 390 356 for the slave in my example}. This is shown in the bottom left corner in Paint.NET and states how many pixels wide {1288, 390} by how many pixels high {1020, 356} the specific window should be.


Here's what I'm trying to do:

Have spells, click-to-move, accept quest, turn in quest, and interact with NPC basically mimicked on my inactive window?
...
I'm trying to get the game to run on one machine/monitor and have hotkeynet just mimic my mouseclicks, targeting, and key pressing on my inactive window.



It sounds kinda like you're trying to do everything with your mouse. That's really not going to work well for multiboxing. It's almost all keybinds and macros (http://www.dual-boxing.com/forumdisplay.php?f=14) and that script you are using only allows for manually triggered mousepassing {ie. mouse will only be passed to the slave screen if you are holding down the ` key} .

Spells - Should be all keybound macros/spells triggered with keypresses. You will need a spell/macro on the master and one on the slave. We'll take shamans for example, since everyone loves them. This is just down and dirty examples to get you going. You'll have time for elegant and complex later.

The main is easy enough, you can simply drag Lightning Bolt from your spell book and drop it on 1.

However, the slave needs a macro or other means of knowing what your master is targeting. You can do this with a manual assist, a built in assist or by using focus.


Manual Assist - This is a button that you press before you start attacking, but after your main has a target to tell your slave to pick up the target.

On your slave make a macro that says simply /assist toon/party#/focus using either the name of your main toon, the party number of your master {if your main is always the party leader, this will be party1} or your focus target {see below}.

Place that macro on a keybind. I use [

Target a mob on your main and then press [ Your slave will now pick up the same target.

Place Lightning Bolt on the same keybind that the master uses {1}.


Built-in Assist - Rather than assisting prior to combat or having to use a keybind to assist, you can macro it directly to your spells.

On your slave, make a macro for Lightning Bolt, adding /assist toon/party#/focus to the top of the macro.


/assist Kina
/cast Lightning Bolt

Place that macro on the same keybind your master uses {1}. Your slave will now target and cast in the same keybind.


Focus Assist - Rather than acquiring a target, your slave simply casts on what their focus casts on without actually targeting anything. This, like manual assist, requires initial setup, but does not require constant interaction with another button.

On your slave, create a macro to set your focus. /focus toon/party#/target {if you use target, you'll need your slave to target someone first, which you can do manually or you can do /target toon /focus target which is rather roundabout}.

Place that macro on a keybind. I use Home. As long as you don't do anything to clear your focus {logging out, setting a new focus, changing the main toon in the party, ui reloading} you will only need to use this key once per gaming session.

On your slave create a macro for Lightning Bolt adding a targetting conditional to the line


/cast [@focustarget] Lightning Bolt

Place that macro on the same keybind your master uses {1}. Your slave will now cast on whatever your master has targeted without actually having a target of their own.



Click-to-move

Your slave should only actually Click-to-move on their own in combination with interact with target. It should not be used for normal movement. For travel and such, your slave should always simply follow your main. Because of things like latency, resoultion, camera angles and even slight degrees in variance of facing, your slave will never perfectly mirror the master for movement. This is why we all use follow commands instead of sending movement keys to slaves.

For quests and such, review my FAQ on Jamba Jamba - Getting Started (http://www.dual-boxing.com/showthread.php?t=28573), particularly the sections Now what? -> What do you mean "push"? in post 1 and Quest -> Quest Completion in post 3.

Freddie
11-29-2010, 11:10 AM
Nice tutorial, Khat!

Usually when people say "nothing works" it's because they aren't running HotkeyNet as administrator. I've learned my lesson from this -- Mojo will force people to run it as admin whether they like it or not.

mountainking
11-29-2010, 02:54 PM
This is the single most helpful response to a post I think I've ever made on a forum thanks Khatovar, I'm just working out the kinks now. You're awesome.

mountainking
11-29-2010, 03:42 PM
Still having trouble with getting the character to follow me without having to constantly click the other window and click the follow macro I made.

Also on with HKN keys randomly stop working (will only be send to the active window even with Scroll Lock On)

Questing and looting is still frustrating me a little but maybe I'll get the hang of it lol. Here's my code

//================================================== ==============
// SAMPLE SCRIPT FOR TWO WOW'S ON ONE PC
//
// Instructions: Copy this entire script (all the blue writing
// on gray background including comments). Save it in a file.
// Load it into HotkeyNet.
//
// Toggle the scroll lock key to turn hotkeys off and on. (You
// can change this if you want, just like you can change
// everything else with HotkeyNet.)
//
// Requires HotkeyNet build 147 or higher.
//
// For more info, go to www.hotkeynet.com
//================================================== ==============

//-----------------------------------------------------------
// PRESS CTRL R TO RENAME WOW'S IF YOU LAUNCH THEM MANUALLY
//-----------------------------------------------------------
<Hotkey ScrollLockOn Ctrl R>
<SendPC local>
<RenameWin "World of Warcraft" WoW1>
<RenameWin "World of Warcraft" WoW2>

//----------------------------------------------------------
// SUBROUTINE TO Position Windows for 2 boxing.
//----------------------------------------------------------
<Command LaunchAndRename>
<SendPC %1%>
<Run "D:\Games\World of Warcraft\WoW.exe">
<RenameTargetWin %2%>

<Command ResizeAndPosition>
<SendPC Local>
<SendWinM %1%>
<SetWinRect 0 0 1288 1020>
<SendWinM %2%>
<SetWinRect 1290 0 390 356>

//-----------------------------------------------------------
// HOTKEY TO LAUNCH AND RENAME BOTH WOW'S.
//-----------------------------------------------------------
<Hotkey ScrollLockOn Alt Ctrl L>
<LaunchAndRename Local WoW1>
<LaunchAndRename Local WoW2>
<ResizeAndPosition WoW1 WoW2>

//-----------------------------------------------------------
// DEFINE MAIL LABELS FOR SENDING KEY STROKES
//-----------------------------------------------------------
<Label w1 Local SendWinM WoW1>
<Label w2 Local SendWinM WoW2>

//-----------------------------------------------------------
// DEFINE HOTKEYS FOR ALL KEY COMBINATIONS THAT WILL GET
// SENT TO BOTH WOWS. ADD MORE KEY COMBO'S IF YOU WANT.
//-----------------------------------------------------------
<Hotkey ScrollLockOn A-Z, 0-9, Plus, Minus, F1-F12 except W, A, S, D, Q, E>
<SendLabel w1, w2>
<Key %Trigger%>

//-----------------------------------------------------------
// DEFINE MOVEMENT KEYS THAT WILL GET SENT TO BOTH WOW'S.
// ADD MORE KEYS IF YOU WANT.
//-----------------------------------------------------------
<MovementHotkey ScrollLockOn up, down, left, right>
<SendLabel w1, w2>
<Key %Trigger%>

//-----------------------------------------------------------
// BROADCAST MOUSE CLICKS. HOLD DOWN OEM3 (ON U.S. KEYBOARDS,
// THAT'S THE SQUIGGLE KEY IN UPPPER LEFT CORNER) WHEN YOU
// WANT TO BROADCAST.
//-----------------------------------------------------------
<UseKeyAsModifier Oem3>

<Hotkey ScrollLockOn Oem3 LButton, MButton, RButton, Button4, Button5>
<SendLabel w1, w2>
<ClickMouse %TriggerMainKey%>

Mootallica
11-29-2010, 10:34 PM
Some folks )including myself) use the Jamba addon for wow. At its simplist, it uses a simple Master Slave concept and can help alot with the following, quests, trading etc.

Following and possitioning I think will always be a situational thing, and for me I use the S (walk backward key) to break following, and I've created a seperate hotkey that triggers macro's on each slave to /follow. I use Bartended to help assign custom macros on each toon. For example this is what I use to trigger the key combo Alt Ctrl 6 on my Slaves. (I should note I use a game pad also to assign the key combos to one key.)




//----------------------------------------------------------------
//Follow Master - Trigger Follow macro on WoW2
//----------------------------------------------------------------
<Hotkey ScrollLockOn Alt Ctrl 6>
<SendLabel w2>
<Key Alt Ctrl 6 >




Here is my example of the auto follow hotkey I have for hkeynet.




//-----------------------------------------------------------
// DEFINE MOVEMENT KEYS THAT WILL GET SENT TO BOTH WOW'S.
// ADD MORE KEYS IF YOU WANT.
//-----------------------------------------------------------
<MovementHotkey ScrollLockOn up, down, left, right, Space, S>
<SendLabel w1, w2>
<Key %Trigger%>

Khatovar
11-30-2010, 02:56 AM
Still having trouble with getting the character to follow me without having to constantly click the other window and click the follow macro I made.

Also on with HKN keys randomly stop working (will only be send to the active window even with Scroll Lock On)

Questing and looting is still frustrating me a little but maybe I'll get the hang of it lol.

HKN only has a limited number of keys sent in that default script. If your slave's follow macro isn't on one of the default number keys {1 through =} or one of the F keys {F1 through F12} then HKN isn't passing it. You can add more keys under the section

//-----------------------------------------------------------
// DEFINE HOTKEYS FOR ALL KEY COMBINATIONS THAT WILL GET
// SENT TO BOTH WOWS. ADD MORE KEY COMBO'S IF YOU WANT.
//-----------------------------------------------------------

Type the key you want to send and look in the Last Key press Window in HKN to see the key name, then add the key name to <Hotkey ScrollLockOn A-Z, 0-9, Plus, Minus, F1-F12 except W, A, S, D, Q, E> BEFORE the "except" and separate them with commas.

Again, review the Jamba FAQ I linked in my first post, it explains how to get slaves to loot, accept and turn in quests and other such things.

mountainking
11-30-2010, 04:13 PM
I've resolved most of my issues thanks everyone (especially Khat your guides really are helpful to a first time casual like me)!

I bound
/tar Master
/Follow

and

/tar Master
/Assist

and bound a key to Interact with Target.

Then finally got the Oem3 mouse clicking to work decently when completing and accepting quests (woo!)


Only problem I have left is that occasionally only one window will respond to HKN. When I check the log it says it's sending to bot W1 and W2. I try reloading the script and restarting HKN but it doesn't help. I think it has to do with when I re-size windows with the mouse but I'm not sure. It's weird the keys will only send to the background window while the main one won't respond. Restarting the computer fixed but trying to get to the bottom of why it's happening and so I can avoid it.

Thanks for you help everyone.

Freddie
12-01-2010, 03:37 PM
Only problem I have left is that occasionally only one window will respond to HKN. When I check the log it says it's sending to bot W1 and W2.
If HotkeyNet shows you blue messages saying it sent keystrokes to both windows, but only one WoW reacts to them, the reason is almost always that you have more than one window on the computer with the same name as the window that isn't receiving.

In other words, you have told HotkeyNet to send keystrokes to a window with a particular name. HotkeyNet has found a window with that name. HotkeyNet has sent keystrokes to that window. But it's not the window you have in mind.

When you reposition or resize windows, you can change the Z order. This changes the order in which HotkeyNet finds windows, and it can make this problem appear or disappear.

A second window of this sort can exist without your being aware of it. Many windows are invisible. A second window of this kind can get created when you slide the cursor over a task bar button (the thumbnail that pops up briefly is a window, and it has the same name as the original).

You can test whether this is the cause of the problem. Next time it happens, look at the blue messages and notice the handle of the window that HotkeyNet is sending keystrokes too. Write it down. Then go to the Actions Menu and select "Identify window handle" and figure out whether it's the right window.

mountainking
12-06-2010, 05:57 PM
From this pc: <SendWinM WoW2><Key 8><SendWinM WoW1><Key 8>
<SendWinM WoW2> completed: Window found. Target set to 0x180206 "WoW2"
<Key 8> completed
<SendWinM WoW1> failed: Could not find window "WoW1"
<Key 8> failed: no window is targeted

This is the error i'm getting when the program when it's not working (usually after I resize a window)

Is there a command someone can help me with to restore my windows to the size they are when I use the ALT CTRL L command to launch them initially?

Ty

EaTCarbS
12-06-2010, 07:26 PM
You're having a problem because your windows aren't named correctly

http://www.hotkeynet.com/ref/renametargetwin.html

http://www.hotkeynet.com/ref/setwinsize.html

Khatovar
12-07-2010, 12:52 AM
Why do you resize the windows after HKN resizes them?