Kmanzz Posted June 15, 2007 Share Posted June 15, 2007 for the past hour i have been looking for a script example or script that would hit W for about 5 seconds then e for about 2 then d for 2 seconds then repeat over and over is there anyone who could help me out? Link to comment Share on other sites More sharing options...
narayanjr Posted June 15, 2007 Share Posted June 15, 2007 Search for While and Send and Sleep if you mean hit W then stop for 5 seconds Link to comment Share on other sites More sharing options...
Kmanzz Posted June 15, 2007 Author Share Posted June 15, 2007 i want something that hits W for 5 seconds then E for 2 then D for 2 and repeat over and over Link to comment Share on other sites More sharing options...
Achilles Posted June 16, 2007 Share Posted June 16, 2007 (edited) i want something that hits W for 5 seconds then E for 2 then D for 2 and repeat over and overHotKeySet('^q', '_Exit') ;Push Ctrl + q to call then function _Exit (see below) Const $SLEEP_TIME = 30 ;The greater the value the less the keys will be pressed While 1 ;Repeat for ever.... $timer = TimerInit() ;Start a timer Do Send('W') Sleep($SLEEP_TIME) Until TimerDiff($timer) > 5000 ;Send W until five seconds are up Do Send('E') Sleep($SLEEP_TIME) Until TimerDiff($timer) > 7000 ;Send E until two more seconds are up Do Send('D') Sleep($SLEEP_TIME) Until TimerDiff($timer) > 9000 ;Send D until two more seconds are up WEnd ;Go back to top Func _Exit() Exit ;EXITS!!! EndFunc Ask if you don't understand anything! Edited June 16, 2007 by Piano_Man My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
MisterBates Posted June 16, 2007 Share Posted June 16, 2007 PianoMan, think your code sends W, then waits 5 secs, then sends ... and son on. What was asked was to hold down W for 5 secs - yes? Try (not tested):$timer = TimerInit() ;Start a timer Do Send('{W down}') Sleep($SLEEP_TIME) Until TimerDiff($timer) > 5000;Send W until five seconds are up send ('{W up}') $timer = TimerInit() ;Start a timer Do Send('{E down}') Sleep($SLEEP_TIME) Until TimerDiff($timer) > 2000;Send E until two seconds are up send ('{E up}') ... and so onThe 'down' and 'up' were in the help for send! [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...
Kmanzz Posted June 16, 2007 Author Share Posted June 16, 2007 (edited) Ok i have a question is there a way that i can get it to hold down W Insted of spamming W for 5 seconds Edited June 16, 2007 by Kmanzz Link to comment Share on other sites More sharing options...
Achilles Posted June 16, 2007 Share Posted June 16, 2007 Ok i have a question is there a way that i can get it to hold down W Insted of spamming W for 5 secondsI'm not sure if this is doing what you want: HotKeySet('^q', '_Exit') ;Push Ctrl + q to call then function _Exit (see below) While 1 ;Repeat for ever.... Send('{w down}') Sleep(5000) Send('{w up}') Send('{e down}') Sleep(2000) Send('{e up}') Send('{d down}') Sleep(2000) Send('{d up}') WEnd ;Go back to top Func _Exit() Exit ;EXITS!!! EndFunc My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Rauto Posted June 16, 2007 Share Posted June 16, 2007 Hi this any good ?Dosend("W")sleep(5000)send("e")sleep(2000)send("d")sleep(2000)Until ???? some condition Link to comment Share on other sites More sharing options...
Joern Posted July 22, 2007 Share Posted July 22, 2007 I'm not sure if this is doing what you want: HotKeySet('^q', '_Exit') ;Push Ctrl + q to call then function _Exit (see below) While 1 ;Repeat for ever.... Send('{w down}') Sleep(5000) Send('{w up}') Send('{e down}') Sleep(2000) Send('{e up}') Send('{d down}') Sleep(2000) Send('{d up}') WEnd ;Go back to top Func _Exit() Exit ;EXITS!!! EndFunc This does not work for me. I have the same problem like some more ppl here. Something like Send('{d down}') does only send the key once. I have checked several postings here but did not find the solution. Running on XP SP2 Thx, jb Link to comment Share on other sites More sharing options...
TomCat Posted July 22, 2007 Share Posted July 22, 2007 Hi i have also an question: I modified this Script to: HotKeySet('^q', '_Exit');Push Ctrl + q to call then function _Exit (see below) While 1;Repeat for ever.... Send("{1 DOWN}") Sleep (10) Send("{1 UP}") Sleep (50) Send("{2 DOWN}") Sleep (10) Send("{2 UP}") Sleep (50) Send("{3 DOWN}") Sleep (10) Send("{2 UP}") Sleep (50) Send("{4 DOWN}") Sleep (10) Send("{4 UP}") Sleep (50) Send("{5 DOWN}") Sleep (10) Send("{5 UP}") WEnd;Go back to top Func _Exit() Exit;EXITS!!! EndFunc But i need one key to start and one key to stop or better one key to start and stop. So if i press 1 script runs and if i press 1 again script stops. Can someone help me to do this ? Link to comment Share on other sites More sharing options...
TomCat Posted July 22, 2007 Share Posted July 22, 2007 Problem solved Link to comment Share on other sites More sharing options...
Joern Posted July 22, 2007 Share Posted July 22, 2007 Really strange, no matter what I try something like Send('{w down}') Sleep(5000) Send('{w up}') always hits the key only 1 time. Anyone has the some problem or a solution? jb 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