Jump to content

Help Pausing Script!


Recommended Posts

Hello, I need help pausing my script I made a while ago. I need it to pause for 2 seconds. Can some one give me the Code. Oh yea and here is my Script.

$answer = msgbox(1, "URC", "Ultimate Left Clicker Was Created By: Hunter Davis")
$answer = msgbox(1, "URC", "F4 Starts the RC & F5 Exits the RC")

HotKeySet("{F5}", "ExitProg") 
HotKeySet("{F4}", "StartProg") 

While 1
    Sleep(100) 
    Wend

Func StartProg()  
    while 1
    MouseClick("left")
    Sleep(50)
    WEnd
EndFunc


Func ExitProg()  
    Exit 0
EndFunc

Thank You

Hunter Davis.

Link to comment
Share on other sites

  • Developers

Hello, I need help pausing my script I made a while ago. I need it to pause for 2 seconds. Can some one give me the Code. Oh yea and here is my Script.

Hey Hunter,

What are those Sleep() statement used for in your script?

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

Sleep(2000) Pauses the execution of the script for 2 seconds

I haven't used AutoIt for a while and I thought that sleep had to do with the pausing of the script. Oh yea, and one more thing. Theirs 2 Sleeps in the script which one do I change it to?
Link to comment
Share on other sites

add this to your code will cause a 2 second pause when the pause key is pressed. I'm sure you can add what you need from this.

-1

HotKeySet("{Pause}", "pause")

Func pause()
ToolTip("Script is Paused.")
sleep(2000)
ToolTip("")
EndFunc

What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.

Link to comment
Share on other sites

I haven't used AutoIt for a while and I thought that sleep had to do with the pausing of the script. Oh yea, and one more thing.

why didn't you try yourself before posting?

Theirs 2 Sleeps in the script which one do I change it to?

I can not read your mind
Link to comment
Share on other sites

I haven't used AutoIt for a while and I thought that sleep had to do with the pausing of the script. Oh yea, and one more thing. Theirs 2 Sleeps in the script which one do I change it to?

do you want the script to click once every 2 seconds?

Func StartProg()  
    while 1
    MouseClick("left")
    Sleep(2000) ; sleep for 2 seconds before clicking left again.
    WEnd
EndFunc
Edited by Negative1

What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.

Link to comment
Share on other sites

  • Developers

I haven't used AutoIt for a while and I thought that sleep had to do with the pausing of the script. Oh yea, and one more thing. Theirs 2 Sleeps in the script which one do I change it to?

You know what: spend some time searching an testing yourself without bothering us.

Comeback when you have a real question

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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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