Sign in to follow this  
Followers 0
NiN

Can anyone help me with this please?

10 posts in this topic

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 B)

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 B)

EDIT: If you want to click a GUI-Button (like an OK-Button) then lookup the ControlClick() Function

Edited by Raindancer

Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer

Share this post


Link to post
Share on other sites

Im a lil bit confused...

I actually failed Visual Basic... well, i got a D+ B) bad bad

can you add me to MSN so u can explain me better?

ty

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 B)

And sorry, no MSN here at work allowed...


Say: "Chuchichäschtli"My UDFs:_PrintImage UDF_WinAnimate UDFGruess Raindancer

Share this post


Link to post
Share on other sites

Thanks a lot!

I'm going to try this as soon as I get home!

B)

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 1

Basically, I just do like

While 1=1
Send("{Enter}")
Wend

Replace 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 by GoronSlayer99

Share this post


Link to post
Share on other sites

Thanks for all your help guys.

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0