AutoHotkey Community

It is currently May 26th, 2012, 9:41 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: September 19th, 2009, 7:43 pm 
I have a g15 keyboard, macro keys work great for any game including Crossfire (aka combatarms engine CS clone) but when using AHK and its different methods of sending keystrokes, nothing seems to work. The reason I care is because I want to set my friend up with the same macros I have on my g15 without using a g15 keyboard.

I've found one thread on Combat arms using the search function, but I'm not sure what he is saying...
http://www.autohotkey.com/forum/topic39 ... ombat+arms

here's an example of a script that will not work.
capslock::
sendPlay {t down}
sleep 20
sendPlay {t up}
sleep 20
sendPlay {t down}
sleep 20
sendPlay {t up}
sleep 2000

I've seen a compiled program on the internet that works for the left mouse button on Combatarms (same engine) but I don't know if you can extract the script from the exe or not. I'd like to know how one would go about using macros in games with this engine.

Any help appreciated, thanks for reading!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 19th, 2009, 7:44 pm 
Offline

Joined: September 19th, 2009, 7:34 pm
Posts: 4
Err, I wasn't logged in so I can't edit the thread title anymore to be more descriptive.. I'm not used to phpBB sorry

[Title edited. ~jaco0646]
If you'd like it to say something different, PM me.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 19th, 2009, 9:43 pm 
Offline

Joined: August 14th, 2009, 2:40 pm
Posts: 237
Location: Finland
Try using "Send" instead of "SendPlay" and put these two lines at the top of the script:

Code:
SendMode Input
SetKeyDelay, 50, 50


If that doesn't work, fiddle with the two numbers (try anything from 10 to 500, with 500 being really extreme). If nothing seems to work, try removing the SendMode command.

Games are very tricky sometimes. The *ONLY* way I've been able to make AHK work with H.A.W.X, is to make sure I *don't* have sendmode set anywhere, and be sure setkeydelay is set at 50, 50. On one other game, I must be sure sendmode is set to Input (nothing else works) and that keydelay is over 75, but under 150.

Yes, pain in the ass to find that one out.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 19th, 2009, 10:17 pm 
Offline

Joined: September 19th, 2009, 7:34 pm
Posts: 4
AnttiV wrote:
Try using "Send" instead of "SendPlay" and put these two lines at the top of the script:

Code:
SendMode Input
SetKeyDelay, 50, 50


If that doesn't work, fiddle with the two numbers (try anything from 10 to 500, with 500 being really extreme). If nothing seems to work, try removing the SendMode command.

Games are very tricky sometimes. The *ONLY* way I've been able to make AHK work with H.A.W.X, is to make sure I *don't* have sendmode set anywhere, and be sure setkeydelay is set at 50, 50. On one other game, I must be sure sendmode is set to Input (nothing else works) and that keydelay is over 75, but under 150.

Yes, pain in the ass to find that one out.


Like this?
Code:
SendMode input
SetKeyDelay, 1000, 1000

capslock::
send {t down}
sleep 20
send {t up}
sleep 20
send {t down}
sleep 20
send {t up}
sleep 2000


even like that, I have only a 20ms delay between each key, almost unnoticable. Am I going about this wrong?


Edit: think I got it working, removed the first line. Thank you!!!!
Edit: Wondering if anyone knows, why does the script cancel out when you press any other key? I have to keep tapping Capslock to keep the script going, if I just hold down caps lock to keep it going then it will be canceled out by another keystroke.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 20th, 2009, 8:31 pm 
Offline

Joined: September 19th, 2009, 7:34 pm
Posts: 4
Okay, so this seems to be strange. The only way I can get it to work is by reloading the script over and over again until the game picks up on it or it somehow bypasses some sort of blocking feature.. For example, I load the script once, doesn't work, try again and it works. The second attempt it took 12 times reloading the script to get it to work in the game.

Anyone ever had this problem? Any possible solutions? The previous poster told me to put Input as the sendmode at the top of the script, but this prevents the Keydelay time from working, as the guide for Autohotkey confirms.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 20th, 2009, 9:04 pm 
Offline

Joined: August 14th, 2009, 2:40 pm
Posts: 237
Location: Finland
Try this:

Code:
SendMode Input

capslock::
Send, {t down}
Sleep, 20
Send, {t up}
Sleep, 20
Send, {t down}
Sleep, 20
Send, {t up}
Sleep, 2000
return


(Also, what is the point of the last Sleep command?)

Or then you could just simply try:

Code:
SetKeyDelay, 100, 100

capslock::
Send, tt
Sleep, 2000
return


I don't really know if it matters that it's the capslock and not any other button. Try using F7 for example, in place of capslock.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 20th, 2009, 10:44 pm 
Offline

Joined: September 19th, 2009, 7:34 pm
Posts: 4
AnttiV wrote:
Try this:

Code:
SendMode Input

capslock::
Send, {t down}
Sleep, 20
Send, {t up}
Sleep, 20
Send, {t down}
Sleep, 20
Send, {t up}
Sleep, 2000
return


(Also, what is the point of the last Sleep command?)

Or then you could just simply try:

Code:
SetKeyDelay, 100, 100

capslock::
Send, tt
Sleep, 2000
return


I don't really know if it matters that it's the capslock and not any other button. Try using F7 for example, in place of capslock.

yeah no luck with higher delays, with return or having the keystrokes TT instead of tdown tup tdown tup.

it works in any program file, but when it comes to crossfire it only works maybe 15percent of the time, requiring you to reload the script continuously until it works. I'd normally not care, but it seems to be only ME it works for, my friend reports it not working at all, even if he reloads the script 20 times.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, JSLover, patgenn123, rbrtryn, virpara and 58 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group