Jump to content
Sign in to follow this  
Bubblewrap

Help with random, simple script

Recommended Posts

Bubblewrap

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

Share this post


Link to post
Share on other sites
Jos

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

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Bubblewrap

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

Share this post


Link to post
Share on other sites
Jos

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


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Bubblewrap

Wow...go me. Must've had a typo in it when I tried in the actual script. Working now...no problem.

Thanks for puttin up with me ^^

Share this post


Link to post
Share on other sites
jebus495

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)

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.