PDA

View Full Version : My full AutoHotKey script.



-silencer-
08-16-2008, 09:19 PM
I've seen so many questions on how to write or just setup AHK scripts, I'm posting my full AHK script here. I've recently re-written the entire thing, and although I've had no problems with initial testing, it's possible there's an error or two due to the massive amount of key combinations it's able to broadcast. There is absolutely no automation in the script - it's strictly key broadcasting with no added risk.

Here's the functionality involved:

- It is completely flexible with no modification needed for running different amounts of instances of WoW once you've got it set up for your at least your maximum amount. It's currently written to handle up to 6 instances of WoW at once (the amount of accounts I've used at once), but it could easily be expanded by adding a few lines to support as many instances of WoW you want. It will work perfectly fine using less than the supported instances. I've had it running with just one WoW instance, two, three, five, and six with no issues.

- F1 is my "formation spread" key, so it is broadcasted as a keypress down, and not broadcasted as a keypress up until it's released. This means the longer you hold the key, the farther apart your characters will spread. It broadcasts to all instances, so you'll probably want to unbind F1 on your main, and bind F1 to a different movement key on each of your alts. I have a commented section (using ;'s for commented lines) to go back to standard F1 broadcasting.

- All standard alphabetic keys are NOT broadcasted. I'm bad about forgetting to suspend AHK when I chat, and I hate character screens, social windows, bags, etc popping up while I'm chatting.

The commented section in the top of the script describes the functionality:
;================================================= ====================
; AutoHotKey Script by codeX* (aka -silencer-)
; - Flexible number of WoW instances. You can run from 1 to 6
; instances of WoW with no functional changes needed. All you
; have to do is reload the script.
; - Delete will toggle suspend script on/off.
; - The following keys are broadcasted:
; 1 to = (plus Shift, Control, Alt modifiers)
; F1 to F12 (plus Shift, Control modifiers)
; Note: F1 is my "spread" formation key, it works differently
; A to Z (only with Control modifier)
; Numpad Keys (plus Shift, Control, Alt modifiers)
; Arrow Keys (plus Shift, Control, Alt modifiers)
; Space (plus Shift, Control, Alt modifiers)
; Backspace (plus Shift, Control, Alt modifiers)
; [ ] (plus Shift, Control, Alt modifiers)
; 58-key X-Keys Pro Set (All have Shift+Control+Alt modifier)
; A to Z (26 keys)
; 1 to 0 (10 keys)
; Numpad1 to Numpad0 (10 keys)
; F1 to F12 (12 keys)
; Up, Down, Left, Right Arrow Keys
; - These keys are NOT broadcasted:
; NumLock & NumEnter
; A to Z, Shift+A to Shift+Z, Alt+A to Alt+Z
; Alt+F1 to Alt+F12
; Enter, Tab, Escape, ~, \, Insert, Delete, Home, End, PgUp, PgDn
; PrintScreen, ScrollLock, Pause, CapsLock, <, >, /
;================================================= ====================

Note that none of the alpha characters are broadcasted - I can't stand windows popping up while I'm chatting if I forget to suspend AHK. However, the alpha keys are broadcasted with Control modifier. Although I don't have an X-Keys Pro yet, I wanted the functionality ready when I decide to purchase one. There are 62 keys that are broadcast with the Shift+Control+Alt modifier, with the intended use to be with X-Keys Pro. I use these for my G15's 18 macro keys. There are no broadcasts using two combined modifiers, so that could be added for extra broadcasted keys if you have a full X-Keys keyboard you'd like to use alongside a regular keyboard.

If you have any questions, feel free to reply here.

Enjoy.

I didn't check the number of lines, but this is a large text file, so I can't post the full source here. Download it and take a look if you're interested.
(Attachments here have size restrictions, and it's 90kb uncompressed. Download this zip file, decompress, and load up my AHK script for massive key broadcasting goodness.)

1Kurgan1
08-18-2008, 05:10 PM
Thanks for writing this script seems very nice, but I am completely new to this.

I am running a Warlock/Hunter combo and here is what I have noticed.

Lets say 1 is Shadow Bolt/Auto Shot, If I hit the 1 key it will try and activate both, but Auto Shot will never fire off. Now lets say 2 is Corruption/Raptor Strike, If I drag the mob by the front of my Huntard he will Raptor Strike.

I am assuming the problem is he will not grab the targets at range, is there anything in these commands I am missing that does this? Sorry if this seems like a n00b question, any help would be fantastic.

Also will it matter if both WoW's are running from the same drive/install or can they be on different ones?

-silencer-
08-18-2008, 08:48 PM
Sounds like you're not using macros in-game on the /following toon to properly target the enemy.
Two simple solutions:
Have a key with this macro: /target nametarget (where "name" is your main character). Press that key after you target a new mob to have your /follower now target that mob, then continue on with your attacks.
Or..
For all /followers, change all your skills/spells to macros like this:
/target nametarget (or party1target, or focustarget.. depending on how you set up your macros)
/cast skill

Multiboxing is more than just loading up an AHK script. You have to configure a ton of in-game macros to properly target and use skills. The AHK script simply sends a keypress to all instances of WoW.

It doesn't matter where the WoWs are running from, as long as they are already running from the same computer when you kick off the AHK script.

Beasthorn
08-22-2008, 04:47 PM
Thanks for taking the time to code this up and post it. I started using it last night and it is working out great. I had been limited to only the number keys + alt and I was just about out of room. This makes AHK very easy to use and is allowing me to bind a lot more keys :)

I really like the suspend key, I no longer randomly cast spells while entering way points in my map.

wowphreak
08-23-2008, 01:45 AM
Ok something I dont get about the script

killbroadcast gets set to 0 at the start and for every key basically yeh check "If(%killbroadcast% = 0)"
but I dont see any place where it gets changed to anything else

Whats the point of "If(%killbroadcast% = 0)"?

Grym
08-26-2008, 11:23 AM
Excellent, ty for the file.

Im still a nub learning how to 3 box but having fun so far. Before I multiboxed, I had all major spells on the numpad (Im a lefty so wasd setup is bad for me) so Id like to replicate this triboxing. The problem Ive had with my own AHK script is to get /*-+ on the numpad to broadcast.

The basic part of the script is:

#IfWinActive, World of Warcraft
~Numpad/::
ControlSend,,{Numpad/ down}{Numpad/ up}, ahk_id %wowid1%
ControlSend,,{Numpad/ down}{Numpad/ up}, ahk_id %wowid2%

Thanks for any suggestions.

Lokked
08-26-2008, 11:43 AM
The numpad keys are listed as follows:

/ = NumpadDiv
* = NumpadMult
- = NumpadSub
+ = NumpadAdd
. = NumpadDot
<Enter> = NumpadEnter


Of course, this is all depending on your having your Numlock ON.

You can easily find things like this at http://www.autohotkey.com/docs/KeyList.htm ('http://www.autohotkey.com/docs/KeyList.htm').

Grym
08-26-2008, 02:56 PM
Tyvm

Now back to trying to run (more efficiently now) a warr/druid/lock combo.

Randon
08-28-2008, 02:42 AM
Hey guys, this might be a stupid question, but does it matter with this script which instance of WoW I want to be my main one? 'Cause no matter which order I start up WoW in/log on in, when I run the script it always brings my WoW2 into activity. Does this mean it thinks it's my main window? If so, how do I get around it using this script?

-silencer-
08-28-2008, 09:16 AM
Hey guys, this might be a stupid question, but does it matter with this script which instance of WoW I want to be my main one? 'Cause no matter which order I start up WoW in/log on in, when I run the script it always brings my WoW2 into activity. Does this mean it thinks it's my main window? If so, how do I get around it using this script?
It doesn't matter which WoW window is your main with this script - it sends the same keystrokes to all WoW windows. The Wow2 activity you're seeing is just due to the way it recognizes the WoW windows when you kick off the script. For example, when I run 6 instances of WoW and kick off the script (with WoW1 being my main), it goes in this order: WoW1 -> WoW6 -> WoW5-> WoW4 -> WoW3 -> WoW2. So, WoW2 is the final window the script recognizes - I then just go back to the WoW1 window and play from there.

I'm in the process of cleaning up the script and adding more to it, but that probably won't be done until well after I'm done testing WoW on the SSD I should be receiving today. Expect test results later this weekend.

laiyo
08-31-2008, 11:35 AM
So bassicly i just have to download that file open it reload script and open 2 wow acocunt and then if i click on acocunt A button1 would it click button 1 at account B or do i need to do other things also? so it will works

many thanks :)

-silencer-
08-31-2008, 05:39 PM
Open your WoWs first, then reload script. All WoW instances have to be running for the script to work on them.

joypunk
09-01-2008, 11:34 AM
First of all, thanks for the script, Silencer. I've been thinking about getting started with dual-boxing, and having your script already made got me to finally jump into it.

I've tried searching the forums for G15 info, but apparently the forum search doesn't like that phrase because it returns no results. But, the phrase "G15" is clearly in this thread. =P

I looked at your script and I don't see any specific mention of binds for the G15 macro keys. How do you utilize those keys with this script?

joypunk
09-02-2008, 11:37 AM
Follow-up to my question.

I bound the G15 keys on my keyboard to Ctrl-Alt-Shift-<key> and was going to use those binds that you had setup in this script. But, when I use the G-keys the key presses get passed as "artificial" and they aren't triggering anything on my other WoW clients. If I press the key combination manually, it works.

So, I guess the question really hasn't changed. I'd like to know how you have your G-keys setup and how you're getting them passed to the other clients.

Thanks.

otep65
09-04-2008, 04:09 PM
Im probably an idiot but I cannot get the arrow keys to work one goes and the other one just kind of jerks around. Ive tried switching it to control+up down left right in key bindings and same thing. Any advice would be appreciated.

PS not using g15 keyboard would that have anything to do with it?

-silencer-
09-04-2008, 07:28 PM
Im probably an idiot but I cannot get the arrow keys to work one goes and the other one just kind of jerks around. Ive tried switching it to control+up down left right in key bindings and same thing. Any advice would be appreciated.

PS not using g15 keyboard would that have anything to do with it?
Look at how the F1 key is controlled. Duplicate that functionality for the Up/Down/Left/Right keys. Currently, if you hold down an arrow key, it gets broadcasted as a bunch of quick key presses. You don't want that - you want to send a "keydown" event, and don't send a "keyup" until you release the arrow key. That's what F1 does in this script. G15 has nothing to do with it.

Xealous
09-05-2008, 03:48 AM
Heya thanks for taking the time to do this script :) I just have one question:

I already use AHK and made my own script - mine is pretty basic - but for each hotkey (that I would use for a spell) I would have it press = also. As my macro on = is /assist. :)



#IfWinActive, World of Warcraft
~3::
ControlSend,,{3 down}{3 up}, ahk_id %idMain%
ControlSend,,{= down}{= up}, ahk_id %idClone%
ControlSend,,{3 down}{3 up}, ahk_id %idClone%
return


So if I wanted your script to do something similar (press = so it would assist) would this work? : (I'm at work so can't test it at the mo)


~3::
KeyWait 3, D
WinGet, Active_Window, ID, A
IfWinActive, World of Warcraft
{
If(%killbroadcast% = 0)
{
Loop, %wowid%
{
target_window := wowid%A_index%
If (Active_Window <> target_window)
{
ControlSend,, 3, ahk_id %target_window%
ControlSend,, =, ahk_id %target_window%
}
}
}
}
Return

..or does it need something else? :/

Thanks in advance. :)

-silencer-
09-05-2008, 02:56 PM
Swap those two ControlSend lines and it should work - you want the = to be sent before the 3.

Xealous
09-05-2008, 07:53 PM
ooh great thank you! :)

thechump
09-05-2008, 11:30 PM
Just downloaded
looks good thanks!


Chump

Nvas
09-06-2008, 03:58 PM
Ive recently started with Multiboxing to help leveling my friends WoW account because he doesnt have that much time for leveling and i tried your AHK script, I Open WoW's (( 2 )) , i run autohotkey and i run your script, then i reload the script but whatever i do i cant get it working, my second char keeps doing nothing... Please help a rookie ;(



(( while writing this i got killed by boars :cursing: "))

-silencer-
09-06-2008, 07:33 PM
Ive recently started with Multiboxing to help leveling my friends WoW account because he doesnt have that much time for leveling and i tried your AHK script, I Open WoW's (( 2 )) , i run autohotkey and i run your script, then i reload the script but whatever i do i cant get it working, my second char keeps doing nothing... Please help a rookie ;(



(( while writing this i got killed by boars :cursing: "))
Stop account sharing before you get both accounts banned. Blizzard takes this very seriously.

Blubber
09-07-2008, 03:51 PM
I'm also using AutoHotKey these days, my script is a little different from yours though. The thing that strikes me is that you manually bind all those keys, I use this little thingy



HotKeys := "abc012"

keycount := StrLen(HotKey)
Loop, keycount
{
key := SubStr(HotKeys, A_index, 1)
HotKey, %key%, KeyPress
}

KeyPress:
ClonesPush(A_ThisHotKey)
return


Just put all the keys you need in the HotKeys string, the only thing that doesn't work are special keys. That ClonesPush functions is from the Wiki.

Holger
09-23-2008, 11:08 PM
hi, i am new to this, and am having trouble with the g buttons from g15 keyboard, i have set the g15 keyboard profiler with the ctrl+shit+alt+(x), x beeing a-r, and in wow interface keybind options (using g15 addon) i have set them to the same bindings, but once i sue them nothing happens, and it stops working on the normal 1to= buttons, what can i do to make the g15 buttons work on both clients or more?

Troy213
09-24-2008, 11:16 PM
Thank you for posting

spedzer999
11-07-2008, 02:38 AM
I'm having a few problems with this. Whenever i try to use my arrows keys to run the player on /follow stops following and wont move.I have to go back to that screen and put him on /follow again and can only move by the mouse.

Also,how do i get my player on /follow to attack.i attack with the main guy but the 2nd player just sits there

Trok
11-09-2008, 02:31 AM
Curious if theres a way to get your script to broadcast across to another pc? or can autohotkey even do that?

Tokolosi
11-21-2008, 03:02 PM
Iwonder if anyone else is having the same problem as me..
I load my two WoW's, load Autohotkey then try and load Silencer's script.. AHK freaks out saying
" Finished loading hotkey file.
5401 errors were found
0 definitions were loaded
0 keys will be used as modifiers "

It keeps spamming " Line 5146 in AutoHotkey-codex-beta\AutoHotkey-codex-beta.ahk: Return
text was found outside <> symbols; that's not allowed. "

?

-silencer-
11-22-2008, 05:31 PM
I'm having a few problems with this. Whenever i try to use my arrows keys to run the player on /follow stops following and wont move.I have to go back to that screen and put him on /follow again and can only move by the mouse.

Also,how do i get my player on /follow to attack.i attack with the main guy but the 2nd player just sits there
The script wasn't written to intend the arrow keys to be used for movement (just WASD). To allow arrow key use without /follow breaking, you'll need to unbind all arrow key movement from the followers, and comment out all Up::, Down::, Left::, Right:: sections in the script. I did this to play on my laptop and it works fine. To comment, just put a semicolon (;) in front of every line in the ==== ARROW KEYS ==== section of the script.


Curious if theres a way to get your script to broadcast across to another pc? or can autohotkey even do that?

Autohotkey can't do that alone. You need KeyClone, Synergy, or (I believe) Octopus for multi-pc broadcasting. A combination of Autohotkey and Synergy would probably work, but KeyClone would be the easiest solution.


Iwonder if anyone else is having the same problem as me..
I load my two WoW's, load Autohotkey then try and load Silencer's script.. AHK freaks out saying
" Finished loading hotkey file.
5401 errors were found
0 definitions were loaded
0 keys will be used as modifiers "

It keeps spamming " Line 5146 in AutoHotkey-codex-beta\AutoHotkey-codex-beta.ahk: Return
text was found outside <> symbols; that's not allowed. "

?
I just downloaded this script to play on my laptop with no problems. Are you sure the script didn't get edited at all when you downloaded & extracted it? Re-download it and try again.

Rinye
12-26-2008, 06:04 PM
Ok, I'm a rookie with dualboxing.
I've downloaded your script, launched it etc... But only my numpad & F-Buttons work, can I change this? xD
Thanks :rolleyes:

lewlgb
02-01-2009, 06:43 PM
hi, thanks so much for your time and effort for this. I'm new to this and have been trying all day, ive finally found your script for this program but i cant seem to get movement or macros working.

using the WASD keys is only moving the account im controling and placing macros on one or both acounts is not working either, once i suss this out i think im good to go. All thanks to you, any advice you could give me

EDIT

I've sorted my marcoing, now i cant get the movement working. the follow macro ect is fine. but to move the 2 together i cant seem to get it working, for example i can't spin the characters around together.

-silencer-
02-04-2009, 11:35 AM
Ok, I'm a rookie with dualboxing.
I've downloaded your script, launched it etc... But only my numpad & F-Buttons work, can I change this? xD
Thanks :rolleyes:


hi, thanks so much for your time and effort for this. I'm new to this and have been trying all day, ive finally found your script for this program but i cant seem to get movement or macros working.

using the WASD keys is only moving the account im controling and placing macros on one or both acounts is not working either, once i suss this out i think im good to go. All thanks to you, any advice you could give me

EDIT

I've sorted my marcoing, now i cant get the movement working. the follow macro ect is fine. but to move the 2 together i cant seem to get it working, for example i can't spin the characters around together.
If you open the script in Notepad (or another text editor), you'll see the comment at the top of what exactly is bound. Nearly everything is bound (including modifiers with ALT, Shift, Control, and combinations of those modifiers) except the a-z keys. I intentionally left all A-Z keys *unbound* so when I type in chat on my main, my followers aren't casting spells and such - only jumping in place as the spacebar is pressed. If you want to include movement, you need to follow the same approach that I used for the F1 key for proper use of holding down a key and checking for "key down" and "key up" commands.

For example, if you want the "a" key to spin all characters left, copy the F1 code to the bottom of the script, then replace all "F1" places with "a". I wouldn't suggest using WASD to control all character though - unless you're using a different form of movement for your main when you want the others to /follow.

Hellraiser
03-20-2009, 05:04 AM
Installed your script last night. Works perfect for me. Much appreciated.

Only had to disable Shift + 7 in order to reply whispers without having my toons start casting.

alcattle
03-20-2009, 05:18 AM
that is what scroll lock key is for

samus151
03-23-2009, 09:01 AM
Hey nice!

excuseme, it can work with other online game? ?(

nhines04
03-30-2009, 10:35 PM
Hey, everyone. I'm COMPLETELY new to dual-boxing; I recruited myself, and I'm planning on dual boxing a few chars to 60. My first question is, will this script be viable all the way to 60, or will I need someting more advanced? And if this will work....I hate to ask, but I need a tutorial. This stuff is foreign to me, and reading these posts doesn't teach me much =/. (Not to say they aren't informative; I'm just uninformed.) So I've copied the script, but nothing works. I'm leveling two warlocks, for the simplicity of having two of the same class. And I need help with ALL of this stuff. I hate to ask, everyone, because I'm sure it's a chore. If somebody posted one, however, I'd be extremely thankful. Thanks, everyone =]

Ozzey
08-08-2009, 12:33 PM
i cant find the damn download link

kos_gammon
08-26-2009, 11:12 PM
what gives wheres the download link??

Cynedelina
08-29-2009, 06:35 PM
where is the download please

cornrooster
09-07-2009, 03:59 PM
i cant find it either =((((((

columbiatch
09-19-2009, 02:38 AM
Download is gone, can you re-post?

Phaer
11-28-2009, 02:41 AM
I'd love if someone could repost the script, I don't understand how to script anything ): It's like a completely different functional language to me.

Vone
08-15-2010, 10:12 AM
dude i cant see script-.-