Dunadan Posted November 18, 2009 Share Posted November 18, 2009 Hello everyone! I'm pretty new at scripting, but i'm trying to make simple script which "reads" current time in milliseconds and makes an action when they are = or over 900. What i need is a script that reads (without a GUI possibly) milliseconds and when they are 900~ it sends a send("{ENTER}") command. I've tried this, but it's not working HotKeySet("{F3}", "end_script") HotKeySet("{F2}", "check1") HotKeySet("{F1}", "pause_script") $systm_stw = 0 Sleep(3000) AutoItSetOption("SendKeyDelay", 0000); $msec=@MSEC While 1 = 1 check1() Wend func check1() if $msec = 900 then send() endif endfunc func send() send("{ENTER}"); endfunc func pause_script() While ($systm_stw == 0) WEnd EndFunc func end_script() Exit EndFunc Also pause and restart script functions are not working, even if they worked with some other script i made.... Please some1 help me, i think it's not something hard to make for you! Link to comment Share on other sites More sharing options...
Authenticity Posted November 18, 2009 Share Posted November 18, 2009 Please use AutoIt code tags -> when posting AutoIt code.expandcollapse popupOpt("SendKeyDelay", 0) HotKeySet("{F3}", "end_script") HotKeySet("{F2}", "check1") HotKeySet("{F1}", "pause_script") Sleep(3000) Local $systm_stw = False, $msec = TimerInit() $msec = @MSEC While 1 check1() Sleep(20) WEnd Func check1() If TimerDiff($msec) >= 900 Then $msec = TimerInit() _Send() EndIf EndFunc ;==>check1 Func _Send() Send("{ENTER}"); EndFunc ;==>_Send Func pause_script() $systm_stw = Not $systm_stw While $systm_stw Sleep(20) WEnd EndFunc ;==>pause_script Func end_script() Exit EndFunc ;==>end_script Link to comment Share on other sites More sharing options...
Dunadan Posted November 18, 2009 Author Share Posted November 18, 2009 Sorry for not using tags! Thank you for the script, it rocks! It seems it'll take me some time to study how it works! Thanks for help, yuo solved me a huge problem ^^ 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