Jump to content

Can anyone help me with this please?


NiN
 Share

Recommended Posts

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)

Link to comment
Share on other sites

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
Link to comment
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.

Link to comment
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
Link to comment
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)
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
Link to comment
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]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...