Auto Hotkey Help
#1
Posted 22 September 2013 - 09:55 AM
The script I am using:
#InstallMouseHook
#InstallKeybdHook
Numpad6::
{
Send t
Sleep 50
Send Greetings from Clan Foo, http://bar.enjin.com/home
Sleep 50
Send {Enter}
}
return
Any suggestions would be appreciative
--WW
#2
Posted 22 September 2013 - 07:40 PM
Numpad6::
{
send, {t}
sleep, 25
SendRaw Greetings from Clan Foo, http://bar.enjin.com/home
sleep, 25
Send, {Enter}
}
return
Edited by kuangmk11, 22 September 2013 - 07:42 PM.
#3
Posted 23 September 2013 - 07:48 AM
Thx
--WW
#4
Posted 23 September 2013 - 11:56 AM
If only people used these things for quickshouts like "lights go to theta", "Enemy lance spotted at lower city", "Return to base, nobody is going back and I'm too slow" or something like that.
#5
Posted 23 September 2013 - 12:21 PM
#6
Posted 23 September 2013 - 12:51 PM
RadioKies, on 23 September 2013 - 11:56 AM, said:
If only people used these things for quickshouts like "lights go to theta", "Enemy lance spotted at lower city", "Return to base, nobody is going back and I'm too slow" or something like that.
I do.
http://pastebin.com/3uHPUKER
#7
#8
Posted 23 September 2013 - 05:18 PM
Winterwolf, on 23 September 2013 - 07:48 AM, said:
I looked into it a little. The problem I found is that I had to use the scan code for numpad6 to get it to register in the game. if you bind your chat key to something like F5 you can use it in the beginning and end "lobbys" without it putting the 't' in front of the message.
try this:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. #Warn ; Recommended for catching common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #SingleInstance Force #InstallKeybdHook SC04D:: { BlockInput, On SetCapsLockState, off send, {t} sleep, 25 SendRaw Hello World http://mwomercs.com/forums sleep, 25 Send, {Enter} BlockInput, Off } return
#9
Posted 23 September 2013 - 06:02 PM
#10
Posted 24 November 2013 - 05:27 PM
Looking for some help with an Autohotkey key-bind.
I'm trying to get the WheelLeft/WheelRight buttons (left and right tilt on my scroll-wheel) to work in MWO to fire weapon groups 5 and 6. Below is what I've got so far:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
________
#InstallMouseHook
#InstallKeyBDHook
#IfWinActive MechWarrior Online
SetKeyDelay, 0
WheelLeft::Send {5 down}
Sleep, 0
Send {5 up}
return
WheelRight::6
_______
Both options work and fire the desired weapon-groups, but both also cause the weapon to keep firing as if the 5/6 button were being held down. Also, if I hit 5 or 6 while the weapon is constant-firing, the firing stops and the script seems to reset (pressing the WheelLeft/WheelRight again doesn't have any effect). Is that clear and understandable? It might work fine for a TAG toggle, but not for missiles or a backup alpha. I have tried a few fixes, but have had no luck. Anyone have any ideas?
#11
Posted 05 December 2013 - 03:52 AM
I recommend the following lines in your code:
SendMode, Event
SetKeyDelay, 0, 50
You should then not need to send the down, sleep then send the up.
Also, when declaring hotkeys in AHK, you should probably prefix them thus:
*WheelLeft::
Send {5}
return
The * tells the hotkey to work in any combination, so if holding it in combination with other keys, it would still fire.
I have no idea what the point of a Sleep 0 is, maybe it sleeps indefinitely. That could be the source of weirdness in your code.
With regards to a chat macro, I have already written one and posted it on GitHub.
It uses my ADHD macro writing library, which makes writing AHK macros with a GUI very easy.
#12
Posted 05 December 2013 - 04:02 AM
WheelLeft up::
; this code will never fire.
return
Also:
Also, this code is probably not doing what you think it is:
SetKeyDelay, 0
WheelLeft::Send {5 down}
Sleep, 0
Send {5 up}
return
the line "WheelLeft::Send {5 down}" is bad.
When you declare the binding on one line like that, that is the hotkey.
The rest of the lines (Sleep, 0 etc) are not part of the hotkey!
instead you would want:
SetKeyDelay, 0
WheelLeft::
Send {5 down}
Sleep, 0
Send {5 up}
return
Which, as I mentioned before, should be this anyway:
SetKeyDelay, 0, 50
*WheelLeft::
Send {5}
return
Edited by evilC, 05 December 2013 - 04:05 AM.
#13
Posted 06 December 2013 - 12:33 PM
___
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#InstallMouseHook
#InstallKeyBDHook
#IfWinActive MechWarrior Online
SendMode, Event
SetKeyDelay, 0, 50
*WheelLeft::
Send {6}
return
*WheelRight::
Send {5}
return
___
I now have weapon groups 5 and 6 on my mouse where they belong, perfect for a last-ditch alpha or for LRMs. Thanks for the help.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users