Jump to content

Age of Conan - Keystroke to Inactive Window


Recommended Posts

I am trying to send a key to Age of Conan when it is an inactive window. However, I have used the Window Info program to get the title (Age of Conan) and there isn't a controlID so I'm using this command:

ControlSend ( "Age of Conan", "", "", "{c}")

However, it does not send the c keystroke to the program. Any help would be appreciated!

Link to comment
Share on other sites

  • Replies 45
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Seems to be specific with AutoIT. I can use other macro programs to send keystrokes to AoC when it is the active window but AutoIT won't send a keystroke if it's ControlSend() or Send() and active.

Link to comment
Share on other sites

I am trying to send a key to Age of Conan when it is an inactive window. However, I have used the Window Info program to get the title (Age of Conan) and there isn't a controlID so I'm using this command:

ControlSend ( "Age of Conan", "", "", "{c}")

However, it does not send the c keystroke to the program. Any help would be appreciated!

That in NOT a "c keystroke", it should be something like this:

ControlSend ( "Age of Conan", "", "", "c")
Link to comment
Share on other sites

That in NOT a "c keystroke", it should be something like this:

ControlSend ( "Age of Conan", "", "", "c")

ok. I had seen examples with the brackets which is why I used it. I just tried

ControlSend ( "Age of Conan", "", "", "c")

No luck.

However,

Send ("c")

did work when it was the active window.

Edited by KaJe
Link to comment
Share on other sites

Open the helpfile and read about send, the brackets are for "specialbuttons" and not letters.

Oh ok. Thanks for the recommendation. Any idea on why the controlsend might not be working when send is?

Link to comment
Share on other sites

Oh ok. Thanks for the recommendation. Any idea on why the controlsend might not be working when send is?

Have you make sure that it's really called "Age of Conan"?? Except than that I don't know, I have never played the game.
Link to comment
Share on other sites

This might help someone in diagnosing the issue I'm having.

When I use:

ControlSetText ( "Age of Conan", "", "", "c")

It changes the title bar from Age of Conan to c. So it is in fact recognizing the window and capable of sending something to it. Is it supposed to change the title like that?

Edited by KaJe
Link to comment
Share on other sites

This might help someone in diagnosing the issue I'm having.

When I use:

It changes the title bar from Age of Conan to 1. So it is in fact recognizing the window and capable of sending something to it. Is it supposed to change the title like that?

Actually it doesn't mean anything,all aplications use windows,but not all windows,specially games,use controls.Most of them draw directly to the window using DX or OpenGL,you can change their title,resize them,etc,but you cannot automate them using Control* Functions.
Link to comment
Share on other sites

Actually it doesn't mean anything,all aplications use windows,but not all windows,specially games,use controls.Most of them draw directly to the window using DX or OpenGL,you can change their title,resize them,etc,but you cannot automate them using Control* Functions.

Hmmm.. So is there another way of going about it? If not, does anyone know of anything other than AutoIt that might be capable?

Link to comment
Share on other sites

Add this to the begging of your function, assuming it is in a function. If it is not in a function place it at the Top of your Script.

Global $handle = WinGetHandle("classname=Conan")
WinSetState($handle, "", @SW_SHOWMINIMIZED)

Please let me know if this works, i will help in anyway possible.

...will never learn all there is to know about autoit, no worries...i came to the forums :)

Link to comment
Share on other sites

Add this to the begging of your function, assuming it is in a function. If it is not in a function place it at the Top of your Script.

Global $handle = WinGetHandle("classname=Conan")
WinSetState($handle, "", @SW_SHOWMINIMIZED)

Please let me know if this works, i will help in anyway possible.

My script is completely empty other than that one command I have been trying to use. So all that it is made up of currently is what you just gave me.

When I started the script, AutoIt minimized and then the little autocode box came up with commands that start with c. Call, Case, CDTray, Ceiling, Chr, etc (because it types the C in the script editor and is recommending code). If I simply save the script and then use the Run Script program, it doesn't do anything except make it look like there isn't any active windows.

Thanks for your help!

Edited by KaJe
Link to comment
Share on other sites

Ah i see, give me a little more information. Are you trying to Send "c" to age of conan at a certain time? When you press a button? Multiple Times? Repeatedly until it stops? What does "c" do when you send it to AoC? What in Game Function does it preform? What do you want this to do?

These questions and answers will help me to help you with your program. :)

...will never learn all there is to know about autoit, no worries...i came to the forums :)

Link to comment
Share on other sites

Ah i see, give me a little more information. Are you trying to Send "c" to age of conan at a certain time? When you press a button? Multiple Times? Repeatedly until it stops? What does "c" do when you send it to AoC? What in Game Function does it preform? What do you want this to do?

These questions and answers will help me to help you with your program. :)

C is a key binding for casting a spell in Age of Conan. Once I get autoit to be capable of sending the C to the program, I plan on making a loop to continue it pretty much until I tell it to stop. So I can start the script, my character will keep casting this spell as if I am hitting the C key while I don't necessarily have Age of Conan as the active window.

Link to comment
Share on other sites

Try this.

HotKeySet("{F9}", "start")
HotKeySet("{F10}", "stop")
AutoItSetOption("WinTitleMatchMode", 4)

While 1
   Sleep(1000)
WEnd

Func start()
   Global $handle = WinGetHandle("classname=Conan")
   WinSetState($handle, "", @SW_MINIMIZE)
   If @error Then
      MsgBox(0, "error", "Couldn't Find AoC")
   Else
      While 1
            ControlSend($handle, "", "", "c")
            Sleep(300)
      WEnd
   EndIf
EndFunc   ;==>hide

Func stop()
   Exit
EndFunc   ;==>show

This should work for what you want it to do. Press F9 to start sending C and F10 to stop. Also you can change Sleep(300) to what ever your spells cast time is. If the cast time is 3 seconds, then make the number 3200 (milliseconds). You will want to add that 200 milliseconds in there for lag and what not, even if your on an amazing connection.

...will never learn all there is to know about autoit, no worries...i came to the forums :)

Link to comment
Share on other sites

well heres another odd question... does controlclick() work?

Just tried:

ControlClick ( "Age of Conan", "", "", "left", "1", "1342", "429")

and no luck. :)

Edited by KaJe
Link to comment
Share on other sites

Try this.

HotKeySet("{F9}", "start")
HotKeySet("{F10}", "stop")
AutoItSetOption("WinTitleMatchMode", 4)

While 1
   Sleep(1000)
WEnd

Func start()
   Global $handle = WinGetHandle("classname=Conan")
   WinSetState($handle, "", @SW_MINIMIZE)
   If @error Then
      MsgBox(0, "error", "Couldn't Find AoC")
   Else
      While 1
            ControlSend($handle, "", "", "c")
            Sleep(300)
      WEnd
   EndIf
EndFunc   ;==>hide

Func stop()
   Exit
EndFunc   ;==>show

This should work for what you want it to do. Press F9 to start sending C and F10 to stop. Also you can change Sleep(300) to what ever your spells cast time is. If the cast time is 3 seconds, then make the number 3200 (milliseconds). You will want to add that 200 milliseconds in there for lag and what not, even if your on an amazing connection.

OK, just tried that. When I start the script with F9, Age of Conan minimizes. I then maximize it and it didn't send C to the program. However, if I keep the Age of Conan window active, it will run through the loop and cast the spell but if any time I change to another window, it doesn't cast the spell.

I really appreciate the time you're taking to help me! Thank you!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...