NiN Posted November 10, 2005 Posted November 10, 2005 Can anyone tell me how to make a script that presses any button forever? like... a code that makes my computer press Enter forever or something like this... I just started and i would like to learn how to use AutoIt.. Thank you
Raindancer Posted November 10, 2005 Posted November 10, 2005 (edited) I'd like to help you. There are some function which you can look up in the Help: The While-Loop The Send() Function And The Sleep() Function Try it... write some code. post it here, and together we will reach your goal EDIT: If you want to click a GUI-Button (like an OK-Button) then lookup the ControlClick() Function Edited November 10, 2005 by Raindancer Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer
NiN Posted November 10, 2005 Author Posted November 10, 2005 Im a lil bit confused... I actually failed Visual Basic... well, i got a D+ bad bad can you add me to MSN so u can explain me better? ty
Helge Posted November 10, 2005 Posted November 10, 2005 This is basically what he said.. While 1 Send("Helge is so cooool !") Sleep(5000) WEnd ; Loop start ; Sends text ; Wait for 5 seconds ; Loop end (and go to start again) Look in the helpfile for more help on the parts you don't understand.
Raindancer Posted November 10, 2005 Posted November 10, 2005 This is basically what he said..While 1 Send("Helge is so cooool !") Sleep(5000) WEnd ; Loop start ; Sends text ; Wait for 5 seconds ; Loop end (and go to start again)Look in the helpfile for more help on the parts you don't understand.Exactly... I always what the one which needs help, to figure it out by himself. at least a bit. so the one learns how to consult the help file. posts code, and then we can develop... English is no programming language And sorry, no MSN here at work allowed... Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer
NiN Posted November 10, 2005 Author Posted November 10, 2005 Thanks a lot! I'm going to try this as soon as I get home!
NiN Posted November 10, 2005 Author Posted November 10, 2005 So, It will be something like this? CODEWhile 1 Send("{ALT}") Sleep(5000) WEnd ; Loop start ; Sends text ; Wait for 5 seconds ; Loop end (and go to start again)
GoronSlayer99 Posted November 10, 2005 Posted November 10, 2005 (edited) So, It will be something like this?CODEWhile 1 Send("{ALT}") Sleep(5000) WEnd ; Loop start ; Sends text ; Wait for 5 seconds ; Loop end (and go to start again)Without the "CODE" before the While 1Basically, I just do likeWhile 1=1 Send("{Enter}") WendReplace Enter with whatever keystroke you want. Also, those ";text"'s are simply to show you what it's doing, it doesn't affect the code whatsoever.Also, the "Sleep(X)" is just to make a pause before the next key press. Leave it out to press it really fast. Make it a few hundred for a short pause, and a few thousand, for a several second pause inbetween each keypress. Edited November 10, 2005 by GoronSlayer99
Faleira Posted November 11, 2005 Posted November 11, 2005 well, maybe i'm different from the other people here, but when i read the first post, and he said "hold enter forever", i figured he meant that enter be held down forever... Well anyways, with the current code u have, u just hit alt a bazillion times until u stop the script. If u want it to hold the alt key down, then u could perhaps take a look at the SendKeyDownDelay option... [quote]If whenever you feel small, useless, offended, depressed, and just generally upset always remember......you were once the fastest and most vicious sperm out of hundreds of millions![/quote]
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