meamrussian Posted August 21, 2005 Share Posted August 21, 2005 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. Link to comment Share on other sites More sharing options...
quaizywabbit Posted August 21, 2005 Share Posted August 21, 2005 post your script so we know how you're trying to accomplish this. [u]Do more with pre-existing apps![/u]ANYGUIv2.8 Link to comment Share on other sites More sharing options...
meamrussian Posted August 21, 2005 Author Share Posted August 21, 2005 (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) WendThe most simple code in the world As you can see, the game is halo.EDIT: btw, I think that ANY scripts don't work for games =\ Edited August 21, 2005 by meamrussian Link to comment Share on other sites More sharing options...
quaizywabbit Posted August 21, 2005 Share Posted August 21, 2005 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 Link to comment Share on other sites More sharing options...
meamrussian Posted August 21, 2005 Author Share Posted August 21, 2005 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 Hehe, thanks a lot for the help. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 21, 2005 Moderators Share Posted August 21, 2005 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. Link to comment Share on other sites More sharing options...
meamrussian Posted August 21, 2005 Author Share Posted August 21, 2005 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. Link to comment Share on other sites More sharing options...
quaizywabbit Posted August 21, 2005 Share Posted August 21, 2005 (edited) did you try ControlSend()?try using the AutoIt Window Info tool on this screen to get what you need to use ControlSend() Edited August 21, 2005 by quaizywabbit [u]Do more with pre-existing apps![/u]ANYGUIv2.8 Link to comment Share on other sites More sharing options...
meamrussian Posted August 21, 2005 Author Share Posted August 21, 2005 (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) WendHalo 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 August 21, 2005 by meamrussian Link to comment Share on other sites More sharing options...
meamrussian Posted August 21, 2005 Author Share Posted August 21, 2005 can anyone help me with this? Link to comment Share on other sites More sharing options...
therks Posted August 21, 2005 Share Posted August 21, 2005 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. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
meamrussian Posted August 21, 2005 Author Share Posted August 21, 2005 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) WEndI 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! Link to comment Share on other sites More sharing options...
meamrussian Posted August 21, 2005 Author Share Posted August 21, 2005 Hmm, I tried that code, but it doesn't find IsPressed.au3. Can you help? Thanks. Link to comment Share on other sites More sharing options...
w0uter Posted August 21, 2005 Share Posted August 21, 2005 _ispressed is a UDF. search the forum. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
meamrussian Posted August 21, 2005 Author Share Posted August 21, 2005 _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. Link to comment Share on other sites More sharing options...
quaizywabbit Posted August 21, 2005 Share Posted August 21, 2005 is the _IsPressed.au3 file in your Include folder? [u]Do more with pre-existing apps![/u]ANYGUIv2.8 Link to comment Share on other sites More sharing options...
meamrussian Posted August 22, 2005 Author Share Posted August 22, 2005 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 =\ Link to comment Share on other sites More sharing options...
meamrussian Posted August 22, 2005 Author Share Posted August 22, 2005 Does anyone know why this is? Link to comment Share on other sites More sharing options...
quaizywabbit Posted August 22, 2005 Share Posted August 22, 2005 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 Link to comment Share on other sites More sharing options...
meamrussian Posted August 23, 2005 Author Share Posted August 23, 2005 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 <<<<<<<<<<< Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now