AutoHotkey Community

It is currently May 27th, 2012, 5:54 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: September 8th, 2010, 11:57 am 
Offline

Joined: November 22nd, 2008, 9:52 pm
Posts: 44
I wanted to make a simple script for a game but when I'm at the game and I press 1 the script just .. doesnt start (even when I open the history there is nothing .. as if I haven't pressed 1). Any ideas ?
(http://grandchase.ntreev.net - the game)
Code:
1::
Send Z
Send Z
Send Z
Send Z
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2010, 12:02 pm 
Offline

Joined: August 8th, 2010, 9:29 am
Posts: 47
Location: is autohotkey Chicken ribs or chicken back?absolutely chicken back!
try this

Code:
Numpad1::
Send Z
Send Z
Send Z
Send Z
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2010, 12:09 pm 
Offline

Joined: November 22nd, 2008, 9:52 pm
Posts: 44
I am not sure it's they start key itself ... 1 works just fine at notepad and such


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

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
me10c wrote:
I am not sure it's they start key itself ... 1 works just fine at notepad and such

Hi me10c, welcome to the forum.

Some games capture the keyboard when they are active and ignore or suppress AutoHotkeys. :cry:

A possible answer is to install a lower level keyboard hook so that AHk 'sees' you keys.
You put this command once at the top of your script. Please read here:
http://www.autohotkey.com/docs/commands ... bdHook.htm

A related command is here. As a newbie the differences are probably hard to understand http://www.autohotkey.com/docs/commands/_UseHook.htm

p.s. As you have learned, it is a good idea to test scripts with notepad (if possible)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2010, 4:46 pm 
Offline

Joined: November 22nd, 2008, 9:52 pm
Posts: 44
Code:
#UseHook
1::
GoSub, Zs
return
#usehook off

Zs:
send z
send z
send z
send z
return

It does recognize the 1, but when it send the Zs, the game still does not recognize them ...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2010, 8:13 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
me10c wrote:
It does recognize the 1, but when it send the Zs, the game still does not recognize them ...


>>It does recognize the 1
I can't understand, how you can tell that it, whatever "it" is, recognizes the 1.

Two suggestions, performed separately.
1. replace your "gosub" statement with a "msgbox" statement
this tests that the "1" is actually getting to AHk

2. read up on the details of how AHk interacts with games
http://www.autohotkey.com/docs/commands/Send.htm
perhaps "sendplay" would work better in your game


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2010, 8:24 pm 
Offline

Joined: November 22nd, 2008, 9:52 pm
Posts: 44
.. I can tell if it recognizes 1 when I double click the icon in the tray after I press 1 .. If there is "send z, send z .etc etc" the 1 was recognized and it started the Zs.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 8th, 2010, 8:38 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
Quote:
perhaps "sendplay" would work better in your game
SendPlay is usualy tried if SendInput and Send(Event) don't work. I would try SendInput first.

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


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

Joined: November 22nd, 2008, 9:52 pm
Posts: 44
Meh ... I'll just spam the Z with my finger (SendInput, SendEvent and SendPlay do not work either)


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, batto, Bing [Bot], dra, HotkeyStick, mKnight, rbrtryn, XstatyK, Yahoo [Bot] and 61 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