Jump to content

Some really basic scripting, I forgot how to do


Recommended Posts

I am sorry I have to ask for help, even though it is very easy.

I had someone teach me autoit like 7 years ago, maybe 5, but I forgot the basics which is all I need today. I tried helpfile and examples but seems would take me hours to get the basic loop going.

Can someone do an example of (I will interpret this in human language)

1: promt to use or not use the script

2: wait 5 seconds

3: tab

4: (i got this part if i see how to do number 2) wait 1 second

5: enter

6: wait 1 second

7: loop *100 times*

8: that basic hot key command to stop the script when desired

This basic understanding will give me enough to just get by with what I need to do. Again I am sorry, I should know or at least be able to figure this out, but maybe it is sleep deprivation that I cannot :[

lol I know here it was good to show example scripts, but I am so lost, what I made is funny to me considering I have in the past made array search for change scripts with all kinds of functions.

I am so lost with this part alone

$answer = MsgBox(4, "AutoIt Example", "Run your little program?")

If $answer = 7 Then
    MsgBox(0, "AutoIt Example", "OK.  Bye!")
    Exit
EndIf
Edited by FuzzyShark
Link to comment
Share on other sites

Here:

HotKeySet("^x", "_Close")   ;exit on ctrl+x
Local $answer
For $i = 1 To 100
    $answer = MsgBox(4, "AutoIt Example", "Run your little program?")
    If $answer = 7 Then
        Sleep(5000)
        Send("{TAB}")
        Sleep(1000)
        Send("{ENTER}")
        Sleep(1000)
    Else
        Exit
    EndIf
Next

Func _Close()
    Exit
EndFunc

Note that I just coded this in notepad and I don't have AutoIt on the machine I'm currently using so there may be syntax errors. Just check it yourself.

Edited by omikron48
Link to comment
Share on other sites

ok it works well. It is almost 100% what is gonna work for me.

I tried to work this out but I get errors. I am trying to make it so I am only asked "Run your little program?" one time, then the loop starts. My bad, I should have indicated that between step 1 and 2 when I typed that in the first post. But you got what I asked for lol, I just asked a bit wrong xD

Thanks for your help, I am so lost lol

Edited by FuzzyShark
Link to comment
Share on other sites

If you only want to be prompted once, then just move the statement with MsgBox outside the For..Next loop.

Your algorithm was a bit unclear. I assumed you wanted to be promted every loop so I stuck the prompt code inside the For..Next loop.

Edited by omikron48
Link to comment
Share on other sites

you assumed correctly compared to what I typed. Thank you for helping me out.

This should get me able to write the basics I need for a good while. Alright thanks again.

thread served purpose, issue resolve. ty

Edited by FuzzyShark
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...