Jump to content

Help with random, simple script


Recommended Posts

Very new to this program. So heres my super simple script(right click repeatedly) but I am having trouble figuring out how to random a sleep timer. Trying to set a random time on the sleep that is within the Do...Until loop.

Also, is there a way to make AutoIt recognize hotkeys while its running in the background?

Thanks for any help :)

Global $click = InputBox ("Right Clicker", "How many clicks?", "400", "")

Func countDown($click)

$click -= 1

return $click

MsgBox( "counter", "$click")

EndFunc

Sleep(10000)

Do

$click = countDown($click)

MouseClick("right")

Sleep(5000) ; <--help me randomize this sleep timer!

Until $click = 0

Exit

Link to comment
Share on other sites

  • Developers

Have you opened the helpfile and searched for the word random?

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

yup, heres what i attempted to do Sleep(Random(5000,7000,1)) and also tried righting a quick function with random inside it but that wouldnt work for me if there was more than just the 1 timer i was trying to random

Sleep() statement as you wrote it will work fine, but I am lost on what you are saying in the second part of your reply.

So what is the exact problem you are having?

Jois

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Very new to this program. So heres my super simple script(right click repeatedly) but I am having trouble figuring out how to random a sleep timer. Trying to set a random time on the sleep that is within the Do...Until loop.

Also, is there a way to make AutoIt recognize hotkeys while its running in the background?

Thanks for any help :)

Global $click = InputBox ("Right Clicker", "How many clicks?", "400", "")

Func countDown($click)

$click -= 1

return $clickhttp://www.autoitscript.com/forum/index.php?app=forums&module=post&section=post&do=reply_post&f=2&t=103702&qpid=734384

MsgBox( "counter", "$click")

EndFunc

Sleep(10000)

Do

$click = countDown($click)

MouseClick("right")

Sleep(5000) ; <--help me randomize this sleep timer!

Until $click = 0

Exit

Global $click = InputBox ("Right Clicker", "How many clicks?", "400", "")

Func countDown($click)
$click -= 1
return $click
EndFunc

ToolTip($click, 0, 0, "# of clicks")
Sleep(10000)

Do
$click = countDown($click)
MouseClick("right")
ToolTip($click, 0, 0, "# of clicks")
Sleep(Random(5000,7000,1))

Until $click = 0
ToolTip("")
Exit

That is my version of your script.

MsgBox( "counter", "$click")

That needs to be

MsgBox("", "counter", $click)
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...