Jump to content

can someone tell me why this doesnt work?


mattfaust
 Share

Recommended Posts

#Include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1

For $i = 10 to 1 Step -1

sleep(1000)

ToolTip($i,1,1)

If _IsPressed("01", $dll) Then $i = 10

Next

wend

what Im going for is a 10 second countdown, that when the user left clicks it will reset the count

thanks

Link to comment
Share on other sites

#Include <Misc.au3>

$dll = DllOpen("user32.dll")

While 1

For $i = 10 to 1 Step -1

sleep(1000)

ToolTip($i,1,1)

If _IsPressed("01", $dll) Then $i = 10

Next

wend

what Im going for is a 10 second countdown, that when the user left clicks it will reset the count

thanks

Give this a shot. The ExitLoop should exit out of the For...Next, causing it to return to the While...WEnd, thus auto-initiating the 10->1 countdown.

#Include <Misc.au3>
$dll = DllOpen("user32.dll")
While 1
    For $i = 10 To 1 Step - 1
        Sleep(1000)
        ToolTip($i, 1, 1)
        If _IsPressed("01", $dll) Then
            ExitLoop
        EndIf
    Next
WEnd
Edited by Monamo

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

Link to comment
Share on other sites

actually, if i click as fast as my finget will allow it does rest. Is it not "seeing" my clicks because the sleep?

If that is the case how can I make it a 10-sec timeout w/o sleep?

Try

For $i = 100 to 1 Step -1
Sleep(100)

Edit: Reasoning = the 100 on Sleep will yield a better response factor, and the count increase *10 is to counter the Sleep decrease /10

Edited by Monamo

- MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]

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