Jump to content

Sleep Command help


Rewl
 Share

Recommended Posts

Hey guys so I'm making a script, and I want it so if i MouseClick("right") Then script sleeps for 2 seconds.

I've tried everything though.. even the following.. And it doesn't work, can you guys help me?

$right = MpuseClick("right")

also you might need this to understand what $click is

Dim $click = False

Func startpause()
   If $click = False Then
      $click = True
   Else
      $click = False
   EndIf
EndFunc

While True
    If $click = True Then
    MouseClick("left")
EndIf
sleep(20)
WEnd

and this is the code that I tried to use and it doesn't work

If $right Then
    $click = False
        sleep(2000)
Else
    $click = True
EndIf

[size="1"]Programs: Draw Tool | [/size]

Link to comment
Share on other sites

check the help for _ispressed

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

have you try like this ?

#include <Misc.au3>

While 1
    If _IsPressed ( "02" ) = 1 Then 
        ConsoleWrite ( "Sleep ( 2000 )" & @Crlf )
        Sleep ( 2000 ) 
    EndIf   
    Sleep ( 10 )
WEnd
Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

How about? You show us your whole source, and we will show you why its not making with the right click sleep action.

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

How about? You show us your whole source, and we will show you why its not making with the right click sleep action.

#include<IE.au3>
HotKeySet("{ESC}" , "close")
HotKeySet("{SPACE}" , "startpause")

Dim $click = False
$dll = DllOpen("user32.dll")


MsgBox(64, "Rewl's XXXX v1.0" , "Thank-you for using Auto Clicker, Press ""ESC"" to close the program and ""G"" to pause the clicker and SpaceBar to start it.")

Func close()
    $iE = _IECreate()
    $m = MsgBox(4 , "Rewl's XXXXX v1.0" , "Thank-you for trying the program, Press yes to visit Auto-IT Thread.")
    IF $m = 6 Then
        _IENavigate($iE , "")
    EndIf
    Exit
EndFunc

Func startpause()
   If $click = False Then
      $click = True
      ToolTip("Rewl XXXXXX v1.0 Running." , 0 , 0)
   Else
      $click = False
      ToolTip("Rewl XXXXXX v1.0 Paused." , 0 , 0)
   EndIf
EndFunc
    
While True
    If $click = True Then
    MouseClick("left")
EndIf
sleep(20)
WEnd
#include <Misc.au3>

While 1
    If _IsPressed ( "02" ) = 1 Then 
        ConsoleWrite ( "Sleep ( 2000 )" & @Crlf )
        Sleep ( 2000 ) 
    EndIf   
    Sleep ( 10 )
WEnd

[size="1"]Programs: Draw Tool | [/size]

Link to comment
Share on other sites

multiple whiles is teh ugly

#include<IE.au3>
#include <Misc.au3>


HotKeySet("{ESC}" , "close")
HotKeySet("{SPACE}" , "startpause")

Dim $click = False
$dll = DllOpen("user32.dll")


MsgBox(64, "Rewl's XXXX v1.0" , "Thank-you for using Auto Clicker, Press ""ESC"" to close the program and ""G"" to pause the clicker and SpaceBar to start it.")

Func close()
    $iE = _IECreate()
    $m = MsgBox(4 , "Rewl's XXXXX v1.0" , "Thank-you for trying the program, Press yes to visit Auto-IT Thread.")
    IF $m = 6 Then
        _IENavigate($iE , "")
    EndIf
    Exit
EndFunc

Func startpause()
   If $click = False Then
      $click = True
      ToolTip("Rewl XXXXXX v1.0 Running." , 0 , 0)
   Else
      $click = False
      ToolTip("Rewl XXXXXX v1.0 Paused." , 0 , 0)
   EndIf
EndFunc


While 1
    If _IsPressed ( "02" ) = 1 Then
        ConsoleWrite ( "Sleep ( 2000 )" & @Crlf )
        Sleep ( 2000 )
    EndIf

   If $click = True Then
    ConsoleWrite ( "TRUE" & @Crlf )
EndIf
sleep(20)

WEnd

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

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