Jump to content

how would i loop it?


Recommended Posts

  • Moderators

;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.

It's more than likely the ";Put code here" giving you errors. Edited 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

  • Moderators

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
A 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

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 by evilelf
Link to comment
Share on other sites

  • Moderators

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

$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 :lmao:

Just a suggestion.

Edited by CHRIS95219
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...