FeeD Posted June 1, 2007 Share Posted June 1, 2007 Need a script which sends keypress "x" to Window (WOrld of Warcraft) "y" when i press "z" Best regards, FeeD Link to comment Share on other sites More sharing options...
Rick Posted June 1, 2007 Share Posted June 1, 2007 i think you'll find everything you need know in the help file, if you get stuck then ask here. Who needs puzzles when we have AutoIt!! Link to comment Share on other sites More sharing options...
Helge Posted June 1, 2007 Share Posted June 1, 2007 Helpfile : AutoIt --> Function Reference --> Keyboard Control --> ... As always... logic and the ability to read goes a long way. Link to comment Share on other sites More sharing options...
FeeD Posted June 1, 2007 Author Share Posted June 1, 2007 (edited) hum, I am a total noob @ autoIt cant somebody just write a lil script down? ^^ its 2 mins work for you, it would be 3 hours for me Edited June 1, 2007 by FeeD Link to comment Share on other sites More sharing options...
Helge Posted June 1, 2007 Share Posted June 1, 2007 What functions were in that category I pointed to ? Let's check their descriptions :Sets a hotkey that calls a user function.Sends simulated keystrokes to the active window.I'll skip the four remaining since they aren't really functions.So, what sounds like the function you're looking for you think ?When you find out function which is the right one, just go straight for the example at the bottom.Modify it and you're good to go. No need to fully understand the language for that I would think,which I doubt is your intentions anyways. Link to comment Share on other sites More sharing options...
FeeD Posted June 1, 2007 Author Share Posted June 1, 2007 (edited) well yea, if I liked to send it just to the active window it would be no problem, but if i want to send it to a programm in the background... it is (for me) =\ /edit While 1 ControlSend ("World of Warcraft", "", "", "{SPACE}") Sleep(Int(Random(11000,13000))) WEnd ; Function to exit script Func EndScript() Exit EndFunc something like this without a loop just reacting to a keypress Edited June 1, 2007 by FeeD Link to comment Share on other sites More sharing options...
JSunn Posted June 1, 2007 Share Posted June 1, 2007 Here is how you do it... CODERun("hh.exe C:\Program Files\AutoIt3\Autoit3.chm") Link to comment Share on other sites More sharing options...
Helge Posted June 1, 2007 Share Posted June 1, 2007 Look under Related for Send. Link to comment Share on other sites More sharing options...
FeeD Posted June 1, 2007 Author Share Posted June 1, 2007 (edited) ok, very nice I come step to step to what I need ^^ ControlSend ("World of Warcraft", "", "", "{SPACE}") Now I just like to know how I can tell the script when to use it (on keypress) ty for everything btw helge =) btw do anyone know how to tell autoit what window to use if there are two with the same name? Edited June 1, 2007 by FeeD Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 1, 2007 Share Posted June 1, 2007 (edited) ok, very nice I come step to step to what I need ^^ ControlSend ("World of Warcraft", "", "", "{SPACE}") Now I just like to know how I can tell the script when to use it (on keypress) ty for everything btw helge =) btw do anyone know how to tell autoit what window to use if there are two with the same name? 1. That's a better question. Put that in a function (between Func/EndFunc). 2. Look up HotKeySet() and use it to attach that function to the keypress you want. 3. Add a loop to keep the script running while waiting for the keypress (While/WEnd, and Sleep). Edited June 1, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
FeeD Posted June 1, 2007 Author Share Posted June 1, 2007 (edited) HotKeySet("{F1}", "SendSpace") Func SendSpace() ControlSend ("World of Warcraft", "", "", "{SPACE}") EndFunc This way? /loop is missing I know Edited June 1, 2007 by FeeD Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 1, 2007 Share Posted June 1, 2007 This way? Yep. I like to add another one just to make it easy to exit (ctrl-x in this case): HotKeySet("{F1}", "SendSpace") HotKeySet("{^x}", "_Quit") ; Ctrl-x to quit While 1 Sleep(20) WEnd Func SendSpace() ControlSend("World of Warcraft", "", "", "{SPACE}") EndFunc ;==>SendSpace Func _Quit() Exit EndFunc ;==>_Quit Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
FeeD Posted June 1, 2007 Author Share Posted June 1, 2007 Wow, thank you very much.... can u tell me how I can explain AutoIT which window to use? I have two windows open with the same name (cant change the names =\) but I only want to send those commands to one of them... Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 1, 2007 Share Posted June 1, 2007 Wow, thank you very much....can u tell me how I can explain AutoIT which window to use? I have two windows open with the same name (cant change the names =\) but I only want to send those commands to one of them...You're already doing that with the first parameter of ControlSend(): "World of Warcraft" is supposed to be the title.The second parameter is some optional text to look for inside the window, to differentiate between multiple windows with the same title. But in games, text is usually graphically rendered and not readable. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
FeeD Posted June 1, 2007 Author Share Posted June 1, 2007 damn, so there is no way, is autoit choosing the first open window or something like this? ^^ Link to comment Share on other sites More sharing options...
Helge Posted June 1, 2007 Share Posted June 1, 2007 (edited) How to tell which one is which ? When does your script start ? Before, in between or after the processes are started ? Does your script start one, both or none of the processes ? Some details would be nice. Telling you would like to work with "that" but not "the other" isn't very useful information. Edited June 1, 2007 by Helge Link to comment Share on other sites More sharing options...
FeeD Posted June 1, 2007 Author Share Posted June 1, 2007 well I already managed it, thank you anyway <3 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