Sign in to follow this  
Followers 0
meamrussian

DirectX Problems

22 posts in this topic

Well, I want autoit to send some text automatically when I press a hotkey. It works very well in all applications except in DirectX (a game). I want it to send text in a game, and it just isn't sending. What should I do?

Thanks.

Share this post


Link to post
Share on other sites



post your script so we know how you're trying to accomplish this.


[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

post your script so we know how you're trying to accomplish this.

<{POST_SNAPBACK}>

Sure sure.

HotKeySet("{PAUSE}", "halo")

Func halo()
Send("text", 1)
Endfunc

While 1
  sleep (100)
Wend

The most simple code in the world :whistle: As you can see, the game is halo.

EDIT: btw, I think that ANY scripts don't work for games =\

Edited by meamrussian

Share this post


Link to post
Share on other sites

what is this supposed to do?

Open Halo? Login?

is there an input box on the screen that recieves this text?


[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

yes, that's exactly it. I already press the button to talk to other people, and I just want it to type in text to send to other players. It's just a handy tool for me to use to type something in very quickly instead of having to type the whole thing. I just want to press pause, have text typed in, and that's it. Just a simple send. But, it doesn't work with the game, and I want it to :whistle:

Hehe, thanks a lot for the help.

Share this post


Link to post
Share on other sites

Could you mouseclick to the area where you want to chat then use the send?


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

i COULD do that, but I don't see y what I have already doesn't work. if its in the type mode and it sends something, it should send! It's just that the script isn't working for directx/games.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

did you try ControlSend()?

try using the AutoIt Window Info tool on this screen to get what you need to use ControlSend()

Edited by quaizywabbit

[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

did you try ControlSend()?

try using the AutoIt Window Info tool on this screen to get what you need to use ControlSend()

<{POST_SNAPBACK}>

Well, I now tried using the following code, but it didn't work:

HotKeySet("{PAUSE}", "halo")

Func halo()
ControlSend("Halo", "",,"text",1)
Endfunc

While 1
  sleep (100)
Wend

Halo is the title window, there is no text, no control id, and the text is text, flag 1 (to be sent rw). It doesn't work (and I don't think I made a mistake.

I think it's just the game stopping it from doing something?

Thanks for the help so far.

Edited by meamrussian

Share this post


Link to post
Share on other sites

can anyone help me with this?

Share this post


Link to post
Share on other sites

After a quick experiment, it would seem you're right. It's not a matter of not being able to send though, it seems more like the keys are not reaching the script. Halo seems to be capturing the keys completely, not allowing AutoIt's Hotkey function to see them, a workaround I found is using the IsPressed UDF (look in my sig).

#include <IsPressed.au3>

Func Halo()
   Send('You pressed the pause key', 1)
EndFunc

While 1
  If _IsPressed('13') Then
    Halo()
  EndIf
  Sleep(10)
WEnd

I had to drop the sleep down otherwise it wasn't always catching the key, it still isn't perfect, but it's something you can work with.

Share this post


Link to post
Share on other sites

After a quick experiment, it would seem you're right. It's not a matter of not being able to send though, it seems more like the keys are not reaching the script. Halo seems to be capturing the keys completely, not allowing AutoIt's Hotkey function to see them, a workaround I found is using the IsPressed UDF (look in my sig).

#include <IsPressed.au3>

Func Halo()
   Send('You pressed the pause key', 1)
EndFunc

While 1
  If _IsPressed('13') Then
    Halo()
  EndIf
  Sleep(10)
WEnd

I had to drop the sleep down otherwise it wasn't always catching the key, it still isn't perfect, but it's something you can work with.

<{POST_SNAPBACK}>

Thanks! I will try that now. But, may I ask, how did you find out about that code? I searched IsPressed in the help, and nothing comes up. Actually, none of the _ functions come up. Sorry for being a noob, but I would like to learn. Thanks!

Share this post


Link to post
Share on other sites

Hmm, I tried that code, but it doesn't find IsPressed.au3. Can you help? Thanks.

Share this post


Link to post
Share on other sites

_ispressed is a UDF. search the forum.

<{POST_SNAPBACK}>

Alright. So I took the ispressed code from http://www.autoitscript.com/forum/index.ph...wtopic=5760&hl= and saved the code as ispressed.au3.

Then, I used the code given before. It doesn't work at all. I also looked over the ispressed code and didn't see anywhere to change anything. If someone could please help, that would be awsome. Can someone walk me through the process or make this script, because I'm obviously doing something wrong. This will help me learn the code better.

Thanks.

Share this post


Link to post
Share on other sites

is the _IsPressed.au3 file in your Include folder?


[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

Alright, I got it to work, but it messes up half the time. Sometimes it cuts off the text, and sometimes it doesn't. It's really wierd =\

Share this post


Link to post
Share on other sites

Does anyone know why this is?

Share this post


Link to post
Share on other sites

what exactly does the AutoIt Window Info Tool show about your halo window, or 'text area'( the place where you want text sent to)?


[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites

Copied and pasted:

Press CTRL-ALT-F to pause the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: Halo

Class: Halo

Size: X: 0 Y: 0 W: 1024 H: 768

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 512 Y: 384

Cursor ID: 15

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xECE9D8 Dec: 15526360

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size:

Control ID:

ClassNameNN:

Text:

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

Share this post


Link to post
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
Sign in to follow this  
Followers 0