PDA

View Full Version : Using AHK Need A Bit Of Help



Darkreign11
09-13-2012, 05:22 PM
Like the title says using AHK (AutoHotKey). And trying to get "Interact With Target" set to "NumPadDiv".


~NumPadDiv::
KeyWait, NumPadDiv, D
ControlSend,, {NumPadDiv}, ahk_id %idClone%
Return

Similar commands are functioning on slave like this but that one specifically. I have "NumPadDiv" bound to master and slave so they do the action together. Just master interacts with the target via "NumPadDiv". Though even with "NumPadDiv" being bound on slave, it will not. Even tried other keys bound to Interact With Target, with the same luck. It just isn't wishing to work. Though all my other keys work just fine 0-9,keypad 0-9,F1-F12, Tab,Shift,Up,LButton,-,x.

Now if I swap one of the working ones that work into interact with target. Then it fails like before. Is there something more thats needed for my slave to interact with its target beyond a keybind to interact with target?

Using many but here's examples of working ones:


// numpaddadd macro
/assist [mainname]

// bound to target nearest enemy
~Up::
KeyWait Up
ControlSend,, {Up}, ahk_id %idClone%
Return

// bound to numpadadd that fires numpadadd macro. allows me to double click targets for them to target them as well.
~LButton::
ControlSend,, {NumPadAdd}, ahk_id %idClone%
Return

// bound to numpadsub that fires a macro
~NumPadSub::
KeyWait, NumPadSub, D
ControlSend,, {NumPadSub}, ahk_id %idClone%
Return

// bound to numpadadd that fires a macro
~NumPadAdd::
KeyWait, NumPadAdd, D
ControlSend,, {NumPadAdd}, ahk_id %idClone%
Return

Would appreciate anyone's input why Interact With Target regardless of the key I choose. Is failing to fire on slave. And again just to clarify the chosen key is being applied to both master and slave keybinds.

Darkreign11
09-13-2012, 05:27 PM
// My AHK file I'm working on

SetKeyDelay, 0, 0
WinGet, wowid, List, World of Warcraft

#IfWinActive, World of Warcraft

; -------------------------------
;Determine Main and Clone Windows
; -------------------------------
WinActivate, ahk_id %wowid1%

MsgBox, 4,, Is this your WOW Main window? (press Yes or No)
IfMsgBox Yes
{
idMain = %wowid1%
idClone = %wowid2%
} else {
idMain = %wowid2%
idClone = %wowid1%
}
; -------------------------------

; -------------------------------
;
; -------------------------------
~Up::
KeyWait Up
ControlSend,, {Up}, ahk_id %idClone%
Return

~LButton::
ControlSend,, {NumPadAdd}, ahk_id %idClone%
Return

~=::
KeyWait =
ControlSend,, {=}, ahk_id %idClone%
Return

~-::
KeyWait, -, D
ControlSend,, {-}, ahk_id %idClone%
Return

~x::
KeyWait, x, D
ControlSend,, {x}, ahk_id %idClone%
Return

~Tab::
KeyWait, Tab, D
ControlSend,, {Tab}, ahk_id %idClone%
Return

~Shift::
KeyWait, Shift, D
ControlSend,, {Shift}, ahk_id %idClone%
Return
; -------------------------------

; -------------------------------
; Numeric Keys + Numpad Keys
; -------------------------------
~1::
KeyWait 1
ControlSend,, {1}, ahk_id %idClone%
Return

~2::
KeyWait 2
ControlSend,, {2}, ahk_id %idClone%
Return

~3::
KeyWait 3
ControlSend,, {3}, ahk_id %idClone%
Return

~4::
KeyWait 4
ControlSend,, {4}, ahk_id %idClone%
Return

~5::
KeyWait 5
ControlSend,, {5}, ahk_id %idClone%
Return

~6::
KeyWait 6
ControlSend,, {6}, ahk_id %idClone%
Return

~7::
KeyWait, 7, D
ControlSend,, {7}, ahk_id %idClone%
Return

~8::
KeyWait, 8, D
ControlSend,, {8}, ahk_id %idClone%
Return

~9::
KeyWait, 9, D
ControlSend,, {9}, ahk_id %idClone%
Return

~0::
KeyWait, 0, D
ControlSend,, {0}, ahk_id %idClone%
Return

~NumPadDiv::
KeyWait, NumPadDiv, D
ControlSend,, {NumPadDiv}, ahk_id %idClone%
Return

~NumPadMult::
KeyWait, NumPadMult, D
ControlSend,, {NumPadMult}, ahk_id %idClone%
Return

~NumPadSub::
KeyWait, NumPadSub, D
ControlSend,, {NumPadSub}, ahk_id %idClone%
Return

~NumPadAdd::
KeyWait, NumPadAdd, D
ControlSend,, {NumPadAdd}, ahk_id %idClone%
Return

~NumPad1::
KeyWait, NumPad1, D
ControlSend,, {NumPad1}, ahk_id %idClone%
Return

~NumPad2::
KeyWait, NumPad2, D
ControlSend,, {NumPad2}, ahk_id %idClone%
Return

~NumPad3::
KeyWait, NumPad3, D
ControlSend,, {NumPad3}, ahk_id %idClone%
Return

~NumPad4::
KeyWait, NumPad4, D
ControlSend,, {NumPad4}, ahk_id %idClone%
Return

~NumPad5::
KeyWait, NumPad5, D
ControlSend,, {NumPad5}, ahk_id %idClone%
Return

~NumPad6::
KeyWait, NumPad6, D
ControlSend,, {NumPad6}, ahk_id %idClone%
Return

~NumPad7::
KeyWait, NumPad7, D
ControlSend,, {NumPad7}, ahk_id %idClone%
Return

~NumPad8::
KeyWait, NumPad8, D
ControlSend,, {NumPad8}, ahk_id %idClone%
Return

~NumPad9::
KeyWait, NumPad9, D
ControlSend,, {NumPad9}, ahk_id %idClone%
Return

~NumPad0::
KeyWait, NumPad0, D
ControlSend,, {NumPad0}, ahk_id %idClone%
Return
; -------------------------------

; -------------------------------
; F Keys
; -------------------------------
~F1::
KeyWait, F1, D
ControlSend,, {F1}, ahk_id %idClone%
Return

~F2::
KeyWait, F2, D
ControlSend,, {F2}, ahk_id %idClone%
Return

~F3::
KeyWait, F3, D
ControlSend,, {F3}, ahk_id %idClone%
Return

~F4::
KeyWait, F4, D
ControlSend,, {F4}, ahk_id %idClone%
Return

~F5::
KeyWait, F5, D
ControlSend,, {F5}, ahk_id %idClone%
Return

~F6::
KeyWait, F6, D
ControlSend,, {F6}, ahk_id %idClone%
Return

~F7::
KeyWait, F7, D
ControlSend,, {F7}, ahk_id %idClone%
Return

~F8::
KeyWait, F8, D
ControlSend,, {F8}, ahk_id %idClone%
Return

~F9::
KeyWait, F9, D
ControlSend,, {F9}, ahk_id %idClone%
Return

~F10::
KeyWait, F10, D
ControlSend,, {F10}, ahk_id %idClone%
Return

~F11::
KeyWait, F11, D
ControlSend,, {F11}, ahk_id %idClone%
Return

~F12::
KeyWait, F12, D
ControlSend,, {F12}, ahk_id %idClone%
Return
; -------------------------------

Khatovar
09-13-2012, 10:42 PM
Do you have Click-to-Move enabled on the slave? Interact with Target requires 3 things to work - 1. Slave needs to assist to aquire a target 2. Interact with Target Keybind 3. Click to Move in order to move to the target for interaction. CtM is located under the Mouse settings in the game menu.

Darkreign11
09-14-2012, 12:04 AM
Do you have Click-to-Move enabled on the slave? Interact with Target requires 3 things to work - 1. Slave needs to assist to aquire a target 2. Interact with Target Keybind 3. Click to Move in order to move to the target for interaction. CtM is located under the Mouse settings in the game menu.

1.
/click JambaFTLAssist


// simple macro that is bound via AHK
~LButton::
ControlSend,, {NumPadAdd}, ahk_id %idClone%
Sleep, 1100
ControlSend,, {NumPadAdd}, ahk_id %idClone%
Return

&

~NumPadAdd::
KeyWait, NumPadAdd, D
ControlSend,, {NumPadAdd}, ahk_id %idClone%
Return

Which allows me to either select a target (keypad +) or select Master target (left click on target)

2. keybind is set to keypad / for both Master & Slave for interaction. When I press / in Master it will interact. When I press / in Slave it will interact. Though the press of / in Master does not fire anything for Slave's use of /.


~NumPadDiv::
KeyWait, NumPadDiv, D
ControlSend,, {NumPadDiv}, ahk_id %idClone%
Return

Checked both Master & Slave and both do have their interact on the correct bind and option.

3. Click to move is enabled for both Master and Slave. I have been playing with movements using Keypad+mouse for Master then just Keypad for Slave.

One thing I am trying to figure as I feel it should still be within Blizzard (WoW) rules. Is finding some way to interact via W A S D.

So far only have a broken function for now with:


~a::
While GetKeyState("a","P") = 1
{
If GetKeyState("a","P") = 1 ;
{
ControlSend,, {a}, ahk_id %idClone%
Sleep, 50
}
}
return

The key will only fire if being interacted upon as in being pressed. The other If was added for a combined conditional. That I am still debating on. Which is to look at a few things like if key and numlock is pressed. I just used If GetKeyState("a","P") as a placeholder to a later numlock check.

Only just started boxing a few days ago. Its fun but a challenge. And would rather my Slave follow a directive of 2 types of movement. W A S D and at times /follow.

Supplied my AHK just for the sake if someone saw an error in my work. Though keybinds are mapped correctly within WoW. And mouse is indeed enabled for the Slave. so I am a little puzzled.

Darkreign11
09-14-2012, 12:23 AM
I found the issue at least with interact with target. I use follow strobe with my mage in questing and dungeons and being mounted. There is no real need for me to have it off. As she can move and cast just fine with me with it on. 2 mages. However standard /follow she'll break to interact with target with /. On followstrobe she will not. A conditional to add there then I feel. Is to maybe predefine some keys that would cause movement from Slaves. And break strobe follow the same way it does for standard /follow.

Would be easier to have it just break strobe follow on its own movement. Then set up one macro to turn strobe on and then another to turn it off. Reason I wanted strobe over standard /follow. One simple reason -heh- .. Blink. Standard /follow breaks upon blink and you have to click /follow again after every blink. With strobe I can cast and blink and do all the wonderful mage things. And not see her lost. So please please if the add-on author is reading. Think about giving strobe a way to break itself like normal /follow does without having to always macro it on and off.

Cptan
09-14-2012, 12:27 AM
Now if I swap one of the working ones that work into interact with target. Then it fails like before

If that is the case, you AHK codes should be working.

This may sounds silly, but can you verify the following

1) Go to slave and press '/'. IWT ok?
2) Still at slave, press enter to show chat panel. Go to master and press '/'. Do you see '/' at slave chat panel?

The purpose is to find out exactly where the problem lies.

Darkreign11
09-14-2012, 03:10 AM
If that is the case, you AHK codes should be working.

This may sounds silly, but can you verify the following

1) Go to slave and press '/'. IWT ok?
2) Still at slave, press enter to show chat panel. Go to master and press '/'. Do you see '/' at slave chat panel?

The purpose is to find out exactly where the problem lies.Thank you kindly for the reply. I found the issue. It was with follow strobe.

Test:
use /follow on a character
use interact with target keybind

Result:
breaks follow to interact with target

Test:
use follow strobe on a character
use interact with target keybind

Result:
Fails to break follow for interaction on target

Suggested Result:
Follow strobe should have a option to selecting certain keys to watch for. That when it encounters them it'll break follow strobe. To allow the following action to occur. For example I am currently using numpaddiv for interaction with target. Would be nice to have Jamba allow me to customize a few keys to watch for, to break follow strobe.

Short version: Follow strobe should interact in a similar manner to Blizzards /follow. Which breaks follow on certain keybinds.

MiRai
09-14-2012, 03:35 AM
Short version: Follow strobe should interact in a similar manner to Blizzards /follow. Which breaks follow on certain keybinds.
Uhhh...

If JAMBA's Follow Strobe acted like Blizzard's Follow... it would just be called 'Follow' and wouldn't need to even be there.

Darkreign11
09-14-2012, 12:56 PM
Uhhh...

If JAMBA's Follow Strobe acted like Blizzard's Follow... it would just be called 'Follow' and wouldn't need to even be there.Not in full capacity over keybind break capacity. To break it down, Sir.

"Follow strobe should interact in a similar manner to Blizzards /follow. Which breaks follow on certain keybinds."

States in no way, shape, or form that it is to be exactly like Blizzard's follow hence the word "similar" was used. And where that similarity begins & ends is where Jamba and Blizzard's should have this in common, "breaks follow on certain keybinds". Hope that clarifies better.

In that when a keybind is used it can still engage as normal under /follow and it will break /follow to do it.
Currently if a keybind is used under Jamba's follow strobe. Jamba enforces its rules regardless and will not break for the keybind being used.

I can understand enforcing itself under many other conditions. Though a keybind usually is telling a program "Its okay, I know what I am doing. Please let me do it." That is why and only then should Jamba's follow break, in a sense saying "Okay letting you do your thing".

/follow takes only one action to complete interactions, two if you count having to turn /follow on. (on, keybind to interact (breaks follow) )
follow strobe currently takes two actions to complete interactions, three if you count having to turn it on. (on, keybind to break follow, keybind to interact)

Overall Jamba's follow strobe is very nice. On my mages for example /follow breaks when they blink. Jamba's follow strobe will not. I was only mentioning a suggestion to letting the follow strobe being willfully broken on designated keybinds so certain actions are not overwritten. Otherwise one must macro a off state and then a on state. For example go turn in a quest. Press keybind to turn strobe off, press keybind to turn quest in, press keybind to turn strobe on. All my suggestion would be for is for it to notice as said before for certain keybinds to break on. Then there is no need to press a keybind to turn it off. Rather only designate keybinds that Jamba is to look for, that will automatically break follow strobe. Just intuitiveness on the programs part.

Of many things to code. I wouldn't think this would be a hard suggestion to include. Given all it would need is a way to gather the keybinds you want it to look for. Then to tell itself to turn follow strobe off when those keybind conditions are met.

Khatovar
09-15-2012, 01:35 AM
Of many things to code. I wouldn't think this would be a hard suggestion to include. Given all it would need is a way to gather the keybinds you want it to look for. Then to tell itself to turn follow strobe off when those keybind conditions are met.


If you want Jamba strobing to turn off, then turn it off. If you can designate keybinds that you want to trigger to turn off Jamba Strobe, which is ONLY going to turn off the strobing, not break follow, then you can also add the slash command to those keybinds yourself to turn off the strobing /jamba-follow strobeoff all.

For example, you don't have anything going on on your main when you're triggering /assist for your slave, so stick a macro for /jamba-follow strobeoff all on that keybind for your main.

You may not think it's a big deal, but you aren't the person who has to make sure that is working all the time. Jafula is still playing catchup to stomp all the bugs that cropped up with 5.0.4

aasi888
09-15-2012, 10:51 AM
~a::
While GetKeyState("a","P")
{
If GetKeyState("a","P") = 1 ;
{
ControlSend,, {a}, ahk_id %idClone%
Sleep, 50
}
}
return
I thought clickers were not allowed in wow? Is this true? This kind of keyspam might be easily detected since the constant 50ms delay.

Khatovar
09-16-2012, 02:50 AM
~a::
While GetKeyState("a","P")
{
If GetKeyState("a","P") = 1 ;
{
ControlSend,, {a}, ahk_id %idClone%
Sleep, 50
}
}
return
I thought clickers were not allowed in wow? Is this true? This kind of keyspam might be easily detected since the constant 50ms delay.

I don't know what that code does, but delays and loops are not allowed.