lancey Posted June 21, 2007 Share Posted June 21, 2007 guys i need to create a program to simulate keystrokes every 1 minute "space bar" is pressed and every 2 minutes "F4" is pressed. i need to use this program for one of my gaming applications so when im not around or eating it will still run. i am new to this forum and program so please help me. If you can please give me a script or whole program thanks a lot guys. ^^ Link to comment Share on other sites More sharing options...
MisterBates Posted June 21, 2007 Share Posted June 21, 2007 guys i need to create a program to simulate keystrokes every 1 minute "space bar" is pressed and every 2 minutes "F4" is pressed.i need to use this program for one of my gaming applications so when im not around or eating it will still run.i am new to this forum and program so please help me. If you can please give me a script or whole program thanks a lot guys. ^^Lookup the following in the help file:While loop - to get your program loopingTimerInit - to initialize/re-initialize timersTimerDiff - to check timers (timers work in milliseconds)WinActivate - to ensure your key strokes are sent to the correct windowSend - to send your keystrokesProviding a working script would not develop your AutoIt skills [u]MisterBates[/u]_____________________________________________________Suspend/Resume Windows ScreensaverWatchWindows - Window watcher/loggerUDF: Click systray menu/submenu itemsUDF: Outlook Express Folder/Message handling (+ example code)HowTo: Multiple icons in one compiled script Link to comment Share on other sites More sharing options...
lancey Posted June 21, 2007 Author Share Posted June 21, 2007 (edited) thanks a lot i while provide the script that i will make guys please double check thanks. Sir for starters can you show me the basic syntax format of the program so that i can study it, thanks Edited June 21, 2007 by lancey Link to comment Share on other sites More sharing options...
MisterBates Posted June 21, 2007 Share Posted June 21, 2007 Sir for starters can you show me the basic syntax format of the program so that i can study it, thanksNot sure what you mean. To get up and going (I assume you are using SciTE that came with AutoIt), open windows explorer, right-click where you want to keep your script, and choose "New/AutoIt Script". This will create a ".au3" file for you. Right-click this and choose "edit" and SciTE will start. SciTe has been customized to understand AutoIt scripting, so go to end of file and start typing "while" etc. etc. If you want to understand a keyword, put your cursor inside the word and hit F1 to get help.Try to make the script, and post it back here ... people who show effort get helped [u]MisterBates[/u]_____________________________________________________Suspend/Resume Windows ScreensaverWatchWindows - Window watcher/loggerUDF: Click systray menu/submenu itemsUDF: Outlook Express Folder/Message handling (+ example code)HowTo: Multiple icons in one compiled script Link to comment Share on other sites More sharing options...
FreeFry Posted June 21, 2007 Share Posted June 21, 2007 Lookup the following in the help file:While loop - to get your program looping TimerInit - to initialize/re-initialize timersTimerDiff - to check timers (timers work in milliseconds)WinActivate - to ensure your key strokes are sent to the correct windowSend - to send your keystrokesProviding a working script would not develop your AutoIt skills Sleep is also an alternative to using Timerinit & TimerDiff Link to comment Share on other sites More sharing options...
Kip Posted June 21, 2007 Share Posted June 21, 2007 While 1 ; action 1 ; sleep 1 minute ; action 2 ; sleep 1 minute WEnd MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
MisterBates Posted June 21, 2007 Share Posted June 21, 2007 While 1; action 1; sleep 1 minute; action 2; sleep 1 minuteWEndWould need to be While 1; action 1; sleep 1 minute; action 1 & 2; sleep 1 minuteWEnd... although personally I prefer timers as they give a good result even if the script gets low/no CPU cycles... [u]MisterBates[/u]_____________________________________________________Suspend/Resume Windows ScreensaverWatchWindows - Window watcher/loggerUDF: Click systray menu/submenu itemsUDF: Outlook Express Folder/Message handling (+ example code)HowTo: Multiple icons in one compiled script Link to comment Share on other sites More sharing options...
lancey Posted June 22, 2007 Author Share Posted June 22, 2007 (edited) Thanks guys i am currently on the Learning stages of the program. My algorithm would be like this: 1. I will run a program 2. login: Username and password 3. Application running: the program requires me to hit the "spacebar" every 1 minute and "F4" a minute after the spacebar was hit. 4. should always loop like this So its like... minute 1:00 spacebar minute 2:00 F4 minute 3:00 spacebar minute 4:00 F4 .. ... up until i stop the program 5. im quite new to this so please help me ^^ 6. Im not quite sure if this program will be recognized by the gaming application, for it needs something like simulating a real keyboard press by the user. 7. Thanks again guys, i hope you can help me. Edited June 22, 2007 by lancey Link to comment Share on other sites More sharing options...
MisterBates Posted June 22, 2007 Share Posted June 22, 2007 (edited) Thanks guys i am currently on the Learning stages of the program. My algorithm would be like this: 1. I will run a program 2. login: Username and password 3. Application running: the program requires me to hit the "spacebar" every 1 minute and "F4" a minute after the spacebar was hit. 4. should always loop like this So its like... minute 1:00 spacebar minute 2:00 F4 minute 3:00 spacebar minute 4:00 F4 .. ... up until i stop the program 5. im quite new to this so please help me ^^ 6. Im not quite sure if this program will be recognized by the gaming application, for it needs something like simulating a real keyboard press by the user. 7. Thanks again guys, i hope you can help me.How about this (one running, exit using [ESC] or using the exit taskbar menu item): hotkeyset("{Esc}", "ExitScript") while 1 WinActivate("Title of window I want to send keys to"); Replace title with the title of your application window send("{SPACE}") sleep(1000); 1000 milliseconds = 1 second WinActivate("Title of window I want to send keys to") send("{F4}") sleep(1000) WEnd Func ExitScript() Exit EndFunc Edit: Missed the exit capability Edited June 22, 2007 by MisterBates [u]MisterBates[/u]_____________________________________________________Suspend/Resume Windows ScreensaverWatchWindows - Window watcher/loggerUDF: Click systray menu/submenu itemsUDF: Outlook Express Folder/Message handling (+ example code)HowTo: Multiple icons in one compiled script Link to comment Share on other sites More sharing options...
lancey Posted June 23, 2007 Author Share Posted June 23, 2007 alright guys here is my program... ; Body MsgBox(1,"Auto Battle","Do you want to start the program") WinActivate("APPXN TITLE") WinWaitActive("APPXN TITLE") ; Loop $i = 0 While $i <> -1 Sleep(1000) Send("{SPACE}") Sleep(1000) Send("{F4}") $i += 1 WEnd but for some reason it doesnt work, i tried using it on notepad*it works* but on the actual application doesn't, is it because of the game guard? please help me.. Link to comment Share on other sites More sharing options...
Misha Posted June 23, 2007 Share Posted June 23, 2007 Yes, protections might stop it. Link to comment Share on other sites More sharing options...
Hirax Posted June 23, 2007 Share Posted June 23, 2007 I would think that the code would look something like this.. Please read the comments I stuck in there that way you will better understand the actual source, and program. To start the program press F11, and to exit the program press F10. HotKeySet( "{F10}" , "Exit" ) ;Setting the hotkey to F10 to exit the program HotKeySet( "{F11}" , "Start" ) ;Setting start to start the program Func Exit() ;Creating the function called exit Exit ;the statement used to exit the program EndFunc ;Ending the UDF exit Func Start() ;Creating the UDF Start While 1 ;Creating the loop and starting it Sleep(100000) ;sleep for 1 minute I think I might have gotten my numbers wrong might want to check it Send("{SPACE}") ;send the space bar button Sleep(200000) ;sleep for 2 minute I think I might have gotten my numbers wrong might want to check it Send("{F4}") ;Sending the key F4 Sleep(300000) ;sleep for 3 minute I think I might have gotten my numbers wrong might want to check it Send("{SPACE}") ;Sending the key SPACE again Sleep(400000) ;sleep for 4 minute I think I might have gotten my numbers wrong might want to check it Send("{F4}") ;Sending the key F4 WEnd ;Ending the loop EndFunc ;Ending the UDF Start Link to comment Share on other sites More sharing options...
lancey Posted June 23, 2007 Author Share Posted June 23, 2007 I would think that the code would look something like this.. Please read the comments I stuck in there that way you will better understand the actual source, and program. To start the program press F11, and to exit the program press F10.HotKeySet( "{F10}" , "Exit" ) ;Setting the hotkey to F10 to exit the programHotKeySet( "{F11}" , "Start" ) ;Setting start to start the programFunc Exit() ;Creating the function called exitExit ;the statement used to exit the programEndFunc ;Ending the UDF exitFunc Start() ;Creating the UDF StartWhile 1 ;Creating the loop and starting itSleep(100000) ;sleep for 1 minute I think I might have gotten my numbers wrong might want to check itSend("{SPACE}") ;send the space bar buttonSleep(200000) ;sleep for 2 minute I think I might have gotten my numbers wrong might want to check itSend("{F4}") ;Sending the key F4Sleep(300000) ;sleep for 3 minute I think I might have gotten my numbers wrong might want to check itSend("{SPACE}") ;Sending the key SPACE againSleep(400000) ;sleep for 4 minute I think I might have gotten my numbers wrong might want to check itSend("{F4}") ;Sending the key F4WEnd ;Ending the loopEndFunc ;Ending the UDF Startwill this work if there is a game guard? thanks Link to comment Share on other sites More sharing options...
Mast3rpyr0 Posted June 24, 2007 Share Posted June 24, 2007 if theres gameguard most likely nothing will work... there are program called bypasses though but they arent the easiest things i hear My UDF's : _INetUpdateCheck() My Programs : GameLauncher vAlpha, InfoCrypt, WindowDesigner, ScreenCap, DailyRemindersPick3GeneratorBackupUtility! Other : Bored? Click Here! 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