Sign in to follow this  
Followers 0
Mattraks

Delete

8 posts in this topic

#1 ·  Posted (edited)

Delete

Edited by Mattraks

Share this post


Link to post
Share on other sites



"do

sleep

until" is not better?

And call your fonction "in the function", look strage...never end?

Share this post


Link to post
Share on other sites

This function does what is called a recursive call and $autoclickstatusnum has to change before all the calls will return. So basically you could end up in a situation where all your available memory are wasted.

Us a loop instead.

Func _Click()
While $autoclickstatusnum = 1
    MouseClick("Left")
    Sleep($autoclicksleep)
WEnd
EndFunc

You should also explore Addlibenable and addlibdisable in the help file..:)

Share this post


Link to post
Share on other sites

Um... what? I cant understand you.

Sorry i'm not english

if you want to do a function to check something (error for exemple) every x milliseconds, you can use AdlibEnable.

But in your exemple, the function never stop.

Can you explain what the function have to do?

:)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

If you are going to use the function "GUICtrlCreateInput" then you need something to trigger a "read" of that control, like a button push:

#include <GUIConstantsEx.au3>
GUICreate("My Proggy")
$autoclicksleep = GUICtrlCreateInput("3", 11, 11, 51, 21)
$button = GUICtrlCreateButton("Go", 73,11,40,23)
GUISetState()
While 1
    Sleep(60)
    $msg = GUIGetMsg()
    Select      
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
        
    Case $msg = $button
        Going()
        $msg = 0
        
    EndSelect
WEnd
Func Going()
    $Time = GUICtrlRead($autoclicksleep)
    $Time = $Time * 1000;convert to milliseconds for the AdlibEnable command
    _Click()
    AdlibEnable("_Click", $Time)
EndFunc
Func _Click()
; The something to do repeatedly, goes here ...
    TrayTip("My Proggy", "Squirrely business abounds", 5)
;MouseClick("Left")
EndFunc ;==>_Click
Edited by Squirrely1

Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites

$autoclicksleep = GUICtrlCreateInput("0", 160, 10, 50, 20)
$autoclicksleep = $autoclicksleep * 1000;convert to milliseconds for the AdlibEnable command
_Click()
AdlibEnable("_Click", $autoclicksleep)
While 1
    Sleep(20)
WEnd
Func _Click()
    MouseClick("Left")
EndFunc ;==>_Click
That's going to fail at the second line.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Try looking at my first post again. I updated it.


Das Häschen benutzt Radar

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  
Followers 0