tttommeke Posted December 22, 2006 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.
theguy0000 Posted December 22, 2006 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
tttommeke Posted December 22, 2006 Author 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
vhson Posted December 28, 2006 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" ?
xcal Posted December 28, 2006 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
Cyber Posted November 9, 2015 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
water Posted November 9, 2015 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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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