help with auto hotkey
Posts: 8
1: protect my chat
2: how to click one button to shoot out a sentence within the chat.
3: cycle through idle units using the mouse wheel (partially because I don't know how to do that in the first place).
a big thanks for any help. its much appreciated!
#IfWinActive, Company Of Heroes 2
w::up
s::down
a::left
d::right
q::numpad0
+q::q
+w::w
+e::e
+r::r
Posts: 221
if you wanne say things with the click of one button (actually 2 to open chat )
you have to do this
->
Numpad1:: send, Hey, hf
(for some reasson he can't just say what he has to say but the >send< should be on the >:<) (like w::r no space left between) (i hope you know what i mean)
everything after 'send,' will normally be said it doesn't matter if you put a ',' you'll have to figure out what works and what doesn't.
you can change numpad or the text behind it to whatever you want. this is just what i think i use .
for the mousewheel, you just have to switch the button for 'iddle units'(just go above the button and normally it will show what you need to press, if it has a hotkey) to the key of ahk for mousewheels (could be named xbuttonmiddle for instance) (for the buttons on the side of your mouse it is xbutton1,2... and so on. that i know for sure)
for instance, lets say 'switch to iddle units' is button 'x' for coh2, and mousewheel is button 'xbuttonm' for ahk
->
x::xbuttonm
you can do things like making it so that you only use it when capslock is on and so on...
just go look a bit up on ahk and you'll find it. it isn't much work if you really want it.
btw i don't know what you mean by 'protect my chat'
anyways gl!
Posts: 823 | Subs: 3
So I downloaded ahk a few weeks ago, and I have tried to do some research on it. and there are changes that I want to make but don't know how. like:
1: protect my chat
2: how to click one button to shoot out a sentence within the chat.
3: cycle through idle units using the mouse wheel (partially because I don't know how to do that in the first place).
a big thanks for any help. its much appreciated!
#IfWinActive, Company Of Heroes 2
w::up
s::down
a::left
d::right
q::numpad0
+q::q
+w::w
+e::e
+r::r
A small hint, you could put q::u , thats how you can move back your tanks easily. This was one of the best changes i did for myself imo!
Posts: 8
hey,
if you wanne say things with the click of one button (actually 2 to open chat )
you have to do this
->
Numpad1:: send, Hey, hf
(for some reasson he can't just say what he has to say but the >send< should be on the >:<) (like w::r no space left between) (i hope you know what i mean)
everything after 'send,' will normally be said it doesn't matter if you put a ',' you'll have to figure out what works and what doesn't.
you can change numpad or the text behind it to whatever you want. this is just what i think i use .
for the mousewheel, you just have to switch the button for 'iddle units'(just go above the button and normally it will show what you need to press, if it has a hotkey) to the key of ahk for mousewheels (could be named xbuttonmiddle for instance) (for the buttons on the side of your mouse it is xbutton1,2... and so on. that i know for sure)
for instance, lets say 'switch to iddle units' is button 'x' for coh2, and mousewheel is button 'xbuttonm' for ahk
->
x::xbuttonm
you can do things like making it so that you only use it when capslock is on and so on...
just go look a bit up on ahk and you'll find it. it isn't much work if you really want it.
btw i don't know what you mean by 'protect my chat'
anyways gl!
Posts: 8
Posts: 823 | Subs: 3
it must be
UP::w
DOWN:
LEFT::a
RIGHT:d
then you need to use those replacements to write!
When i used AHK you could deactivate the script, but doing that ingame is too much time, so i would just get used to use up as w etc.
Posts: 8
Do you know the Program Celo? It can create a full autohotkey script for you! Company of Elo on Google, you should find a link to this website where it's linked.
it must be
UP::w
DOWN:
LEFT::a
RIGHT:d
then you need to use those replacements to write!
When i used AHK you could deactivate the script, but doing that ingame is too much time, so i would just get used to use up as w etc.
Posts: 8
Posts: 823 | Subs: 3
Im have the worst time trying to find where the program is executable from.. Im sorry im not tech savy. Do happen to know what im looking for. I thought maybe a short cut. But then the only thing i could think of was the actual fire desination is but thats not it ether. Nothing has been moned so its standard setup as far as location. Do you know where to look?
Which Program do you mean? AHK or Celo?
https://www.coh2.org/topic/18454/celo-company-of-elo --> The download link in this thread! Then you can create a AHK script with it. It's how i did it !
Posts: 8
im talking about celo, I have the program but in the "essential settings" (the first time you use it) I cant find where the program is executable. figure im looking for an exe. file but its no where to be found. I feel really dumbfounded. I looked in all the coh2 folders tried steam. I just don't understand.
Which Program do you mean? AHK or Celo?
https://www.coh2.org/topic/18454/celo-company-of-elo --> The download link in this thread! Then you can create a AHK script with it. It's how i did it !
Posts: 2885
Do you know the Program Celo? It can create a full autohotkey script for you! Company of Elo on Google, you should find a link to this website where it's linked.
it must be
UP::w
DOWN:
LEFT::a
RIGHT:d
then you need to use those replacements to write!
When i used AHK you could deactivate the script, but doing that ingame is too much time, so i would just get used to use up as w etc.
You should be able to use a variable in your script to disable key bindings between one press of enter key and another.
Posts: 823 | Subs: 3
im talking about celo, I have the program but in the "essential settings" (the first time you use it) I cant find where the program is executable. figure im looking for an exe. file but its no where to be found. I feel really dumbfounded. I looked in all the coh2 folders tried steam. I just don't understand.
Seems like an issue i cant help you out with either , im sorry!
Posts: 823 | Subs: 3
You should be able to use a variable in your script to disable key bindings between one press of enter key and another.
Then explain it to OP! Because i got no Idea how to!
Posts: 2439 | Subs: 6
Posts: 2885
Then explain it to OP! Because i got no Idea how to!
Sure thing. Here is a simple example showing how to replace a with b, that should not be active during in-game chat:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#ifWinActive Company Of Heroes 2
Enter::
chatMode := !chatMode
Send {Enter}
Return
Numpad9:: ;Just so you can change the state if it goes wrong
chatMode := !chatMode
Return
$a::
if(chatMode) {
Send a
} else {
Send b
}
Return
@OP I used numpad9 as additional switch in case it starts to work the other way round, couse enter always opens a chat window. It might be needed if you hide the chat window with some other key like escape.
Posts: 8
Posts: 221
by protect my chat I mean when I'm in game and I have to type the keys I use to move. i.e., wasd it wont type for me at all so I cant really get my message out. that's what I mean. guess I shouldn't of been so vague lol but thankyou
as i said, using caps could be your solution. i use it aswel, just caps on when i play caps of when i type. this is my solution to that.
type this under coh2myactive shiet
~CapsLock:uspend, % GetKeyState("CapsLock","t") ? "Off" : "On"
nvm i read things from ferwiner and it's way better i never took so much time in to ahk that i found that thx aswel ferwiner
Posts: 2885
as i said, using caps could be your solution. i use it aswel, just caps on when i play caps of when i type. this is my solution to that.
type this under coh2myactive shiet
~CapsLock:uspend, % GetKeyState("CapsLock","t") ? "Off" : "On"
nvm i read things from ferwiner and it's way better i never took so much time in to ahk that i found that thx aswel ferwiner
I'm glad to help
Btw, the CapsLock solution has the advantage of giving a clear indicator showing whether your key bindings are on or off. To get the best of both worlds, while keeping the ability to write caps, use ScrollLock for state instead of a variable and either SetScrollLockState or Send {ScrollLock} under the Enter binding to change the state when you enter the chat. I prefer scroll lock over caps lock becouse it doesn't have a function in coh2.
Something like this:
#ifWinActive Company Of Heroes 2
;#this should run only once when you run the whole script
;#the state of "first" variable is reversed, but I didn't come up with a better name
if(!first){
SetScrollLockState, On
first := !first
}
Enter::
Send {Enter}
Send {ScrollLock}
Return
$a::
if(GetKeyState("ScrollLock", "T")) {
Send b
} else {
Send a
}
Return
Now you can see that hotkeys are on when the light is on. You can also spare the numpad9 button for something else couse you can switch the wrong state with the scroll lock button.
Posts: 221
I'm glad to help
Btw, the CapsLock solution has the advantage of giving a clear indicator showing whether your key bindings are on or off. To get the best of both worlds, while keeping the ability to write caps, use ScrollLock for state instead of a variable and either SetScrollLockState or Send {ScrollLock} under the Enter binding to change the state when you enter the chat. I prefer scroll lock over caps lock becouse it doesn't have a function in coh2.
Something like this:
#ifWinActive Company Of Heroes 2
;#this should run only once when you run the whole script
;#the state of "first" variable is reverted, but I didn't come up with a better name
if(!first){
SetScrollLockState, On
first := !first
}
Enter::
Send {Enter}
Send {ScrollLock}
Return
$a::
if(GetKeyState("ScrollLock", "T")) {
Send b
} else {
Send a
}
Return
Now you can see that hotkeys are on when the light is on. You can also spare the numpad9 button for something else couse you can switch the wrong state with the scroll lock button.
damn i should've donne it that way with the scrolllock, never thought of it. thx again ferwiner!
i have one question tho, is it possible to make a hotkey so it opens chat and directly types '/L' to leave? like would it be like -> numpad2::enter send, /l
i have no idea
EDIT: i have found a way to do it, but if you have a better way, then tell me. this is my way ->
numpad3::
send {enter 1}
send, /l
send {enter 1}
Posts: 1614 | Subs: 3
$Wheeldown::
SendInput {LAlt down}
BlockInput MouseMove
SendInput {.}
SendInput {LAlt up}
BlockInput MouseMoveoff
return
Also, instead of rebinding WASD, you could do something like this:
Space & w::Up
Space & a::Left
Space & s:: Down (without space, chat turns it into smiley)
Space & d::Right
This means WASD functions as arrow keys as long as you hold SPACE
Livestreams
6 | |||||
853 | |||||
14 | |||||
6 | |||||
5 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.831222.789+37
- 2.594215.734+9
- 3.34957.860+14
- 4.1101614.642+2
- 5.305114.728+1
- 6.916405.693-2
- 7.273108.717+24
- 8.721440.621+3
- 9.1041674.607-2
- 10.17146.788+1
Replay highlight
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Board Info
8 posts in the last week
37 posts in the last month
Welcome our newest member, dreilandechode
Most online: 2043 users on 29 Oct 2023, 01:04 AM