AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Game macros & g15 keyboard

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Crossfire jump script
Guest





PostPosted: Sat Sep 19, 2009 6:43 pm    Post subject: Game macros & g15 keyboard Reply with quote

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/topic39880.html&highlight=combat+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!
Back to top
Naka



Joined: 19 Sep 2009
Posts: 4

PostPosted: Sat Sep 19, 2009 6:44 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
AnttiV



Joined: 14 Aug 2009
Posts: 237
Location: Finland

PostPosted: Sat Sep 19, 2009 8:43 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Naka



Joined: 19 Sep 2009
Posts: 4

PostPosted: Sat Sep 19, 2009 9:17 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Naka



Joined: 19 Sep 2009
Posts: 4

PostPosted: Sun Sep 20, 2009 7:31 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
AnttiV



Joined: 14 Aug 2009
Posts: 237
Location: Finland

PostPosted: Sun Sep 20, 2009 8:04 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Naka



Joined: 19 Sep 2009
Posts: 4

PostPosted: Sun Sep 20, 2009 9:44 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group