X42Negative Posted December 9, 2009 Share Posted December 9, 2009 (edited) Func SleepCheckLoop() $TotalSleepTime = GUICtrlRead($Input2) Sleep($TotalSleepTime) Return EndFunc ;==>SleepCheckLoop I want to check for this: If _IsPressed("23", $DllOpen) Then ExitLoop Exitloop, if it needs one, or Return. Halp? PS: Searching failed. Edited December 9, 2009 by X42Negative Link to comment Share on other sites More sharing options...
Developers Jos Posted December 9, 2009 Developers Share Posted December 9, 2009 Hey ... I think I smell somebody I know.... Let me think who it could be... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
X42Negative Posted December 10, 2009 Author Share Posted December 10, 2009 Hey ... I think I smell somebody I know.... Let me think who it could be... I've missed you Jos. Long time no see. I've been a bit rusty with AutoIt, and a solution to this cannot be found...Hmm...Oh, and nice new forum software. It's pretty expensive. Link to comment Share on other sites More sharing options...
MerkurAlex Posted December 10, 2009 Share Posted December 10, 2009 umm Func SleepCheckLoop() $TotalSleepTime = GUICtrlRead($Input2) local $curTime=0 While $curTime<$TotalSleepTime If _IsPressed("23", $DllOpen) Then ExitLoop sleep(1) $curTime +=1 Wend Return EndFunc ;==>SleepCheckLoop Probably not the BEST way to do this but it will work(it might miss a key press I doubt it) if you explain a little better what your trying to do i might be able to help more. [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
X42Negative Posted December 10, 2009 Author Share Posted December 10, 2009 (edited) That is pretty much what I'm trying to do. I might have to optimize it a little. And if I'm not mistaking, the lowest AutoIt can sleep is 10ms. Thanks for the code, I will try it now. Edited December 10, 2009 by X42Negative Link to comment Share on other sites More sharing options...
MerkurAlex Posted December 10, 2009 Share Posted December 10, 2009 (edited) Hmm not that I know of according to the help file sleep has a maximum sleep time but it does not say anything about a min timeMaximum sleep time is 2147483647 milliseconds (24 days)btw that would be "mistaken" not "mistaking" Edited December 10, 2009 by MerkurAlex [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
turbov21 Posted December 10, 2009 Share Posted December 10, 2009 How about using Timers.au3? (Couldn't find an easy way to capture keystrokes, so please excuse a chunk missing from the inner loop.) #Include <Timers.au3> Dim $lastKey = "None" Dim $waitTime = 1000 Dim $initTime = _Timer_Init() While $lastKey <> "X" While _Timer_Diff($initTime) > $waitTime ; Capture keystrokes and assign the last key to $lastkey EndIf MsgBox(0, "Last Key", $lastKey) Wend Link to comment Share on other sites More sharing options...
X42Negative Posted December 10, 2009 Author Share Posted December 10, 2009 Ah well, yes because it was sending way to slow, so I just added /10. Now it's pretty much accurate, and works well. Func SleepCheckLoop() $TotalSleepTime = GUICtrlRead($Input2)/10 local $curTime=0 While $curTime<$TotalSleepTime If _IsPressed("23", $DllOpen) Then Return sleep(10) $curTime +=1 Wend Return EndFunc ;==>SleepCheckLoop Thank you. Link to comment Share on other sites More sharing options...
MerkurAlex Posted December 10, 2009 Share Posted December 10, 2009 (edited) @turbov21 That should work as well but this line While _Timer_Diff($initTime) > $waitTime should be While _Timer_Diff($initTime) < $waitTime @X42Negative No problem hope it works properly Edited December 10, 2009 by MerkurAlex [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted December 10, 2009 Share Posted December 10, 2009 Hmm not that I know of according to the help file sleep has a maximum sleep time but it does not say anything about a min timebtw that would be "mistaken" not "mistaking" While there is no real "lowest", 1-9 will be run as 10 and 0 is... Special... Check this thread: link .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
MerkurAlex Posted December 10, 2009 Share Posted December 10, 2009 While there is no real "lowest", 1-9 will be run as 10 and 0 is... Special... Check this thread: linkWell... that's interesting thanks for the link [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] Link to comment Share on other sites More sharing options...
Developers Jos Posted December 10, 2009 Developers Share Posted December 10, 2009 I have the feeling my remark is ignored... wonder why that is? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted December 10, 2009 Share Posted December 10, 2009 I have the feeling my remark is ignored... wonder why that is?Maybe because you're the only one that knows who he is? Maybe if you give us a tip? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Developers Jos Posted December 10, 2009 Developers Share Posted December 10, 2009 (edited) Maybe because you're the only one that knows who he is? Maybe if you give us a tip?This is nearly correct: also the OP knows who he/she is so I expect a reply from Him/Her! Edited December 10, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
X42Negative Posted December 10, 2009 Author Share Posted December 10, 2009 (edited) This is nearly correct: also the OP knows who he/she is so I expect a reply from Him/Her!I just kind of did what all the "newbies" do, come in here and request help. Wasn't meant to take it that way, but it got finished after all. Anyway, how is everything Jos? It's been awhile. I assume you know who I am, although I'm not 100% sure of this. Anyway, thanks for the help everyone.Anyway, I am leaving now Jos. Your forum has helped me once again. Edited December 10, 2009 by X42Negative Link to comment Share on other sites More sharing options...
Developers Jos Posted December 10, 2009 Developers Share Posted December 10, 2009 (edited) I just kind of did what all the "newbies" do, come in here and request help. Wasn't meant to take it that way, but it got finished after all. Anyway, how is everything Jos? It's been awhile. I assume you know who I am, although I'm not 100% sure of this. Anyway, thanks for the help everyone.Anyway, I am leaving now Jos. Your forum has helped me once again.Of course I know who you are and you should know that as you met both my "lets give him a couple of chances" site as well as "you are not screwing with me anymore" site.ByeJosedit: for those I left totally puzzled: maybe swift rings a bell? Edited December 10, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted December 10, 2009 Share Posted December 10, 2009 edit: for those I left totally puzzled: maybe swift rings a bell?2000 posts and still can't handle a simple Sleep()?....Why am I not surprised? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Developers Jos Posted December 10, 2009 Developers Share Posted December 10, 2009 2000 posts and still can't handle a simple Sleep()?....Why am I not surprised? You need to add all these together to come up with the correct post count: GoldFishCrackersIUnderstandAutoItKuKluxKlanNewUser554Rejectedz SwiftTehWhaleX42NegativeXCaliburSo propably now also understand why I know exactly when he returns. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
MerkurAlex Posted December 11, 2009 Share Posted December 11, 2009 Not 100% sure what happened but im guessing he has been banned many times. I just had to say I lol'd at the name "IUnderstandAutoIt" im sure you can guess why [quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote] 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