Edited by Koniving, 03 June 2013 - 11:23 AM.
Auto Hotkey Help For Macro Users.
#1
Posted 31 May 2013 - 02:45 PM
#2
Posted 31 May 2013 - 03:04 PM
Admittedly, I just gave up and made mouse macros (gaming mouse)instead, but I'm quite proficient with AHK.
#3
Posted 31 May 2013 - 03:08 PM
Wintersdark, on 31 May 2013 - 03:04 PM, said:
Admittedly, I just gave up and made mouse macros (gaming mouse)instead, but I'm quite proficient with AHK.
You don't know how to assign the macro to run when pressing a specific key?
I'm hoping someone knows that.
Unfortunately I'm totally new to macros. I don't like it being on the middle mouse button. I have a new 3 AC/2, LB-10, twin MG Jager. I can't use left/right mouse + middle at the same time.
Edited by Koniving, 31 May 2013 - 03:44 PM.
#4
Posted 31 May 2013 - 04:22 PM
#5
Posted 31 May 2013 - 05:49 PM
MButton::
This line means everything after the '::' will run when everything before it is pressed. In this case 'MButton' refers to the middle mouse button. You can find a total list of keys AHK will use here. For instance, if we wanted to change it to 'V', we'd type:
v::
For Alt we'd use on of these for Either, Left or Right Alt respectively:
Alt:: LAlt:: RAlt::
You can also combine keys by listing them together or after each other:
vb:: // This triggers when both V and B are pressed together. V:: B:: // This triggers when either V or B are pressed.
One final part for this line is modifiers. In other words allowing the code to detect Shift+V, Alt+V and Ctrl+V or any combination of them. The idea is to add a special character (or any combination of them) to the begining of the line. The characters are all here, but I'll list the most important.
! = Alt ^ = Control + = Shift
To use them you'd put something like this (for Ctrl+Shift+V):
^+V::
The other part you'll need to change is in the line directly below the last one.
while GetKeyState("MButton","P")
This states that anything between the '{ }' will repeat for as long as the 'MButton' is 'P'ressed. You'll notice that the speechmarked text is the same as the button that triggers the macro. Change that to the driving key,so V or Alt or whatever you choose. Don't however put any modifiers in.
So for the Ctrl+Shift+V key, you'd want:
^+V:: while GetKeyState("V","P")
I will now give one word of warning. AHK will capture any keys you hotkey. This will stop MWO from knowing that the key was ever pressed. Don't stick the macro on anything you want MWO to access as well. This includes when typing in ingame chat. Don't want the V key to start inputting characters into the chat bar.
You can somewhat cirumvent this by using the ~ modifier. This will allow MWO to access the keypress / release events as well as AHK, but the macro will still trigger regardless.
I can post an AHK script that will allow macros to avoid this flaw if you want.
Edited by Mr Friday, 31 May 2013 - 05:52 PM.
#6
Posted 31 May 2013 - 08:29 PM
The significant difference is that F1 has replaces both instances of MButton, so this will trigger on a press of F1 instead of the middle mouse button. See Mr. Friday's post for more detail on what can be used as a trigger.
The other change is the addition of "#IfWinActive ahk_class CryENGINE"
That tells AHK to only apply the following macros to Mechwarrior Online, so it won't interfere with other programs.
#8
Posted 01 June 2013 - 11:20 AM
Both of these use Left CTRL, which is also mouse button under my ring finger.
I use this for the LB10, MG, AC/2 Jager. It's set to fire the AC/2s in groups 3, 4, and 5. My Shotgun fires on group 1, and the MGs are in the comfortable to hold group 2.
This second one I use in the new AC/5, AC/2 build I run, which evolved from an UAC/5 AC/2 build. This one is rigged to fire slower to compensate for heat issues.
Videos of results will be posted sometime today!
Edited by Koniving, 03 June 2013 - 08:13 AM.
#9
Posted 01 June 2013 - 11:31 AM
#10
Posted 01 June 2013 - 12:08 PM
SetTitleMatchMode, 2 DetectHiddenWindows, On #IfWinActive MechWarrior Online
An alternative to the "ahk_class CryEngine" restrictor that only targets MWO instead of all CryEngine games.
Full script~
#11
Posted 01 June 2013 - 12:36 PM
Twin AC/2, twin AC/5 rig. Build info coming soon. (Second Vid Added)
Caustic Valley Fire Support Lance.
More in spoiler!
LB10, 3 AC/2, twin MG rig. Build info coming soon.
Taken before the macro was fixed.
Note multiple videos will be provided for both builds.
Edited by Koniving, 04 June 2013 - 06:59 PM.
#12
Posted 02 June 2013 - 05:02 PM
SendMode Input #InstallMouseHook #InstallKeyBDHook WheelUp:: Send {z } return WheelRight:: Send {5 } return WheelLeft:: Send {6 } return
It works in notepad but not in MWO.
#13
Posted 02 June 2013 - 05:05 PM
Mr Friday, on 01 June 2013 - 12:08 PM, said:
SetTitleMatchMode, 2 DetectHiddenWindows, On #IfWinActive MechWarrior Online
An alternative to the "ahk_class CryEngine" restrictor that only targets MWO instead of all CryEngine games.
Hawt. Probably the title match mode there that fixes it. I'd originally used Mechwarrior Online with the window title, but it was very inconsistent - would work sometimes, and not others, so I just went to window class (as I'm not playing other CryEngine games) which has worked quite a bit better for me.
Why detecthiddenwindows?
Also, having T or Y toggle a chat variable is pretty clever, I hadn't even considered it. Would remove the necessity to tap backspace very quickly to toggle chainfire without double-toggling it
#14
Posted 02 June 2013 - 05:08 PM
DireBloodWolf, on 02 June 2013 - 05:02 PM, said:
It works in notepad but not in MWO.
I'm still working on why this is, but it *seems* to me that you can only load one script with keybd/mouse hooks. After a boot, I can load autohotkey and a script, and it'll work fine in MWO. However, if I start editing the script, closing the existing instance and reloading it, the script will no longer work in MWO (though it WILL work elsewhere without a #ifwinactive lock). Could be a matter of having the script already running before launching MWO, too. I'm not really sure, but I know I frequently have issues where my AHK scripts just won't function in MWO but will function outside just fine, as if I didn't have the keybd/mouse hooks in there.
#15
Posted 02 June 2013 - 06:58 PM
However I never put in anything checking to see if there's a specific program running or anything of the sort. I confess I haven't put those lines in.
#16
Posted 03 June 2013 - 07:26 AM
Koniving, on 02 June 2013 - 06:58 PM, said:
However I never put in anything checking to see if there's a specific program running or anything of the sort. I confess I haven't put those lines in.
Yeah, even without those lines, AHK is very inconsistent for me in MWO. Works fine in everything else, but in MWO... It's unreliable. Quite frustrating, really - I suspect Windows 8 has a role in my troubles (because it often does) but I've been unable to reliably reproduce the problems. It *always* works in everything else, and just sometimes works in MWO... but it seems almost random. Frustrating.
#17
Posted 03 June 2013 - 07:34 AM
Edited by Koniving, 03 June 2013 - 07:34 AM.
#18
Posted 03 June 2013 - 07:47 AM
Koniving, on 03 June 2013 - 07:34 AM, said:
Yeah. I always run AHK as admin, or it won't work at all with most programs.
Edited by Wintersdark, 03 June 2013 - 07:47 AM.
#19
Posted 03 June 2013 - 07:54 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users