jumper Posted August 18, 2008 Share Posted August 18, 2008 (edited) Hello, I wanted to create a macro that would spamm the keys 7 and 8 on my keyboard until i press a new hotkey, as i have no programming experience i messed around with AutoIt and i have made this so far: HotKeySet("o", "PauseProg") HotKeySet("p", "StartProg") While 1 Sleep(100) Wend Func StartProg() while 1 Send("7") Send("7") Send("7") Send("7") Send("7") Send("8") WEnd EndFunc Func PauseProg() While 1 Sleep(100) Wend EndFunc It does what its suppose to do, i have 5 of those "Send("7")" because then it gives perfect timing, but the problem is that inside the window where it should send the keys when pressing the hotkey it will do nothing, i changed the application to windowed mode, put notepad next to the window, selected notepad, clicked the hotkey and then clicked on the application which was window moded, then it would work, same concept for pausing it. But it is annoying and takes away valuable seconds, is there any way to make it so the hotkeys would work when the application is foremost or do i need to learn some c++ or something? Thanks! Edited August 18, 2008 by jumper Link to comment Share on other sites More sharing options...
Andreik Posted August 18, 2008 Share Posted August 18, 2008 Maybe this example help you: HotKeySet("{ESC}","Quit") $GUI = GUICreate("My program",100,100) GUISetState() While 1 Sleep(25) WEnd Func Quit() If WinActive("My program") Then Exit EndIf EndFunc When the words fail... music speaks. Link to comment Share on other sites More sharing options...
jumper Posted August 18, 2008 Author Share Posted August 18, 2008 Maybe this example help you: HotKeySet("{ESC}","Quit") $GUI = GUICreate("My program",100,100) GUISetState() While 1 Sleep(25) WEnd Func Quit() If WinActive("My program") Then Exit EndIf EndFunc It does not... unless.. Would it be possible to make this "My program" window stay foremost 24/7 ...so it would be foremost at the same time while other windows get switched to foremost xD? Link to comment Share on other sites More sharing options...
Andreik Posted August 18, 2008 Share Posted August 18, 2008 (edited) Look in help file about WinExists,WinWaitActive and WinActivate. Edited August 18, 2008 by Andreik When the words fail... music speaks. Link to comment Share on other sites More sharing options...
jumper Posted August 18, 2008 Author Share Posted August 18, 2008 Look in help file about WinExists,WinWaitActive and WinActivate.I think your not following me at all, the application becomes foremost and blocks the hotkeys set by me, but if i use some other application, notepad for an example, i can start the script from there and then change manually to the application window where it will continue to send the keys it was sending a moment ago to notepad, but still hotkeys do not work.Using the example you have given me makes the use of the script utterly pointless, just more code but no hotkeys working inside the application, it is not a workaround for the problem. Link to comment Share on other sites More sharing options...
Joscpe Posted August 18, 2008 Share Posted August 18, 2008 try different keys? -Joscpe Link to comment Share on other sites More sharing options...
jumper Posted August 18, 2008 Author Share Posted August 18, 2008 (edited) try different keys?Its obviously blocking the "hotkey" command, does not matter what key i set it to.EDIT: how hard would it be to write the same thing in c/c++? Edited August 18, 2008 by jumper Link to comment Share on other sites More sharing options...
Bert Posted August 18, 2008 Share Posted August 18, 2008 (edited) I take it you have a game that is using Gameguard, or something like it. Am I correct? Edited August 18, 2008 by Volly The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
jumper Posted August 18, 2008 Author Share Posted August 18, 2008 I take it you have a game that is using Gameguard, or something like it. Am I correct?No GameGuard... Link to comment Share on other sites More sharing options...
Bert Posted August 18, 2008 Share Posted August 18, 2008 Is it a game? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
jumper Posted August 18, 2008 Author Share Posted August 18, 2008 (edited) Is it a game?Yes, a private server, hence why no security like GG. Edited August 18, 2008 by jumper Link to comment Share on other sites More sharing options...
Bert Posted August 18, 2008 Share Posted August 18, 2008 Ok, it sounds like the game is blocking it to prevent in the game developer's mind of cheating. What you may want to look at is to see if the on-screen keyboard works. If it does, you may be able to get the hotsetkey to work on that. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
jumper Posted August 18, 2008 Author Share Posted August 18, 2008 Ok, it sounds like the game is blocking it to prevent in the game developer's mind of cheating. What you may want to look at is to see if the on-screen keyboard works. If it does, you may be able to get the hotsetkey to work on that.No luck..any other ideas? Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted August 18, 2008 Share Posted August 18, 2008 Have you tried _IsPressed()? Only make sure that you use a button which isn't used anywhere else. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface 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