tttommeke Posted December 22, 2006 Share Posted December 22, 2006 What is the code for holding a key down ? Like in games if you walk you hold key down w (or z) for 10 seconds. I already tried with sending always again a new w (or z) in the game but the games freaks and crash. So i need to now how i can keep the key down for X seconds Exemple : You are walking 100 yards. So the key must be like 10 seconds down before you reach the finish or so. Hope you guys can help me. Link to comment Share on other sites More sharing options...
theguy0000 Posted December 22, 2006 Share Posted December 22, 2006 $secondsToHoldKey = 10 ;change this if you want $KeyToPress = "w" ;also change this if you want Send ("{"&$KeyToPress&" DOWN}") Sleep ($secondsToHoldKey*1000) Send ("{"&$KeyToPress&" UP}") The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN Link to comment Share on other sites More sharing options...
tttommeke Posted December 22, 2006 Author Share Posted December 22, 2006 $secondsToHoldKey = 10 ;change this if you want $KeyToPress = "w" ;also change this if you want Send ("{"&$KeyToPress&" DOWN}") Sleep ($secondsToHoldKey*1000) Send ("{"&$KeyToPress&" UP}")tnx Link to comment Share on other sites More sharing options...
vhson Posted December 28, 2006 Share Posted December 28, 2006 $secondsToHoldKey = 10 ;change this if you want$KeyToPress = "w" ;also change this if you wantSend ("{w DOWN}")Sleep ($secondsToHoldKey*1000)Send ("{w UP}")But i run it, i've got a character w hold key "w" for 10 seconds, i must got "wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww" ? Link to comment Share on other sites More sharing options...
xcal Posted December 28, 2006 Share Posted December 28, 2006 (edited) You just want to push 'w' over and over? Stick the above in a loop. Or, you can just do it like this: HotKeySet('{esc}', 'quit') $millisecondsToDelayKey = 50 ;change this if you want $KeyToPress = "w" ;also change this if you want While 1 Send ("{"&$KeyToPress&"}") Sleep ($millisecondsToDelayKey) WEnd Func quit() Exit EndFunc Edited December 28, 2006 by xcal How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Cyber Posted November 9, 2015 Share Posted November 9, 2015 Don't work!i can't do this!!!if I exec this:$secondsToHoldKey = 10 ;change this if you want $KeyToPress = "w" ;also change this if you want Send ("{"&$KeyToPress&" DOWN}") Sleep ($secondsToHoldKey*1000) Send ("{"&$KeyToPress&" UP}")the result is:wand stop.....whyyyyyy?!?! Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key Link to comment Share on other sites More sharing options...
water Posted November 9, 2015 Share Posted November 9, 2015 (edited) This thread is nearly 9 years old and all participants have been offline for years.A lot has changed in the meantime: Did you notice that discussing game automation is no longer permitted on this forum? Edited November 9, 2015 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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