Faithom Posted February 5, 2005 Share Posted February 5, 2005 (edited) all i need is a script that will push the left arrow key for 3 seconds then let go and then just do nothing for about 30 seconds, then push the right arrow key for 3 seconds then let go and wait for 30 seconds, and then repeat it all over can anyone help me make one please? Edited February 5, 2005 by Faithom Link to comment Share on other sites More sharing options...
Developers Jos Posted February 5, 2005 Developers Share Posted February 5, 2005 all i need is a script that will push the left arrow key for 3 seconds then let go and then just do nothing for about 30 seconds, then push the right arrow key for 3 seconds then let go and wait for 30 seconds, and then repeat it all over can anyone help me make one please?<{POST_SNAPBACK}>Open the helpfile and look for these commands:Send()sleep()While ... wendEnjoy SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Faithom Posted February 5, 2005 Author Share Posted February 5, 2005 ok ill try.. Link to comment Share on other sites More sharing options...
Faithom Posted February 5, 2005 Author Share Posted February 5, 2005 i cant find the command for left arrow key what is it? Link to comment Share on other sites More sharing options...
Developers Jos Posted February 5, 2005 Developers Share Posted February 5, 2005 i cant find the command for left arrow key what is it?<{POST_SNAPBACK}>Just scroll down on the send helppage.{LEFT} = Cursor left SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Faithom Posted February 5, 2005 Author Share Posted February 5, 2005 Send("{LEFT}") Sleep(50000) Send("{RIGHT}") Sleep(50000) ContinueLoop is this somewhat right? Link to comment Share on other sites More sharing options...
Blue_Drache Posted February 5, 2005 Share Posted February 5, 2005 (edited) Send("{LEFT}")Sleep(50000)Send("{RIGHT}")Sleep(50000)ContinueLoopis this somewhat right?<{POST_SNAPBACK}>Somewhat...1 second = 1000 msec Sleep timers are mesured in msecSo, I usually do this: $sec = 1000 Sleep($sec*30); sleep for 30 secondsAlso you said you wanted to HOLD the left arrow for 3 seconds, right? Holding a key needs the addition of the "up/down" modifier.{left down} Sleep {left up} Sleep {right down} sleep {right up}I'll leave you to figure out the "While/WEnd" loop.Also, look at the HotKeySet portion of the help file. That will explain how to set a hotkey to break out of the script and stop it running. Edited February 5, 2005 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Faithom Posted February 5, 2005 Author Share Posted February 5, 2005 $sec = 1000 While $sec <=1000 Sleep($sec*30); sleep for 30 seconds {left down} Sleep {left up} Sleep {right down} sleep {right up} WEnd that's another shot.. Link to comment Share on other sites More sharing options...
Blue_Drache Posted February 5, 2005 Share Posted February 5, 2005 (edited) $sec = 1000While $sec <=1000 Sleep($sec*30); sleep for 30 seconds {left down} Sleep {left up} Sleep {right down} sleep {right up}WEndthat's another shot..<{POST_SNAPBACK}>I didn't give you real code. I gave you psuedo code. You have to figure out the correct syntax. It's all a learning process. No one will spoon feed you here. There is no spoon.And FYI, While will be infinate.Just use While 1 ; code here WEndfor infinate loops. Edited February 5, 2005 by Blue_Drache Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Faithom Posted February 5, 2005 Author Share Posted February 5, 2005 While 1 Send("{LEFT}") Sleep(50000) Send("{RIGHT}") Sleep(50000) WEnd will this just press left and right? not hold tho Link to comment Share on other sites More sharing options...
Developers Jos Posted February 5, 2005 Developers Share Posted February 5, 2005 While 1Send("{LEFT}")Sleep(50000)Send("{RIGHT}")Sleep(50000)WEndwill this just press left and right? not hold tho<{POST_SNAPBACK}>What about :While 1 Send("{LEFT DOWN}") Sleep(3000) Send("{LEFT UP}") Sleep(50000) Send("{RIGHT DOWN}") Sleep(3000) Send("{RIGHT UP}") Sleep(50000) WEnd SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Blue_Drache Posted February 5, 2005 Share Posted February 5, 2005 While 1Send("{LEFT}")Sleep(50000)Send("{RIGHT}")Sleep(50000)WEndwill this just press left and right? not hold tho<{POST_SNAPBACK}>Correct. Every 50 seconds it will tap the left key once, followed by the right key 50 seconds later, ad infinitum.Caveat: Your script won't care which window is active. It will send a left or right arrow to whatever window has the current focus.Ok, I found a spoon.$sec = 1000 $window = "Title of Window Goes Here" HotKeySet("{ESC}", "MyExit"); set the escape key to break the script. While 1 Sleep(10); tiny sleep for the While loop WinActivate($window); activate window Send("{left down}"); hold left key down Sleep($sec * 3); 3 second delay Send("{left up}"); release left key Sleep($sec * 30); 30 second delay WinActivate($window); activate window Send("{right down}"); hold right key down Sleep($sec * 3); 3 second delay Send("{right up}"); release right key WEnd Func MyExit() Exit EndFunc ;==>MyExitThis script will ensure that the proper window always has focus before sending the Left or Right arrow. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Faithom Posted February 5, 2005 Author Share Posted February 5, 2005 mmm spoon fed ty sir 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