Moras Posted April 21, 2006 Share Posted April 21, 2006 (edited) ok it may be that im very tired but how do i make this script repeat itself if i use a continuos loop it just repeats the clicking part opps ok complete scritp there now dont know why i didnt post it all first time #include <GUIConstants.au3> #include <Date.au3> Global $Secs, $Mins, $Hour, $Time, $InitialT, $TargetT GUICreate("Timer", 200, 100) $MinIn = GUICtrlCreateInput("00", 70, 10, 30, 20, $ES_NUMBER) $label = GUICtrlCreateLabel(":", 101, 12) $SecIn = GUICtrlCreateInput("00", 105, 10, 30, 20, $ES_NUMBER) $start = GUICtrlCreateButton("Start", 75, 50, 50, 30) $timeLabel = GUICtrlCreateLabel("00:00:00", 80, 20) GUICtrlSetState($timeLabel, $GUI_HIDE) GUISetState(@SW_SHOW) $started = 0 While 1 ;After every loop check if the user clicked something in the GUI window $msg = GUIGetMsg() Select ;Check if user clicked on the close button Case $msg = $GUI_EVENT_CLOSE ;Destroy the GUI including the controls GUIDelete() ExitLoop Case $msg = $start If GUICtrlRead($start) == "Start" Then StartTimer() Else StopTimer() EndIf EndSelect WEnd Exit Func StartTimer() GUICtrlSetData($start, "Stop") GUICtrlSetState($MinIn, $GUI_HIDE) GUICtrlSetState($label, $GUI_HIDE) GUICtrlSetState($SecIn, $GUI_HIDE) GUICtrlSetState($timeLabel, $GUI_SHOW) $InitialT = TimerInit() $TargetT = (GUICtrlRead($MinIn) * 60 + GUICtrlRead($SecIn)) *1000 AdlibEnable("Timer") EndFunc ;==>StartTimer Func StopTimer() GUICtrlSetData($start, "Start") GUICtrlSetState($MinIn, $GUI_SHOW) GUICtrlSetState($label, $GUI_SHOW) GUICtrlSetState($SecIn, $GUI_SHOW) GUICtrlSetState($timeLabel, $GUI_HIDE) AdlibDisable() EndFunc ;==>StartTimer Func Timer() $TimeLeft = $TargetT - TimerDiff($InitialT) If $TimeLeft > 0 Then _TicksToTime(Int($TimeLeft), $Hour, $Mins, $Secs) ; save current time to be able to test and avoid flicker.. Local $sTime = $Time $Time = StringFormat("%02i:%02i:%02i", $Hour, $Mins, $Secs) If $sTime <> $Time Then GUICtrlSetData($timeLabel, $Time) Else MouseClick("left") EndIf EndFunc ==> Edited April 21, 2006 by Moras Link to comment Share on other sites More sharing options...
Xenobiologist Posted April 21, 2006 Share Posted April 21, 2006 HI, could please post the complete script. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Moras Posted April 21, 2006 Author Share Posted April 21, 2006 is it also possible to get the time to randomly stop at an interval say 2 secs more than that of the time i enter? say i enter 10 secs and it will click the mouse button at random times between the 10 and 12 secs? i couldnt see anything about that in the timers section of the help Link to comment Share on other sites More sharing options...
Moras Posted April 23, 2006 Author Share Posted April 23, 2006 bump anyone? Link to comment Share on other sites More sharing options...
Onoitsu2 Posted April 23, 2006 Share Posted April 23, 2006 As far as in YOUR script I don't know where you would put this, but generally I get a random extra wait time like this in my scripts... If Random(0,1,1) Then Sleep(2000);you said 2 extra seconds Endif Things I have made:[font="Trebuchet Ms"]_CheckTimeBlock UDF(LT)MOH Call Ignore List (MOH = Modem On Hold)[/font] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now