civilcalc Posted March 31, 2009 Posted March 31, 2009 I have made an avi file of a spinning wheel, it has 5 sections on it and the wheel will currently spin an infinate amount of times, I want to be able to generate a random number 1-5 and stop the wheel on the given section, but if I use _guictrlavi_seek() it will immeadiatly jump to the specified frame, is there a way to get it stop when it reaches a certain frame in the cycle, rather than to just jump to it? Maybe something like this? $rnd = Random(1,5,1) $frame = _Guictrlavi_getframe($avi) While $rnd <> $frame Sleep(1000) $frame = _Guictrlavi_getframe($avi) Wend ????? Thankyou
WideBoyDixon Posted March 31, 2009 Posted March 31, 2009 (edited) _GUICtrlAVI_Play() allows you to specify the end frame of an AVI. If you're looking for some kind of spinner which then stops (it's hard to know from your description) then why not: $rnd = Random(5, 15, 1) _GUICtrlAVI_Play($hWnd, 0, -1, $rnd) $rnd = Random(1, 5, 1) _GUICtrlAVI_Play($hWnd, 0, $rnd, 1) WBD Edited March 31, 2009 by WideBoyDixon [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center]
civilcalc Posted March 31, 2009 Author Posted March 31, 2009 _GUICtrlAVI_Play() allows you to specify the end frame of an AVI. If you're looking for some kind of spinner which then stops (it's hard to know from your description) then why not:$rnd = Random(5, 15, 1)_GUICtrlAVI_Play($hWnd, 0, -1, $rnd)$rnd = Random(1, 5, 1)_GUICtrlAVI_Play($hWnd, 0, $rnd, 1)WBDI tried that, but it doesnt wait for the first play command to finish before executing the second play command, so in effect you only see the second animation, ie it will revolve once and then stop. thanks for your input though.
WideBoyDixon Posted March 31, 2009 Posted March 31, 2009 Sorry. Was being lazy and didn't test my script before posting. You *should* be able to use _GUICtrlAVI_IsPlaying() to determine whether the clip is playing but it doesn't appear to work for me. Even the AutoIt help example doesn't work :-| If it works for you then: $rnd = Random(5, 15, 1) _GUICtrlAVI_Play($hWnd, 0, -1, $rnd) While (_GUICtrlAVI_IsPlaying($hWnd)) Sleep(10) Wend $rnd = Random(1, 5, 1) _GUICtrlAVI_Play($hWnd, 0, $rnd, 1) [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center]
civilcalc Posted March 31, 2009 Author Posted March 31, 2009 Sorry. Was being lazy and didn't test my script before posting. You *should* be able to use _GUICtrlAVI_IsPlaying() to determine whether the clip is playing but it doesn't appear to work for me. Even the AutoIt help example doesn't work :-| If it works for you then: $rnd = Random(5, 15, 1) _GUICtrlAVI_Play($hWnd, 0, -1, $rnd) While (_GUICtrlAVI_IsPlaying($hWnd)) Sleep(10) Wend $rnd = Random(1, 5, 1) _GUICtrlAVI_Play($hWnd, 0, $rnd, 1) ah, I see. good thinking. I will give it a go. thanks
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