evilelf Posted October 4, 2006 Share Posted October 4, 2006 Hello i forgot how to make a scrip restart. I am maken this scip after its all done doing what needs to be done it will restart. But i just forgot. I cant find it i know i Ran in to it here. Link to comment Share on other sites More sharing options...
cppman Posted October 4, 2006 Share Posted October 4, 2006 (edited) a script restart? Perhaps putting the code you want to restart inside a loop: ;Loop forever While 1 ;Put code here Wend ;Loop 50 times For $i = 1 to 50 ;Put code here Next ;Loop 10 times Local $i = 1 Do $i+= 1 ;Put code here Until $i = 10 There are many ways.. Edited October 4, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
evilelf Posted October 4, 2006 Author Share Posted October 4, 2006 ;Loop forever While 1 ;Put code here Wend thats what i need i did this and it gives me errors. Thats why i thought i was doing it wrong. Link to comment Share on other sites More sharing options...
cppman Posted October 4, 2006 Share Posted October 4, 2006 (edited) What are the errors you are getting? and also what is the code you are using...? Edited October 4, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 4, 2006 Moderators Share Posted October 4, 2006 (edited) ;Loop foreverWhile 1;Put code hereWend thats what i need i did this and it gives me errors. Thats why i thought i was doing it wrong.It's more than likely the ";Put code here" giving you errors. Edited October 4, 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...
evilelf Posted October 4, 2006 Author Share Posted October 4, 2006 see i did somthing like this. while send("1") send("1") send("1") send("1") send("1") sleep(10000) send("1") send("1") send("1") send("1") send("1") wend endif But see i Had alot more code around it so i just redone alot of it clean it up and it works. Link to comment Share on other sites More sharing options...
cppman Posted October 4, 2006 Share Posted October 4, 2006 (edited) while 1 ;Don't forget the 1! or any other expression your evaluating. send("1") send("1") send("1") send("1") send("1") sleep(10000) send("1") send("1") send("1") send("1") send("1") wend ;endif Edited October 4, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 4, 2006 Moderators Share Posted October 4, 2006 while 1 ;Don't forget the 1! or any other expression your evaluating. send("1") send("1") send("1") send("1") send("1") sleep(10000) send("1") send("1") send("1") send("1") send("1") wend endifA complete example would be nice, not even Chris's would work with that EndIf at the end of WEnd. 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...
evilelf Posted October 4, 2006 Author Share Posted October 4, 2006 (edited) well i got it done but now i am stuck on a little problem. I cant get it to Do a Random Pick. i need it to pick up to 8 items random a sleep time. But i cant i tryed. If Random() < 2.0 Then $sleep = Sleep(8000) Else $sleep = Sleep(7000) Else $sleep = sleep(6000) Else $sleep = Sleep(300000) Else $sleep = sleep(2000) Else $sleep = Sleep(200000) Else $sleep = Sleep(5000) Else $sleep = Sleep(150000) Endif $sleep But this does not work. am i close at all??? Edited October 4, 2006 by evilelf Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted October 4, 2006 Moderators Share Posted October 4, 2006 well i got it done but now i am stuck on a little problem. I cant get it to Do a Random Pick. i need it to pick up to 8 items random a sleep time. But i cant i tryed. If Random() < 2.0 Then $sleep = Sleep(8000) Else $sleep = Sleep(7000) Else $sleep = sleep(6000) Else $sleep = Sleep(300000) Else $sleep = sleep(2000) Else $sleep = Sleep(200000) Else $sleep = Sleep(5000) Else $sleep = Sleep(150000) Endif $sleep But this does not work. am i close at all???Might want to check the help file on how to use Random(). 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 October 4, 2006 Share Posted October 4, 2006 (edited) $random_number = random(10, 100, 1) if ($random_number <= 50) Then sleep($random_number*2) else sleep($random_number/2) endif What will help you through programming ALOT! is to look for a syntax tutorial. It will help you understand why multiple else state statements under 1 if statement does'nt work Just a suggestion. Edited October 4, 2006 by CHRIS95219 Miva OS Project Link to comment Share on other sites More sharing options...
evilelf Posted October 4, 2006 Author Share Posted October 4, 2006 (edited) Ok thnx man!!!!! Edited October 4, 2006 by evilelf 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