Sign in to follow this  
Followers 0
Nightcover

Hi new here so need some help :D

9 posts in this topic

Hey, Could you please help.

I want a code that do so evey Send("") it will automatic ingreasee with one ex.

Send("1")

Send("2")

But so I don't need to write it,

a $count code maybe, but I don't know how to do it

Like:

Quote:

$answer = MsgBox(4, "AutoIt Example", "This script will count to 5 using a 'Do' loop. Run?")

; Check the user's answer to the prompt (see the help file for MsgBox return values)

; If "No" was clicked (7) then exit the script

If $answer = 7 Then

MsgBox(0, "AutoIt Example", "OK. Bye!")

Exit

EndIf

; Set the counter

$count = 1

; Execute the loop "until" the counter is greater than 5

Do

; Print the count

MsgBox(0, "AutoIt Example", "Count is: " & $count)

; Increase the count by one

$count = $count + 1

Until $count > 5

You undersstand?

I want(I'm not asking for the code just a little help) so the code will do so it will automatic write

1 and then ENTER

2 and then ENTER

etc. undtilll 1000

But at a way so I don't need to write it myself

cause it would take loooong time to write:

Send("1")

Send("{Enter}")

Send("2")

Send("{Enter}")

etc.

could you please help me? :D

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Welcome!

Try this

For $i= 1 to 1000
Send($i & {Enter})
Next
Msgbox(0,"Done","Done")

just look up loops in helpfile

Edit:didn't see 1000

Edited by Paulie

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Hey, Could you please help.

I want a code that do so evey Send("") it will automatic ingreasee with one ex.

Send("1")

Send("2")

But so I don't need to write it,

a $count code maybe, but I don't know how to do it

Like:

Quote:

$answer = MsgBox(4, "AutoIt Example", "This script will count to 5 using a 'Do' loop. Run?")

; Check the user's answer to the prompt (see the help file for MsgBox return values)

; If "No" was clicked (7) then exit the script

If $answer = 7 Then

MsgBox(0, "AutoIt Example", "OK. Bye!")

Exit

EndIf

; Set the counter

$count = 1

; Execute the loop "until" the counter is greater than 5

Do

; Print the count

MsgBox(0, "AutoIt Example", "Count is: " & $count)

; Increase the count by one

$count = $count + 1

Until $count > 5

You undersstand?

I want(I'm not asking for the code just a little help) so the code will do so it will automatic write

1 and then ENTER

2 and then ENTER

etc. undtilll 1000

But at a way so I don't need to write it myself

cause it would take loooong time to write:

Send("1")

Send("{Enter}")

Send("2")

Send("{Enter}")

etc.

could you please help me? :D

Try something like this:

$answer = MsgBox(4, "AutoIt Example", "This script will count to 5 using a 'Do' loop. Run?")

If $answer <> 7 Then

$count = 1

For $count = 1 to 5 step 1

     Send($count)

     Send("{ENTER}")

     MsgBox(0, "AutoIt Example", "Count is: " & $count)

Next

EndIf

MsgBox(0, "AutoIt Example", "OK. Bye!")

Nomad :D

Edited by Nomad

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Welcome!

Try this

For $i= 1 to 1000
Send($i & {Enter})
Next
Msgbox(0,"Done","Done")

just look up loops in helpfile

Edit:didn't see 1000

I can't find "loops" in the Help files

And it gives me a Error

And nomade

When I try your code it just write. $count instead off the number

you know, in notebad ex, it should write: 1 2 3 4 5 etc. not: $count $count etc.

Sorry i'm a noob, I just got this program yesterday And have no traning in Scripts

Edited by Nightcover

Share this post


Link to post
Share on other sites

I can't find "loops" in the Help files

And it gives me a Error

And nomade

When I try your code it just write. $count instead off the number

Sorry i'm a noob, I just got this program yesterday And have no traning in Scripts

Loops:

Look up:

While

Do

For

In the help file, those are 3 types of loops.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I can't find "loops" in the Help files

And it gives me a Error

And nomade

When I try your code it just write. $count instead off the number

you know, in notebad ex, it should write: 1 2 3 4 5 etc. not: $count $count etc.

Sorry i'm a noob, I just got this program yesterday And have no traning in Scripts

in nomads script, take quotes away whhere it says

send($count)

^that should work

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I can't find "loops" in the Help files

And it gives me a Error

And nomade

When I try your code it just write. $count instead off the number

you know, in notebad ex, it should write: 1 2 3 4 5 etc. not: $count $count etc.

Sorry i'm a noob, I just got this program yesterday And have no traning in Scripts

Oops, was my fault. I put the $count in quotes by mistake. I edited it, try it again.

Nomad :D

Edit: as Paulie pointed out while I was replying :D

Edited by Nomad

Share this post


Link to post
Share on other sites

$answer = MsgBox(4, "AutoIt Example", "This script will count to 5 using a 'Do' loop. Run?")

If $answer <> 7 Then

$count = 1

For $count = 1 to 5 step 1

Send($count)

Send("{ENTER}")

Next

EndIf

MsgBox(0, "AutoIt Example", "OK. Bye!")

Share this post


Link to post
Share on other sites

No problem. People will usually not be willing to write your script for you, but this is a simple and small script so it wasn't a problem. Examine it and make sure you understand how it works so it will aid you in learning and understanding the syntax for AutoIt. This is the easiest language I've ever used, but it can still be powerful when used correctly. Be sure to try the help menu that came with AutoIt and try searching the forums before posting questions.

Good luck on any projects you decide to undertake and welcome to the forums,

Nomad :D


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