Michael36 Posted November 30, 2005 Share Posted November 30, 2005 hi all i'm having trouble with the TimerInit i'm trying to set a timer to set of $oIE.refresh i have a combo with preset times a example would be if i choose 30 sec in the combo this would set of $oIE.refresh Every 30 secs i'm not sure we can do this the help book has a few timer refs in it but nothing i'm looking to do any ideas on how i can do this ? or send me down the right path thank you michael Func combootwo() sleep($Combo2) $oIE.refresh EndFunc Link to comment Share on other sites More sharing options...
LxP Posted November 30, 2005 Share Posted November 30, 2005 You might want to look at AdLibEnable(), which runs a specified function at a specified interval.; Declare $oIE as global Global $oIE = ObjCreate(...) ; Somehow get the refresh delay ; Multiply by 1,000 for seconds Local $Delay = ... ; Instruct AutoIt to run some function every X milliseconds AdLibEnable('RefreshPage', $Delay) ; That function will run while the script is in memory While 1 Sleep(0x7FFFFFFFF) ; Or do other things WEnd Func RefreshPage() $oIE.Refresh() EndFunc Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 30, 2005 Moderators Share Posted November 30, 2005 (edited) Are you doing another function, and you want to stop somewhere in that function, and go to "Refresh" Function? You're code doesn't say much.You could use Adlib or TimerInit()AdlibEnable("combootwo", 30000) Func Main() ; Doing stuff EndFunc Func combootwo() sleep($Combo2) $oIE.refresh EndFuncIs way I'm interpreting your question.Dim $Timer Func Main() $TIMER = TimerInit() While 1 ;Do Stuff If TimerDiff($Timer) / 1000 >= 30 Then combootwo() $TIMER = TimerInit() EndIf Wend EndFunc Func combootwo() sleep($Combo2) $oIE.refresh EndFuncIs another way I'm interpreting your question.Hope it helps...EditHa... you type faster than me LxP!! Edited November 30, 2005 by ronsrules Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Michael36 Posted November 30, 2005 Author Share Posted November 30, 2005 (edited) thank you again LxP for your help i will study that thank you ronsrules michael Edited November 30, 2005 by Michael36 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