Sign in to follow this  
Followers 0
Arkbound

New at AutoIT

12 posts in this topic

Hi im new here, and new to AutoIT programming. i know a bit of programming with Turing if that helps.

I'm currently trying to make a program that will initiate/pause/stop when a certain button is pushed.

When initiated, i want the program to be able to press a key with a configurable delay, and press another key at another configurable delay.

For Example.

loop

1. Press Tab (delay 1 minute until next click)

2. Press "4" 14 times with 4 second delay between each one

3. Press Tab (delay 10 seconds)

end loop

so it keeps going and goin doing that script until i turn it off. What commands would i need to do this? If someone is willing, can someone make a script of this loop?

Share this post


Link to post
Share on other sites



Hi im new here, and new to AutoIT programming. i know a bit of programming with Turing if that helps.

I'm currently trying to make a program that will initiate/pause/stop when a certain button is pushed.

When initiated, i want the program to be able to press a key with a configurable delay, and press another key at another configurable delay.

For Example.

loop

1. Press Tab (delay 1 minute until next click)

2. Press "4" 14 times with 4 second delay between each one

3. Press Tab (delay 10 seconds)

end loop

so it keeps going and goin doing that script until i turn it off. What commands would i need to do this? If someone is willing, can someone make a script of this loop?

Welcome :whistle:

What have you tried/done yourself to get it done ?


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Welcome :whistle:

What have you tried/done yourself to get it done ?

i've looked in the help file for similar Turing commands. But since they are different languages, its hard to find matches. I know there are no "loop" commands, is it a "while" command now?

Well all i've done so far is search through the help file. I've found mouse clicks but i dont think that'll work with what im trying to do

Share this post


Link to post
Share on other sites

i've looked in the help file for similar Turing commands. But since they are different languages, its hard to find matches. I know there are no "loop" commands, is it a "while" command now?

Well all i've done so far is search through the help file. I've found mouse clicks but i dont think that'll work with what im trying to do

Welcome,

You seem very new indeed to AutoIt. How about trying Valuator's AutoIt 1-2-3 tutorial to get you up to speed a little. You may enjoy the experience and also learn through using it.

:whistle:

Share this post


Link to post
Share on other sites

Welcome,

You seem very new indeed to AutoIt. How about trying Valuator's AutoIt 1-2-3 tutorial to get you up to speed a little. You may enjoy the experience and also learn through using it.

:whistle:

Well i just looked through it, it seems to have alot of GUI lessons, and im not really that far yet T.T

Also the AutoIT 123, i got stuck on a survey thing. i filled everything and still the next button doesnt pop.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

New Problem

While 1
if _IsPressed("23") Then
While 1
    $loop = 0
    Send("TAB",1)
    While $loop <= 11
    Send("4",1)
    sleep(500)
    $loop = $loop + 1
    Wend
Send ("TAB",1)
sleep (1000)
Wend
endif
WEnd

Im trying to put in a stop button, when i try to insert 'if _IsPressed("24") Then Exit Endif" statements like this:

While 1
if _IsPressed("23") Then
While 1
if _IsPressed("24") Then Exit
Endif
    $loop = 0
    Send("TAB",1)
    While $loop <= 11
if _IsPressed("24") Then Exit
Endif
    Send("4",1)
    sleep(500)
    $loop = $loop + 1
    Wend
Send ("TAB",1)
sleep (1000)
if _IsPressed("24") Then Exit
Endif
Wend
endif
WEnd

It then doesnt work, saying im missing "WEnd"

Also how do i convert it into an exe file?

Edited by Arkbound

Share this post


Link to post
Share on other sites

bump

Share this post


Link to post
Share on other sites

New Problem

While 1
if _IsPressed("23") Then
While 1
    $loop = 0
    Send("TAB",1)
    While $loop <= 11
    Send("4",1)
    sleep(500)
    $loop = $loop + 1
    Wend
Send ("TAB",1)
sleep (1000)
Wend
endif
WEnd

Im trying to put in a stop button, when i try to insert 'if _IsPressed("24") Then Exit Endif" statements like this:

While 1
if _IsPressed("23") Then
While 1
if _IsPressed("24") Then Exit
Endif
    $loop = 0
    Send("TAB",1)
    While $loop <= 11
if _IsPressed("24") Then Exit
Endif
    Send("4",1)
    sleep(500)
    $loop = $loop + 1
    Wend
Send ("TAB",1)
sleep (1000)
if _IsPressed("24") Then Exit
Endif
Wend
endif
WEnd

It then doesnt work, saying im missing "WEnd"

Also how do i convert it into an exe file?

The easiest way to edit AutoIt scripts, check them, run them, and compile them... is from SciTE. SciTE is a Scintilla based editor that has be customized for AutoIt. Almost everyone on this forum is using SciTE to edit their scripts. Copy/Paste of your script above into SciTE, followed by Ctrl-t to run "Tidy", and some of your basic mistakes become very clear.

The first big one you need to correct is the syntax of your 'If' commands. AutoIt will take it two ways: on a single line, or multi-line. If your conditional action is a single line, then the whole thing can go on one line AND THERE IS NO ENDIF. For instance:

if _IsPressed("24") Then ExitoÝ÷ Ù8Z¶X§zÈhºWaj÷§ IÝ!öµêâµ·j붢wb¶*'jV¶*'ßÑ1ÝýÁ«"ÉnuçhØ^±©)Þ|­g²¢èZ½é®Ø©ç(Ø­ì~éܶ*'²Ú)z·è®j+ü¨º;¬¶X¤zØ^³)ík޶׫¦ëg¢ØbµêííýN§ßÛ-jצz{ZÛ¬{DÒßÛhªä¶ÚßÒßÖ®¶­sfbô5&W76VBgV÷C³#BgV÷C²FVâ¢W@¤VæD` ¦bô5&W76VBgV÷C³#2gV÷C²FVâ¢×6t&÷cBÂgV÷C´FöæRgV÷C²ÂgV÷C´b33¶ÒFöæRæ÷râgV÷C²¢W@¤VæD`

:whistle:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Hm i got another problem now.

you know how its Send ("{TAB}",1), it actually types out {TAB} and not press the tab button. how do i make it press the tab button

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

By using 1 as the second parameter you are telling AutoIt to send {TAB} rather than press tab key.

use

Send("{TAB}")

instead

Edited by RazerM

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

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