Jump to content

"Sleep" problems


IspanikaS
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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