Mastering Posted March 7, 2006 Share Posted March 7, 2006 (edited) Sorry to distrub the peace with my stupidity but I'm having problem scripting something due to the fact I'm the newbie . My plan was to make an Auto-Key program but it kinda screwed up.EDIT:Ah I meant like when I open the program, its suppose to spam the letter "S" for 0.5 seconds, then continues to loop till the program is closed.; ----------------------------------------------------------------------------;; AutoIt Version: 3.1.0; Author: A.N.Other <myemail@nowhere.com>;; Script Function:; Template AutoIt script.;; ----------------------------------------------------------------------------; Script Start - Add your code below hereMsgBox(0, "Blah", "Starting...");Print all numbers from 1 to 10 except number 7For $i = 1 to 2 If $i = 7 Then ContinueLoop Send("{S $i}") ;Next;Example of using level is needed.Anybody wanna help me add changes/give me some advice on what to add and such is greatly appreciated. I'm still browsing the tutorial but it drives me nuts lol. Edited March 7, 2006 by Mastering Link to comment Share on other sites More sharing options...
cppman Posted March 7, 2006 Share Posted March 7, 2006 (edited) Sorry to distrub the peace with my stupidity but I'm having problem scripting something due to the fact I'm the newbie . My plan was to make an Auto-Key program but it kinda screwed up. Anybody wanna help me add changes/give me some advice on what to add and such is greatly appreciated. I'm still browsing the tutorial but it drives me nuts lol. For $i = 1 to 10 ;starts the loop. If $i = 7 then;If $i = 7 then, it will add 1 more to $i to make it skip it $i += 1; adds 1 more EndIf; closes the if statements MsgBox(0, "", $i);message box with the variable $i Next; continue's the loop Edited March 7, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
cdkid Posted March 7, 2006 Share Posted March 7, 2006 (edited) umm... For $i = 1 to 2 If $i = 7 Then ContinueLoop Send("{S $i}"); Next how exactly is $i supposed to get to 7 if the max number is 2? try For $i = 1 to 10 If $i = 7 Then ContinueLoop Send("{S " & $i & "}"); Next Edited March 7, 2006 by cdkid AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide! Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted March 7, 2006 Moderators Share Posted March 7, 2006 Sorry to distrub the peace with my stupidity but I'm having problem scripting something due to the fact I'm the newbie . My plan was to make an Auto-Key program but it kinda screwed up. Anybody wanna help me add changes/give me some advice on what to add and such is greatly appreciated. I'm still browsing the tutorial but it drives me nuts lol. Well the first thing I see is that this will never get past "2": ; Print all numbers from 1 to 10 except number 7 For $i = 1 to 2 If $i = 7 Then ContinueLoop Send("{S $i}"); Next Should be: ; Print all numbers from 1 to 10 except number 7 For $i = 1 to 10 If $i = 7 Then ContinueLoop Send($i); What were you trying to send with {S $i}??? Next Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted March 7, 2006 Moderators Share Posted March 7, 2006 For $i = 1 to 10;starts the loop. If $i = 7 then;If $i = 7 then, it will add 1 more to $i to make it skip it $i += 1; adds 1 more EndIf; closes the if statements MsgBox(0, "", $i);message box with the variable $i Next; continue's the loop This I believe would make it skip number 8. If not it still isn't needed, the continueloop works fine. Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted March 7, 2006 Moderators Share Posted March 7, 2006 I about forgot, when comparing a variable use two "==" like so: ; Print all numbers from 1 to 10 except number 7 For $i = 1 to 10 If $i == 7 Then ContinueLoop; notice two == for comparing the variable. Send($i); What were you trying to send with {S $i}??? Next Link to comment Share on other sites More sharing options...
cppman Posted March 7, 2006 Share Posted March 7, 2006 (edited) This I believe would make it skip number 8. If not it still isn't needed, the continueloop works fine.nope, u should try it.. it works perfect. yeah, u can do it both ways, i just find it easier when writing alot fo code to do this, so u know exactly what it is doing.... just my opinion. Edited March 7, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 7, 2006 Moderators Share Posted March 7, 2006 (edited) There's lots of ways to do it : For $x = 8 To 10 If $x == 8 Then For $i = 1 To 6 Send($i) Next EndIf Send($x) Next Or the one I would probably do:For $x = 1 To 10 If $x <> 7 Then Send($x) Next Or $x = 1 While $x <= 10 If $x <> 7 Then Send($x) $x = $x + 1 WEnd Or $x = 0 While $x < 10 $x = $x + 1 If $x == 7 Then ContinueLoop Send($x) WEnd Or $x = 1 Do If $x <> 7 Then Send($x) $x = $x + 1 Until $x > 10 Or $x = 0 Do $x = $x + 1 If $x == 7 Then ContinueLoop Send($x) Until $x >= 10 Or Many others I'm sure!! Edited March 7, 2006 by SmOke_N 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...
Moderators big_daddy Posted March 7, 2006 Moderators Share Posted March 7, 2006 This is my favorite: For $x = 8 To 10 If $x == 8 Then For $i = 1 To 6 Send($i) Next EndIf Send($x) Next Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 7, 2006 Moderators Share Posted March 7, 2006 This is my favorite: For $x = 8 To 10 If $x == 8 Then For $i = 1 To 6 Send($i) Next EndIf Send($x) NextHa!!!, Now you know how I think on a regular basis! 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...
cppman Posted March 7, 2006 Share Posted March 7, 2006 (edited) how bout.. For $a = 1 to 10 If $a == 7 Then $b = 10-7 $total = $b * 2 $sub = $total + 3 $resultant = $sub -3 / $total $a += $resultant - 7.5 EndIf MsgBox(0, "", $a) Next lol... im just really bored. Edited March 7, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
Valuater Posted March 7, 2006 Share Posted March 7, 2006 these are the same....no??? For $a = 1 to 10 If $a == 7 Then $b = 10-7 $total = $b * 2 $sub = $total + 3 $resultant = $sub -3 / $total $a += $resultant - 7.5 EndIf MsgBox(0, "", $a) Next For $a = 1 to 10 If $a == 7 Then $a = $a + 1 EndIf MsgBox(0, "", $a) Next 8) Link to comment Share on other sites More sharing options...
cppman Posted March 7, 2006 Share Posted March 7, 2006 these are the same....no??? For $a = 1 to 10 If $a == 7 Then $b = 10-7 $total = $b * 2 $sub = $total + 3 $resultant = $sub -3 / $total $a += $resultant - 7.5 EndIf MsgBox(0, "", $a) Next For $a = 1 to 10 If $a == 7 Then $a = $a + 1 EndIf MsgBox(0, "", $a) Next 8) haha, lmao..... that was my point. Miva OS Project 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