PDA

View Full Version : Pretend I'm THAT Stupid



Delondial
07-14-2008, 10:27 AM
In Order to run two clients that AHK will actually pick up on with:

WinGet, wowid, List, World of Warcraft (I hear I need this at the start of the script)
~1::
KeyWait, 1, D
#IfWinActive, World of Warcraft
{
ControlSend,, 1, ahk_id %wowid1%
ControlSend,, 1, ahk_id %wowid2%
}
Return
I need to make another folder outside of my regular World of Warcraft folder (name it whatever) and copy JUST the wow.exe? Or do I need to drag ALL the files? Some? Also I am new to coding at all, and the wiki seems to run on the idea that I have a bloody clue (as you can see I dontz -_-) so I'm wondering if I need more spaces in a script? Like for example...

WinGet, wowid, List, World of Warcraft
~1::
KeyWait, 1, D
#IfWinActive, World of Warcraft
{
ControlSend,, 1, ahk_id %wowid1%
ControlSend,, 1, ahk_id %wowid2%
}
Return
Should there be a space here? (I'm that dumb don't stare!) Or is this a WHOLE new script?
~0::
KeyWait, 0, D
#IfWinActive, World of Warcraft
{
ControlSend,, 0, ahk_id %wowid1%
ControlSend,, 0, ahk_id %wowid2%
}
Return
In theory, but running this script, the 0 and 1 key should broadcast over the two clients I am running. And thereby casting whatever spell is in that slot (or ingame macro). If this is so then I should be on the right tract with this.

ALSO! Contain your laughter long enough to tell me how should I tell what is the difference between macros posted for ingame use and all other hotkey macro programs? For example I assume this:

Part 1 - Setup an Action Keybind.








../forum/icon/codeS.png


Source code





1
2




/script SetBinding("L", "TURNORACTION")
/script SaveBindings(1)








Change the L to a key of your choice.



Part 2 - The Macro.








../forum/icon/codeS.png


Source code





1
2
3
4
5
6




/script SelectGossipAvailableQuest(1)
/script SelectGossipActiveQuest(1)
/script CompleteQuest()
/script GetQuestReward(1)
/script SelectGossipOption(1)
/script AcceptQuest()








Confuses and bewilders me. This is a 2 part macro? As in 2 completely separate ingame macro icons and all? Or is this another .ahk thing? Thanks ahead of time for your pity. We will one day look back on all these noob questions and laugh. Well you are already laughing, maybe I'll laugh later :pinch:

keyclone
07-14-2008, 10:36 AM
8|

ok.. that's a lot of voodoo

sWaTs
07-14-2008, 10:52 AM
And that's the reason why I use keyclone :P

Sorry, but I want to play, there's enough other sh*** that needs to be configured.

Katharsis
07-14-2008, 10:56 AM
If you are looking for a free solution, you might want to try HotkeyNet (http://hotkeynet.com). AHK has a bit of a learning curve. *snicker*

Delondial
07-14-2008, 11:06 AM
Free isn't something I require. Keyclone does most of the crazy coding and such? I wasn't sure if there was a large difference between it and ahk. I suppose without an onhand tutor I'm wasted on trying to read all this coding. Brb, buying keyclone license. At least there is a nice dude who seems to be ok with questions (If only he knew what he was getting into :D )

Katharsis
07-14-2008, 11:08 AM
(If only he knew what he was getting into )

I read a lot of the questions Rob gets. I think he's well aware. :D

Lokked
07-14-2008, 11:27 AM
I swear to god if I see another AHK script that uses Keywait and Controlsend when dealing with WoW, I'm going to shoot myself....I wish the sorn script was never published.

Please refer to the Wiki (see link above) and search for AutoHotkey. The method of scripting listed there is uses about 5x less characters then the controlsend wowid%XX method. It is also FAR easier to add new hotkeys, and just reading it over will allow you to understand more about creating new hotkeys using AHK then any other method.

I apologies for the above bluntness, and as a reconciliation, I've copied the opening script of your autohotkey.ahk file:


ClonesPush(strKeys)
{
global WowWinId1
global WowWinId2
global WowWinId3
global WowWinId4
global WowWinId5
IfWinNotActive, ahk_id %WowWinId1%
ControlSend, , %strKeys%, ahk_id %WowWinId1%
IfWinNotActive, ahk_id %WowWinId2%
ControlSend, , %strKeys%, ahk_id %WowWinId2%
IfWinNotActive, ahk_id %WowWinId3%
ControlSend, , %strKeys%, ahk_id %WowWinId3%
IfWinNotActive, ahk_id %WowWinId4%
ControlSend, , %strKeys%, ahk_id %WowWinId4%
IfWinNotActive, ahk_id %WowWinId5%
ControlSend, , %strKeys%, ahk_id %WowWinId5%
}

;Grab unique window ID's
WinGet, WowWinId, List, World of Warcraft


It doesn't matter if you are using less then 5 chars, this works for 2, 3 or 4.

Now, all your normal key broadcasts will look like this:

~1::ClonesPush("{1 down}{1 up}")

The ~ makes it occur on the active window as well as the inactive windows. Take out the ~ and it will ONLY occur on the inactive windows:

Up::ClonesPush("{Up down}")
Up Up::ClonesPush("{Up up}")
Down::ClonesPush("{Down down}")
Down Up::ClonesPush("{Down up}")
~Left::ClonesPush("{Left down}")
~Left Up::ClonesPush("{Left up}")
~Right::ClonesPush("{Right down}")
~Right Up::ClonesPush("{Right up}")

The above will cause Active + Inactive windows to turn left or right (to follow opponents in PvP), but only move the inactive window (alts) forward or backward.

If you wish to use shift + something, alt + something, or ctrl + something, you insert a special character in front of the hotkey to denote the modifier, then on the right of the :: add the appropriate script:

~+1::ClonesPush("{Shift down}{1 down}{1 up}{Shift up}")
The + means shift. This will cause the active + inactive windows to key Shift 1.

~^1::ClonesPush("{Ctrl down}{1 down}{1 up}{Ctrl up}")
The ^ means Ctrl.

~!1::ClonesPush("{Alt down}{1 down}{1 up}{Alt up}")
The ! means Alt.

I hope this helps. You should be able to figure the rest out from here on. It is basically copying the above lines and pasting/editing them until you've got all the keys you wish to use mapped.

The above script is FAR more stable then using Keywait and Controlsend, as frequently that script will miss a step and not release a key (such as a movement key) and your alts will be running for the hills, or spinning in a daze.

I will post my AHK scripts for those just wishing to copy/paste it at a later point.

I also have a separate hotkey file, which is loaded up using a certain hotkey, that passes every key on my keyboard through to the alts, so that I may type in sync on all my WoWs (to spam chat or mass Emote someone).

Delondial
07-14-2008, 11:51 AM
Ooo my thanks for the notions. Unfortunatly I have been reading the scripting entries and am still completely lost. But I will do my best to understand what you have posted.

Lokked
07-14-2008, 11:59 AM
All scripts you see starting with /script or /anything are ingame macros, accessed via the /macro command in WoW. You create macros using various API scripts.

The example you gave above:


/script SelectGossipAvailableQuest(1)
/script SelectGossipActiveQuest(1)
/script CompleteQuest()
/script GetQuestReward(1)
/script SelectGossipOption(1)
/script AcceptQuest()

will be copied into the /macro area of WoW. You will then drag that macro icon to a hotkey on your hotkey bar. When you are in dialogue with an NPC (you have right clicked them to open the text window), clicking that button will, in this order:

Choose the first available quest, if there is one. (Like selecting the ! mark, new quest)
Hand in the first listed quest, if there is one. (Like selecting the ? to hand in a quest)
Advance the quest text if this is needed.
Complete the quest, if this is needed.
Choose the first quest reward, if you haven't selected one yet (I would remove this line /script GetQuestReward(1), best to select your own reward).
Select the first "Speech Balloon" text (if the NPC has a story to tell you).
Accept the currently selected quest.

You will have to press this multiple times to get the desired result, as it appears to be ordered in such a way as to eliminate possible errors, and as such requires multiple presses to actually accomplish its goal.

keyclone
07-14-2008, 12:08 PM
(If only he knew what he was getting into :D )it's usually not that bad. worst case, i walk you thru your setup over vent / phone. most people i do that for are fairly self sufficient after that.

if you think you'd need a walk thru, just let me know.

if you want to get a head start... check out post #16 here [link: Keyclone!!! ('http://www.dual-boxing.com/forums/index.php?page=Thread&postID=76457#post76457') ] it should give you a good starting point

have a great day,

Rob

Lokked
07-14-2008, 12:09 PM
Ok, just visit the Wiki, search AutoHotkey, scroll down to the bottom and copy/past the example WoW script. This script will work perfectly and includes basic explanations of each block of code (the lines starting with a ; ). As it is, it will broadcast 1 though 0, Shift 1 through 0, and CTRL 1 through 0, as well as suspend the script when you want to chat or reply to a tell. To add more hotkeys, simply copy/paste the appropriate type of key you'd like to mimic, and change the data to reflect the key you want broadcasted.

I would also copy and paste the movement keys I posted above.

After having said all this, AHK is more a headache then anything, and to be honest, Keyclone is a far better alternative. If I hadn't already put so many hours into customizing my AHK script, I'd go ahead and purchase Keyclone, but I have too much pride invested in AHK, even though Keyclone is more efficient.