Jump to content
Sign in to follow this  
IspanikaS

"Sleep" problems

Recommended Posts

IspanikaS

I'm still a newbie, i learned most tutorials and even made a script for what i wanted, but i have a problem understanding delays.

I wanna make this part of the script to do:

1. Use button 1, reuse it every 4+1sec.

2. Use button 2, reuse it every 4sec. (max 3 times)

3. Use button 3, reuse it every 4+2sec.

4. use button 4, reuse it every 15sec. no matter at witch line script is.

But i fail...it does the clicks very randomly and skips like most of them :) I have achieved it for now with repeating the same code 3 times, what was my goal.

MouseClick("right")
                Sleep(1000)
MouseClick("middle")
                Sleep(4000)
MouseClick("left")
                Sleep(1000)
MouseClick("right")
                Sleep(1000)
MouseClick("middle")
                Sleep(4000)
MouseClick("left")
                Sleep(1000)
MouseClick("right")
                Sleep(1000)
MouseClick("middle")
                Sleep(4000)
MouseClick("left")
                Sleep(1000)

Should "sleep" be after the action to define how long to wait to execute the next one or before it ? Can i make it in seconds ?

Also how to make the script wait till certain action finishes (15sec.) and continue from a further point, while other action is executed constantly in that 15sec. time :graduated:

Ty for any help ;)

Share this post


Link to post
Share on other sites
JohnOne

Sleep() function will exactly that, wherever you put it, it will stop doing anything else for the period of time you specify. (Not brain surgery)

Sleep() parameter is milliseconds <- google if you don't know what that is, and use mathematics to enter seconds (Primary school education needed)

Good luck.


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
Mat

For the second part... The answer is no if the question is taken literally.

However, the difference between executing constantly in the background and performing an action that appears to be in the background is important.

Look at AdlibRegister and see if it does what you want.

Share this post


Link to post
Share on other sites
IspanikaS

Ty for the adlib, i'll use it now :graduated:

I found what was messing my sleeps, one command wasn't executing:

ControlSend("砀⤀刀瘀愀渀", "", "", "{NUMPAD6}") ; move screen right with 1 step
                Sleep(1000)

The problem is for some reason the NUMPAD6 does not work inside the program...it is some hardcoded control.

I'll have to make the mouse just to move slooowly from 592.382 to 512.382 without clicking or doing anything else :)

Thx for help again, i'll figure out the last part myself ;)

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  

×