mrsyok Posted April 7, 2010 Share Posted April 7, 2010 I created a script using while but it didnt work when it came to 2nd script. $i = 0 $s = 0 Func Action() While $i <= 3 Send("{f}") Sleep(1000) Send("{1}") Sleep(1000) Send("{7}") Sleep(100) Send("{x}") Sleep(100) $i = $i + 1 WEnd While $s = 1 Send("{9}") Sleep(10000) $s = $s + 1 WEnd EndFunc I want my 1st script to repeat doing the same action for 3 times. Then, the next script will running for 1 times. Then, it will continue to repeat the 1st script back and so on. Which part that i got it wrong? Link to comment Share on other sites More sharing options...
sahsanu Posted April 7, 2010 Share Posted April 7, 2010 I created a script using while but it didnt work when it came to 2nd script.Which part that i got it wrong?Second while is never used because of $s is not 1 is declared as 0 so it never reaches your second while. Link to comment Share on other sites More sharing options...
MvGulik Posted April 7, 2010 Share Posted April 7, 2010 (edited) whatever Edited February 7, 2011 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
argumentum Posted April 7, 2010 Share Posted April 7, 2010 Which part that i got it wrong? $i = 0 $s = 0 Action() ; <-- fix Func Action() While $i <= 3 Send("{f}") Sleep(1000) Send("{1}") Sleep(1000) Send("{7}") Sleep(100) Send("{x}") Sleep(100) $i = $i + 1 WEnd While $s = 1 Send("{9}") Sleep(10000) $s = $s + 1 WEnd EndFunc Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
mrsyok Posted April 7, 2010 Author Share Posted April 7, 2010 so, can somebody show me the correct script base on mine? Link to comment Share on other sites More sharing options...
mrsyok Posted April 7, 2010 Author Share Posted April 7, 2010 $i = 0 $s = 0 Func Action() While $i <= 3 Send("{f}") Sleep(1000) Send("{1}") Sleep(1000) Send("{7}") Sleep(100) Send("{x}") Sleep(100) $i = $i + 1 WEnd While $s <=2 Send("{9}") Sleep(10000) $s = $s + 1 WEnd EndFunc I've got it. But right now, the script will End after the 2nd script been executed. How to jump / repeat the 1st script back? Or i have to keep copy and paste it? Link to comment Share on other sites More sharing options...
somdcomputerguy Posted April 7, 2010 Share Posted April 7, 2010 While 1 $i = 0 Action() WEnd Func Action() While $i <= 3 Send("f") Sleep(1000) Send("1") Sleep(1000) Send("7") Sleep(100) Send("x") Sleep(100) $i = $i + 1 WEnd Send("9") Sleep(10000) EndFunc - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
MvGulik Posted April 7, 2010 Share Posted April 7, 2010 (edited) whatever Edited February 7, 2011 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
mrsyok Posted April 8, 2010 Author Share Posted April 8, 2010 snowmaker : you are the best bro.. thanks.. MvGulik : thank u so much for the idea.. problem solved, have a nice day. 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