bobby177 Posted June 9, 2006 Share Posted June 9, 2006 (edited) Hello, I need someone to make a simple script for me, shouldnt take long. Could you make a script that when Q is pressed, autoit "holds" enter down for 2 seconds and then releases it? EDIT---- Sorry for begging for a program, scroll down to my post to see what i have so far Edited June 9, 2006 by bobby177 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 9, 2006 Moderators Share Posted June 9, 2006 (edited) Hello, I need someone to make a simple script for me, shouldnt take long.Could you make a script that when Q is pressed, autoit "holds" enter down for 2 seconds and then releases it?You'll find exactly what your looking for: Click Here, otherwise you can Start Here or Here. Edited June 9, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Simucal Posted June 9, 2006 Share Posted June 9, 2006 Hello, I need someone to make a simple script for me, shouldnt take long.Could you make a script that when Q is pressed, autoit "holds" enter down for 2 seconds and then releases it?In general.. it is bad manners to ask for scripts to be made for you. Instead, you get much better results if you show what you have tried on your own and we can help correct your mistakes.Look into _Ispressed, Send(), TimerInit(), TimerDiff(), etc, in the help file. AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
bobby177 Posted June 9, 2006 Author Share Posted June 9, 2006 In general.. it is bad manners to ask for scripts to be made for you. Instead, you get much better results if you show what you have tried on your own and we can help correct your mistakes. Look into _Ispressed, Send(), TimerInit(), TimerDiff(), etc, in the help file.As you can probably tell, I am horrible with autoit so i am stuck on something very simple. So far I have Send("{a down}") Sleep(2000) Send("{a up}") Now how would I make it so if Q is pressed then the script would run? Link to comment Share on other sites More sharing options...
Don N Posted June 9, 2006 Share Posted June 9, 2006 (edited) Look at HotKeySet in the help file: HotKeySet( "q", "runThis" ) While 1 Sleep(100) ;wait for the user to press 'q' WEnd Func runThis() ;put ur script here EndFunc EDIT: left code piece Edited June 9, 2006 by Don N _____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper Link to comment Share on other sites More sharing options...
bobby177 Posted June 9, 2006 Author Share Posted June 9, 2006 Ok so now i have HotKeySet( "{f1}", "runThis" ) While 1 Sleep(100) ;wait for the user to press 'q' WEnd Func runThis() Send("{a down}") Sleep(4000) Send("{a up}") EndFunc It doesn't seem like it is "holding" A down, is there a way to do that? Link to comment Share on other sites More sharing options...
Valuater Posted June 9, 2006 Share Posted June 9, 2006 Global $Paused HotKeySet( "{f1}", "runThis" ) HotKeySet("{ESC}", "Terminate") While 1 Sleep(100);wait for the user to press 'q' WEnd Func runThis() $Paused = NOT $Paused While $Paused sleep(10) Send("a") ToolTip('Script is "Running"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc 8) Link to comment Share on other sites More sharing options...
bobby177 Posted June 9, 2006 Author Share Posted June 9, 2006 Global $Paused HotKeySet( "{f1}", "runThis" ) HotKeySet("{ESC}", "Terminate") While 1 Sleep(100);wait for the user to press 'q' WEnd Func runThis() $Paused = NOT $Paused While $Paused sleep(10) Send("a") ToolTip('Script is "Running"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc 8) Thanks but I need it to hold A for a set amount of time... say 2 seconds Link to comment Share on other sites More sharing options...
bobby177 Posted June 9, 2006 Author Share Posted June 9, 2006 Thanks but I need it to hold A for a set amount of time... say 2 secondscan anyone help? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 9, 2006 Moderators Share Posted June 9, 2006 can anyone help?Look in the help file under SendKeyDownDelay. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
bobby177 Posted June 9, 2006 Author Share Posted June 9, 2006 Look in the help file under SendKeyDownDelay.Sorry, where is the help file? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 9, 2006 Moderators Share Posted June 9, 2006 Sorry, where is the help file?Run this script: Run(@ProgramFilesDir & '\AutoIt3\AutoIt3Help.exe') Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
bobby177 Posted June 9, 2006 Author Share Posted June 9, 2006 Run this script: Run(@ProgramFilesDir & '\AutoIt3\AutoIt3Help.exe')What is the syntax of that command? SendKeyDownDelay("A",2000) is what i tried and it wont work Link to comment Share on other sites More sharing options...
nitekram Posted June 9, 2006 Share Posted June 9, 2006 (edited) What is the syntax of that command?SendKeyDownDelay("A",2000) is what i tried and it wont workput this at the top of your codeOpt("SendKeyDownDelay", 2000) ;1 millisecond (default)editalso look at the bottom of the page for other syntax Edited June 9, 2006 by nitekram 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow."  WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI  CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
Don N Posted June 9, 2006 Share Posted June 9, 2006 Description: Alters the length of time a key is held down before released during a keystroke. For applications that take a while to register keypresses (and many games) you may need to raise this value from the default. Time in milliseconds to pause (default=5). Syntax: Opt("SendKeyDownDelay", 1) ;1 millisecond Both are straight from the helpfile _____________________________________________________"some people live for the rules, I live for exceptions"Wallpaper Changer - Easily Change Your Windows Wallpaper Link to comment Share on other sites More sharing options...
bobby177 Posted June 9, 2006 Author Share Posted June 9, 2006 (edited) Ohhh i never saw the syntax table thing below Now I have Opt("SendKeyDownDelay", 5);1 millisecond (default) Global $Paused HotKeySet( "{q}", "runThis" ) HotKeySet("{ESC}", "Terminate") While 1 Sleep(100);wait for the user to press 'q' WEnd Func runThis() $Paused = NOT $Paused While $Paused sleep(10) Send("a") ToolTip('Script is "Running"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc But it still isnt doing what I need it to do, Have me push a key (Q) and then have the script "hold" down a key (A) for a set amount of time (2000) Edited June 9, 2006 by bobby177 Link to comment Share on other sites More sharing options...
Simucal Posted June 9, 2006 Share Posted June 9, 2006 (edited) Because your damn sendkeydowndelay is only for 5 miliseconds. Look at what other people have said in your thread (nitekram). Opt("SendKeyDownDelay", 2000) Try: Opt("SendKeyDownDelay", 2000);1 millisecond (default) HotKeySet( "{q}", "runThis" ) HotKeySet("{ESC}", "Terminate") While 1 Sleep(100);wait for the user to press 'q' WEnd Func runThis() Send("a") EndFunc Func Terminate() Exit EndFunc Edited June 9, 2006 by Simucal AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
bobby177 Posted June 10, 2006 Author Share Posted June 10, 2006 (edited) OK I tried that script, but I hit "Q" and it waits 2 seconds, and then sends A, not "hold" A down, which is what I need it to do Is this hard to do or am I not being descriptive enough? Edited June 10, 2006 by bobby177 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 10, 2006 Moderators Share Posted June 10, 2006 OK I tried that script, but I hit "Q" and it waits 2 seconds, and then sends A, not "hold" A down, which is what I need it to do Is this hard to do or am I not being descriptive enough?Is this the affect your looking for?_MySend('a', 2000, 0) Func _MySend($sCharacters, $iRepeatTime, $iSendDelay = 5) $OptSKD = Opt('SendKeyDelay', $iSendDelay) Local $iSendTimer = TimerInit() While TimerDiff($iSendTimer) <= $iRepeatTime Send($sCharacters) Sleep(10) WEnd Opt('SendKeyDelay', $OptSKD) EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
i542 Posted June 10, 2006 Share Posted June 10, 2006 (edited) OK I tried that script, but I hit "Q" and it waits 2 seconds, and then sends A, not "hold" A down, which is what I need it to do Is this hard to do or am I not being descriptive enough?I don't understand you. Maybe you want to script stay in backgrouding, and when you press 'q', script send enter for 2 secs? i542P.S. My english is very bad because i'm from Croatia... Edited June 10, 2006 by i542 I can do signature me. 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