Nightcover Posted June 9, 2006 Share Posted June 9, 2006 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? Link to comment Share on other sites More sharing options...
Paulie Posted June 9, 2006 Share Posted June 9, 2006 (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 June 9, 2006 by Paulie Link to comment Share on other sites More sharing options...
Nomad Posted June 9, 2006 Share Posted June 9, 2006 (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? 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 Edited June 9, 2006 by Nomad Link to comment Share on other sites More sharing options...
Nightcover Posted June 9, 2006 Author Share Posted June 9, 2006 (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 June 9, 2006 by Nightcover Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 9, 2006 Moderators Share Posted June 9, 2006 I can't find "loops" in the Help filesAnd it gives me a ErrorAnd nomadeWhen I try your code it just write. $count instead off the numberSorry i'm a noob, I just got this program yesterday And have no traning in ScriptsLoops:Look up:WhileDoForIn the help file, those are 3 types of loops. 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. Link to comment Share on other sites More sharing options...
Paulie Posted June 9, 2006 Share Posted June 9, 2006 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 Link to comment Share on other sites More sharing options...
Nomad Posted June 9, 2006 Share Posted June 9, 2006 (edited) I can't find "loops" in the Help filesAnd it gives me a ErrorAnd nomadeWhen I try your code it just write. $count instead off the numberyou 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 Edit: as Paulie pointed out while I was replying Edited June 9, 2006 by Nomad Link to comment Share on other sites More sharing options...
Nightcover Posted June 9, 2006 Author Share Posted June 9, 2006 $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!") Link to comment Share on other sites More sharing options...
Nomad Posted June 9, 2006 Share Posted June 9, 2006 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now